Reputation: 10584
What happens if some thread is executing some code from a .so and main thread tries to dlclose it?
I am getting a segmentation fault during unloading an shared object. is that expected?
Upvotes: 0
Views: 115
Reputation: 1763
dlclose() calls munmap() for the memory segment which being executed by thread and thus being read. Any read from such a memory leads to this fault, so it is expected and proper behavior.
Upvotes: 1