-
Notifications
You must be signed in to change notification settings - Fork 323
Fix use-after-free in LoopUnrollPatterns.inc #3752
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
Fix use-after-free in LoopUnrollPatterns.inc #3752
Conversation
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Signed-off-by: Thomas Alexander <talexander@nvidia.com>
9e656f9 to
ad0a96d
Compare
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
lmondada
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.
Thanks!
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
|
CUDA Quantum Docs Bot: A preview of the documentation can be found here. |
Description
In
LoopUnrollPatterns.inc, after replacing acc.continue op, the code would unconditionally check if (allowBreak) and attempt to cast term (the original terminator) to acc.breakop. However,replaceOpWithNewOperases the original operation, leaving term as a dangling pointer. This caused failures in tests on MacOS that are otherwise not normally detectable on Linux, presumably due to MacOS's more aggressive allocator.I wasn't able to prepare a regression test as a reproducer with scribbling like in #3748 on Linux in the devcontainer. However, I could reproduce with ASAN manually on Linux (pointing to the need for a CI job to automate this):