-
Notifications
You must be signed in to change notification settings - Fork 1.6k
valarray: Fix delete in order to satisfy ASan #1496
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This looks good to me. I took a look and I think that _Myptr will always be allocated with the global operator new.
Could you elaborate on how this is to satisfy ASan? Is it that this breaks when a user provides delete but global operator new is overridden by ASan? Or is it just that ASan detects the difference between operator delete and a delete expression?
|
@cbezault I can't see any reason why the original code could generate wrong instructions for Reduced repro of the issue reported by ASan (originally found in production code compiled with VS 2019 16.8.2 on x64): |
cbezault
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.
That makes sense.
CaseyCarter
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.
I pushed a clarification of the comment on line 40; looks good to me, too.
abfd836 to
bb882ef
Compare
|
I pushed the change that I believe @StephanTLavavej requested. |
|
@cbezault I pushed a small change to clean up a pre-existing cosmetic issue that was being copied here. Lines 1383 to 1384 in 19c683d
I attempted to add test coverage for over-aligned types, but encountered @fsub I believe you're being prompted to sign our CLA because our commits editing additional lines have pushed your PR above a minimum threshold. |
|
Thank you all for your reviews, comments, and improvements! |
It's only necessary if you want us to merge your PR ;) I'm not a lawyer, but my understanding is that the CLA is necessary to establish that both parties clearly understand what code contribution means, i.e., what rights over the changes you are sharing with Microsoft. |
|
That's too bad. I hope that retracting the pull request will solve all legal issues. I'm sorry for the inconvenience. |
|
Since my last commit was cosmetic, I want to try reverting it and seeing if the CLA bot will accept the PR as minimal again. (I wouldn't have pushed that change if I knew this would happen.) |
This reverts commit 47a06f6.
|
@fsub We can proceed with merging your PR 😸 |
|
Thanks for fixing this bug, and congratulations on your first microsoft/STL commit! This will ship in VS 2019 16.9 Preview 3. 😺 🚀 |
|
@StephanTLavavej Thank you for your efforts and your open-mindedness. |
Particularly fixes 'AddressSanitizer: new-delete-type-mismatch' for
std::valarray<int>on x64.