Skip to content

Fix an unsafe indexing in fx exception handling#169140

Closed
gmagogsfm wants to merge 1 commit intopytorch:mainfrom
gmagogsfm:fix_inductor_e
Closed

Fix an unsafe indexing in fx exception handling#169140
gmagogsfm wants to merge 1 commit intopytorch:mainfrom
gmagogsfm:fix_inductor_e

Conversation

@gmagogsfm
Copy link
Contributor

@gmagogsfm gmagogsfm commented Nov 26, 2025

There is an unsafe indexing into e.args in FX's exception handling, which would lead to nested exception and mask the actual error. This PR fixes it.

cc @ezyang @EikanWang @jgong5 @wenzhe-nrv

Signed-off-by: Yanan Cao <gmagogsfm@gmail.com>
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 26, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/169140

Note: Links to docs will display an error until the docs builds have been completed.

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: fx release notes category label Nov 26, 2025
@gmagogsfm gmagogsfm added release notes: not needed and removed release notes: fx release notes category labels Nov 26, 2025
@cyyever cyyever requested review from albanD and bobrenjc93 November 27, 2025 00:03
@cyyever
Copy link
Collaborator

cyyever commented Nov 28, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 28, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@cyyever
Copy link
Collaborator

cyyever commented Nov 28, 2025

@pytorchbot merge -f "ROCM pending"

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Dec 3, 2025
Inspired by #169140, without checking if the args tuple is empty, which could lead to IndexError and mask the actual error.

Pull Request resolved: #169234
Approved by: https://github.com/Lucaskabela
JacobSzwejbka pushed a commit that referenced this pull request Dec 8, 2025
There is an unsafe indexing into `e.args` in FX's exception handling, which would lead to nested exception and mask the actual error. This PR fixes it.

Pull Request resolved: #169140
Approved by: https://github.com/cyyever, https://github.com/Skylion007
JacobSzwejbka pushed a commit that referenced this pull request Dec 8, 2025
Inspired by #169140, without checking if the args tuple is empty, which could lead to IndexError and mask the actual error.

Pull Request resolved: #169234
Approved by: https://github.com/Lucaskabela
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request fx Merged release notes: not needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants