[Pytorch] Fix callstack pointer serialization bug (#63576)
authorKimish Patel <kimishpatel@fb.com>
Thu, 19 Aug 2021 20:32:26 +0000 (13:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 19 Aug 2021 20:35:52 +0000 (13:35 -0700)
commit11a40ad915d4d3d8551588e303204810887fcf8d
tree0f00b3b8a8637d5bfb4395964dbbc1cab625809e
parent6c3ebccc00dfca217094357a63e2be901ad7beb4
[Pytorch] Fix callstack pointer serialization bug (#63576)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63576

We serialize function name associated with InlinedCallStackPtr. This is derived
via querying Function* stored in InlinedCallStack. However this is a raw
pointer that is not gauranteed to be valid when we serialization happens. On
the other hand we also store function name separately when constructing
InlinedCallStack anyways. So this change just uniformly relies on function_name
instead of Function*

Test Plan: Internal build's asan failure + CI

Reviewed By: larryliu0820

Differential Revision: D30427029

fbshipit-source-id: de9617482404785920ed2e67b72f38461590fba3
torch/csrc/jit/mobile/debug_info.cpp
torch/csrc/jit/serialization/callstack_debug_info_serialization.cpp