-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Anderson2021 autoscheduler plays dubious games with unique_ptr<> #7703
Comments
This was referenced Jul 24, 2023
This was referenced Jul 25, 2023
Merged
steven-johnson
added a commit
that referenced
this issue
Aug 1, 2023
ardier
pushed a commit
to ardier/Halide-mutation
that referenced
this issue
Mar 3, 2024
* Attempt to fix halide#7703 * fixes * Update LoopNest.cpp * Update GPULoopInfo.h * Fixes. * clang-tidy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While investigating #7606 I noticed this code in the Anderson2021 codebase:
since
thread_info
is a member ofthis
, and declared as a plainconst ThreadInfo*
, after this call, it refers to an unowned pointer... the ownership is in the returned unique_ptr. Since the only two call sites immediately assign the result to a local unique_ptr, this member var is guaranteed to bestale
at the end of the calling routine.I'm not sure what the right fix is here because I don't know the intended semantics --
shared_ptr
might be appropriate, but it's not clear to me whether the returned result is intended to be mutable or not, or what constraints there are on mutability.The current code looks absolutely unsafe, however, and needs fixing; if there are similar code patterns elsewhere in this codebase, they need examination as well.
The text was updated successfully, but these errors were encountered: