-
Notifications
You must be signed in to change notification settings - Fork 161
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
Simplify TSS cleanup routines. Fixes #236 #249
Conversation
Instead of wrapping a default or user provided destructor into a virtual class and placing it into a shared_ptr it is now stored directly with an elided type, to not introduce UB it is not called directly but through a helper function which casts it back to the original type before calling.
Thanks for working on this. @pdimov Please, could you check this and tell us what do you think? Of course, I couldn't accept this change for boost.1.69, as it is too late. |
There is no consensus. GGC and Clang devs says that it is not a bug in sanitizer.
The PR can be reviewed without thinking about #236, it is just a nice side effect. You can check my bug report to LLVM https://bugs.llvm.org/show_bug.cgi?id=39191 for the simple example. The problem is that virtual methods ( |
The original code is a bit odd, I suspect it dates from premodern times when shared_ptr didn't have deleters and boost::function didn't exist. Nowadays you could just use The patch works too, I suppose. It's a matter of taste which one to pick. |
The code is now that old, it is from 2007, and it was using boost::function 332dd98.
You can treat it like that.
This case is not documented to be UB, even throwing and catching hidden symbols is not explicitly banned (see boostorg/function#24). Again:
Nothing. |
If this is not fixing nothing clear yet, why do you want I apply this PR then? |
OMG, you are killig me. The PR:
|
I've decided to give it a chance to this PR. We have now the time to fix it if there will be some regressions. |
Instead of wrapping a default or user provided destructor into a virtual
class and placing it into a shared_ptr it is now stored directly with
an elided type, to not introduce UB it is not called directly but through
a helper function which casts it back to the original type before calling.
I tried to touch as little lines as possible to make the review simpler.