Add exception handlers for stoll in jit/frontend/schema_type_parser.cpp#94295
Add exception handlers for stoll in jit/frontend/schema_type_parser.cpp#94295m4drat wants to merge 1 commit intopytorch:masterfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/94295
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit e2349e6: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot rebase |
|
@pytorchbot successfully started a rebase job. Check the current status here |
|
Successfully rebased |
4de6d2a to
e2349e6
Compare
davidberard98
left a comment
There was a problem hiding this comment.
thanks for the PR! tentatively it looks good, but please wait for CI to finish to make sure nothing fails (I rebased for you with the @ pytorchbot command, tests are still running)
|
@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 |
|
The merge job was canceled. If you believe this is a mistake,then you can re trigger it through pytorch-bot. |
|
@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 |
|
@m4drat I am also planing add fuzz testing to pytorch. Is it difficult for you to share the fuzzing code with Pytorch test CI? |
You can find all the fuzzing code here https://github.com/ispras/oss-sydr-fuzz/tree/master/projects/pytorch |
Hi!
I've been fuzzing different pytorch modules, and found a few crashes.
Specifically, I'm talking about
schema_type_parser.cppandirparser.cpp. Inside these files, different standard conversion functions are used (such asstoll,stoi,stod,stoull). However, defaultstdexceptions, such asstd::out_of_range,std::invalid_argument, are not handled.Some of the crash-files:
crash-493db74c3426e79b2bf0ffa75bb924503cb9acdc.zip - crash source: schema_type_parser.cpp:272
crash-67bb5d34ca48235687cc056e2cdeb2476b8f4aa5.zip - crash source: schema_type_parser.cpp:240
crash-0157bca5c41bffe112aa01f3b0f2099ca4bcc62f.zip - crash source: schema_type_parser.cpp:179
crash-430da923e56adb9569362efa7fa779921371b710.zip - crash source: schema_type_parser.cpp:196
The provided patch adds exception handlers for
std::invalid_argumentandstd::out_of_range, to rethrow these exceptions withErrorReport.How to reproduce
To reproduce the crash, use provided docker: Dockerfile
Build the container:
docker build -t oss-sydr-fuzz-pytorch-reproduce .Copy crash file to the current directory
Run the container:
docker run --privileged --network host -v `pwd`:/homedir --rm -it oss-sydr-fuzz-pytorch-reproduce /bin/bashAnd execute the binary:
/irparser_fuzz /homedir/crash-67bb5d34ca48235687cc056e2cdeb2476b8f4aa5After execution completes you will see this error message:
And this stacktrace:
Following these steps with the remaining crashes will give you almost the same results.