-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[ARM] Fix infinite recursion in unwind #134387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/134387
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1de64b9 with merge base 2553278 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
nWEIdia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Geniously speed of light forward fix!
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
Perhaps as a follow up, we can remove IS_MACOS and the inductor check line? |
|
All tests are green. @pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Fixes pytorch#119905 The `TORCH_SHOW_CPP_STACKTRACES=1` setting on ARM causes infinite recursive unwind because on failure a `StackTraceFetcher` attempts to unwind the <ins>failed instruction</ins>: https://github.com/pytorch/pytorch/blob/5ad759ca33ba8299cf7e1a6bb1dff7c9a5555e29/torch/csrc/profiler/combined_traceback.cpp#L25 then the unwind itself fails: https://github.com/pytorch/pytorch/blob/5ad759ca33ba8299cf7e1a6bb1dff7c9a5555e29/torch/csrc/profiler/unwind/unwind.cpp#L10-L12 and it causes another attempt to unwind the failure in `unwind()`... In summary, the executed instruction is equivalent to: ```C++ std::vector<void*> unwind() { // some instructions ... return unwind(); } ``` This PR replaces `TORCH_CHECK` by `TORCH_WARN_ONCE` as it will not cause an uncontrolled recursion. The only side effect would be an empty back-trace. Huge thanks to @nWEIdia who found the root cause! Pull Request resolved: pytorch#134387 Approved by: https://github.com/eqy, https://github.com/nWEIdia, https://github.com/malfet
Fixes #119905
The
TORCH_SHOW_CPP_STACKTRACES=1setting on ARM causes infinite recursive unwind because on failure aStackTraceFetcherattempts to unwind the failed instruction:pytorch/torch/csrc/profiler/combined_traceback.cpp
Line 25 in 5ad759c
then the unwind itself fails:
pytorch/torch/csrc/profiler/unwind/unwind.cpp
Lines 10 to 12 in 5ad759c
and it causes another attempt to unwind the failure in
unwind()...In summary, the executed instruction is equivalent to:
This PR replaces
TORCH_CHECKbyTORCH_WARN_ONCEas it will not cause an uncontrolled recursion. The only side effect would be an empty back-trace.Huge thanks to @nWEIdia who found the root cause!
cc @malfet @snadampal @milpuz01