Any libc++ experts here?
I've recently run into a bug on code developed mainly on Linux in which delete'ing a class instance provided by a shared library leads to a SEGV after that library has been unloaded.
The most parsimonious explanation would be that this happens because the class dtor address has gone stale - but then it should happen on Linux too. So unless the shared library isn't actually unloaded on Linux (which I cannot verify easily), I must be looking at another explanation.
That explanation might be that libc++ somehow tracks all instances "new'ed" by a given shared library and deletes them when that library is unloaded, turning all registered copies into stale pointers.
Is that possible? It's certainly something that would make sense in light of the disappearing dtor thing but it would also introduce an incitation to bad programming practices (no?).
I've recently run into a bug on code developed mainly on Linux in which delete'ing a class instance provided by a shared library leads to a SEGV after that library has been unloaded.
The most parsimonious explanation would be that this happens because the class dtor address has gone stale - but then it should happen on Linux too. So unless the shared library isn't actually unloaded on Linux (which I cannot verify easily), I must be looking at another explanation.
That explanation might be that libc++ somehow tracks all instances "new'ed" by a given shared library and deletes them when that library is unloaded, turning all registered copies into stale pointers.
Is that possible? It's certainly something that would make sense in light of the disappearing dtor thing but it would also introduce an incitation to bad programming practices (no?).