You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in a fairly complicated program (BIND 9) with internal libraries that use __attribute__((__constructor__)) and __attribute__((__destructor__)), we have LeakSanitizer report leaked memory from the main thread before the .fini section of the libraried are finished.
This gets even more complicated by fact that BIND 9 is using Userspace RCU library that also uses .init and .fini sections.
All of the constructors and destructors have default priorities.
Now, this gets even more complicated - RCU has an API that moves some free()-like calls to a dedicated thread (because this is how you do memory-reclamation in Userspace-RCU) and those objects are reported as lost unless you call rcu_barrier() before the program exits.
There is a call in the library destructor, but the destructor is apparently called after the LeakSanitizer is triggered and reports the leaked memory.
Now, the question (issue? bug report?) is - how to ensure that the LeakSanitizer runs after all other atexit()-like code is executed? Is there even a way to do that? It would be possible for me to execute some internal call from our own destructor, but is there a way to not execute the default one?
The text was updated successfully, but these errors were encountered:
Hi,
in a fairly complicated program (BIND 9) with internal libraries that use
__attribute__((__constructor__))
and__attribute__((__destructor__))
, we have LeakSanitizer report leaked memory from the main thread before the .fini section of the libraried are finished.This gets even more complicated by fact that BIND 9 is using Userspace RCU library that also uses
.init
and.fini
sections.All of the constructors and destructors have default priorities.
Now, this gets even more complicated - RCU has an API that moves some
free()
-like calls to a dedicated thread (because this is how you do memory-reclamation in Userspace-RCU) and those objects are reported as lost unless you callrcu_barrier()
before the program exits.There is a call in the library destructor, but the destructor is apparently called after the LeakSanitizer is triggered and reports the leaked memory.
Now, the question (issue? bug report?) is - how to ensure that the LeakSanitizer runs after all other atexit()-like code is executed? Is there even a way to do that? It would be possible for me to execute some internal call from our own destructor, but is there a way to not execute the default one?
The text was updated successfully, but these errors were encountered: