id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5226,weak_ptr in program segfaults after expiring from shared_ptr from dynamically loaded shared library which was destructed and unloaded,Peter Schüller ,Peter Dimov,"I have shared libraries which return shared_ptr to my main program. The main program creates weak_ptr from these shared pointers. Then the shared_ptr objects are destructed (explicitly) and the shared library is unloaded. After that, expired() calls to the weak_ptr return true, destructing the weak_ptr segfaults. I have the suspicion that this is because weak_ptr uses a part of shared_ptr (this shared_count) that is supposed to survive the shared_ptr destruction. However, unloading the library invalidates the memory region where the code of that shared_count is located, so destructing the shared_weak_count fails? Creating a minimal example is on my TODO list, but perhaps you can already tell me whether this is expected, and whether a fix is even possible without a major change to the weak/shared ptr architecture. Thanks!",Bugs,closed,To Be Determined,smart_ptr,Boost Release Branch,Problem,invalid,,