I have the 'libTestlib.dylib' which has Linked Dependency to CoreServices.framework
If I call dlopen(libTestlib.dylib), library is loaded successfully. Also CoreServices.framework are loaded even if I do not have any piece of code that uses this framework.
After dlclose(libTestlib), CoreServices.framework is still in the process memory (OS failed to unload it) causing our test library to also still be in the process memory.
If we remove CoreServices.framework from Linked Dependency, the issue is not reproducing anymore.
Also, if we comment std::stringstream from our code, the issue is not reproducing.
It seems there are some issues with std::stringstream and
CoreServices.framework together (maybe CFString?, maybe LLVM? ).
Could you please help on this case and provide a solution on why the CoreServices.framework (and our test library also) is still loaded in the process memory after dlclose?
I have attached both xcode projects, 'libTestlib' and 'SampleApp'. Also, the 'Reproduction' folder contains the already built targets, to reproduce the issue just run
cd "...../Reproduction"
./SampleApp
The output will show the open libraries before and after dlopen call and after dlclose call. You can see that CoreServices.framework is still there after the dlclose(libTestlib).
Many thanks in advance for your help!!
Here are the xcode projects: I cannot attach the sample projects so please advise how to attach them