-
Notifications
You must be signed in to change notification settings - Fork 13k
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
libomptarget/src/omptarget.cpp:440: bad erase ? #38052
Comments
I think you are right. https://en.cppreference.com/w/cpp/container/map/erase: "References and iterators to the erased elements are invalidated." I guess you are not allowed to call operator++() on invalid iterators? Can you please give some more context: Is that output from a sanitizer? If yes, which one? What did the "input" program look like, ie what are you mapping? |
Agreed. There isn't much you can do with an invalid iterator, The example code in your link shows how to do it right.
I am not sure what you mean by sanitiser, but I did run an analyser
I don't understand this question. |
Ah ok, so this is purely from static analysis? In particular you are not running any OpenMP application that uses target regions? |
Yes.
Correct. |
I posted https://reviews.llvm.org/D51623 for review. I was able to craft a test case that was crashing without this patch, thanks for reporting! |
Landed in r341371. |
Extended Description
openmp-7.0.0rc1.src/libomptarget/src/omptarget.cpp:419] ->
openmp-7.0.0rc1.src/libomptarget/src/omptarget.cpp:440]: (error) Iterator 'it' used after element has been erased.
Source code is
maybe better code
The text was updated successfully, but these errors were encountered: