https://bugs.winehq.org/show_bug.cgi?id=41703
Bug ID: 41703 Summary: LdrUnloadDll is not suit for musl(musl lacks unload support though it has a dlclose()) Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: ntdll Assignee: wine-bugs@winehq.org Reporter: xw897002528@gmail.com Distribution: ---
Created attachment 56111 --> https://bugs.winehq.org/attachment.cgi?id=56111 fix for this problem
Hey, sorry for my poor english, and here is the problem:
First, musl won't unload module even dlclose(). Check here: http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Unloading_l...
Then, musl won't excute init(__wine_spec_init) function if a module is already loaded.
That means load_builtin_dll() thought dll is loaded by the current thread since init function was not called, but actually LdrUnloadDll() destroyed them in another thread and nothing is loaded in the current thread. Load_builtin_dll() try to find wm in InLoadOrderModuleList but nothing. After that, app will crash.
And I solved this by making LdrUnloadDll() a stub. Patch is uploaded as a attachment. I hope this could be added in official wine by adding a configure option, thx.
Here's my tracking details on this problem if you're intereted in how i found this: https://github.com/xhebox/noname-linux/issues/2#issuecomment-258680745