http://bugs.winehq.org/show_bug.cgi?id=33555
Bug #: 33555 Summary: Peachtree Quantum 2010 Accountant Edition post-install COM inproc server registration hangs on PEB lock (process exit) Product: Wine Version: 1.5.29 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: kernel32 AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello folks,
while investigating bug 18935 I noticed a problem in COM inproc server registration during post-install of "Peachtree Quantum 2010 Accountant Edition".
The COM inproc server in question is a mixed mode assembly (.NET 2.0).
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/Sage Software/Peachtree
$ file PAWLegacy.dll PAWLegacy.dll: PE32 executable (DLL) (GUI) Intel 80386 Mono/.Net assembly, for MS Windows
$ wine regsvr32 "C:\PROG~FBU\SAGE~XMD\PEAC~IU0\PAWLegacy.dll" ... 000a:Starting process L"C:\windows\system32\regsvr32.exe" (entryproc=0x7effcfd4) ... 000a:Call KERNEL32.LoadLibraryExA(0011515d "C:\PROG~FBU\SAGE~XMD\PEAC~IU0\PAWLegacy.dll",00000000,00000008) ret=7effc7f2 ... 000a:Ret PE DLL (proc=0x109ed6aa,module=0x10000000 L"PAWLegacy.dll",reason=PROCESS_ATTACH,res=(nil)) retval=1 000a:Ret KERNEL32.LoadLibraryExA() retval=10000000 ret=7effc7f2 000a:Call KERNEL32.GetProcAddress(10000000,7effd24e "DllRegisterServer") ret=7effc844 000a:Ret KERNEL32.GetProcAddress() retval=00e04f39 ret=7effc844 000a:CALL PAWLegacy.DllRegisterServer(<unknown, check return>) ret=7effc8e1 ... Successfully registered DLL C:\PROG~FBU\SAGE~XMD\PEAC~IU0\PAWLegacy.dll 000a:Call KERNEL32.FreeLibrary(10000000) ret=7effc945 000a:Ret KERNEL32.FreeLibrary() retval=00000001 ret=7effc945 000a:Call ole32.OleUninitialize() ret=7effcfc3 ... 000a:Ret ole32.OleUninitialize() retval=00000000 ret=7effcfc3 000a:Call KERNEL32.ExitProcess(00000000) ret=7effd062 000a:Call PE DLL (proc=0xf60c66d0,module=0xf60c0000 L"comcat.dll",reason=PROCESS_DETACH,res=0x1) 000a:Ret PE DLL (proc=0xf60c66d0,module=0xf60c0000 L"comcat.dll",reason=PROCESS_DETACH,res=0x1) retval=1 000a:Call PE DLL (proc=0x7907e547,module=0x79060000 L"mscorjit.dll",reason=PROCESS_DETACH,res=0x1) ... 000a:Ret PE DLL (proc=0x6f11db,module=0x6d0000 L"pscore3.dll",reason=PROCESS_DETACH,res=0x1) retval=1 000a:Call PE DLL (proc=0xf69ff77c,module=0xf69f0000 L"mpr.dll",reason=PROCESS_DETACH,res=0x1) 000a:Ret PE DLL (proc=0xf69ff77c,module=0xf69f0000 L"mpr.dll",reason=PROCESS_DETACH,res=0x1) retval=1 000a:Call PE DLL (proc=0x19082444,module=0x19000000 L"Pchlib32.dll",reason=PROCESS_DETACH,res=0x1) 000a:CALL mfc90.1241(190bd408,00000000) ret=19060e1c 000a:Call msvcrt.memset(786dbb50,00000000,00001800) ret=78610ded 000a:Ret msvcrt.memset() retval=786dbb50 ret=78610ded 000a:RET mfc90.1241() retval=786dbb50 ret=19060e1c 000a:Call KERNEL32.DeleteAtom(0000c000) ret=19060f51 000a:Ret KERNEL32.DeleteAtom() retval=00000000 ret=19060f51 000a:Call KERNEL32.DeleteAtom(0000c001) ret=19060f5f 000a:Ret KERNEL32.DeleteAtom() retval=00000000 ret=19060f5f 000a:Call msvcrt.free(001c38b8) ret=1903e047 000a:Call ntdll.RtlFreeHeap(00110000,00000000,001c38b8) ret=f7377f2b 000a:Ret ntdll.RtlFreeHeap() retval=00000001 ret=f7377f2b 000a:Ret msvcrt.free() retval=00000001 ret=1903e047 000a:Call ole32.CoUninitialize() ret=19060f90 000a:Call KERNEL32.SetEvent(0000021c) ret=7ecb64f0 0026:Ret KERNEL32.WaitForMultipleObjects() retval=00000001 ret=7ecb5b8f 0026:Call KERNEL32.CloseHandle(00000220) ret=7ecb5baa 000a:Ret KERNEL32.SetEvent() retval=00000001 ret=7ecb64f0 000a:Call KERNEL32.WaitForSingleObject(00000224,ffffffff) ret=7ecb6509 0026:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ecb5baa 0026:Call KERNEL32.CloseHandle(00000234) ret=7ecb61b0 0026:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ecb61b0 001a:Ret KERNEL32.WaitForSingleObjectEx() retval=00000102 ret=79e77fd1 001a:Call KERNEL32.GetLastError() ret=79e74ab4 001a:Ret KERNEL32.GetLastError() retval=00000000 ret=79e74ab4 001a:Call KERNEL32.GetLastError() ret=79e74ade 001a:Ret KERNEL32.GetLastError() retval=00000000 ret=79e74ade 001a:Call KERNEL32.WaitForMultipleObjects(00000002,7a381bb8,00000000,ffffffff) ret=79f8d98a 000e:err:ntdll:RtlpWaitForCriticalSection section 0x7bcd0dc0 "/home/focht/projects/wine/wine-git/dlls/ntdll/rtl.c: peb_lock" wait timed out in thread 000e, blocked by 000a, retrying (60 sec) 0026:err:ntdll:RtlpWaitForCriticalSection section 0x7bcd0dc0 "/home/focht/projects/wine/wine-git/dlls/ntdll/rtl.c: peb_lock" wait timed out in thread 0026, blocked by 000a, retrying (60 sec --- snip ---
The additional threads are .NET CLR/COM remoting helper threads.
I remembered some recent changes in that area, specifically process exit behaviour (PEB lock).
http://source.winehq.org/git/wine.git/commitdiff/77f222505cdb392f28809326710... ("kernel32: Hold PEB lock during process exit.")
Indeed, reverting that commit lets regsvr32 successfully exit.
Regards
http://bugs.winehq.org/show_bug.cgi?id=33555
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Regression SHA1| |77f222505cdb392f28809326710 | |51b345bf64078
http://bugs.winehq.org/show_bug.cgi?id=33555
--- Comment #1 from Dmitry Timoshkov dmitry@baikal.ru 2013-05-09 23:53:11 CDT --- Created attachment 44416 --> http://bugs.winehq.org/attachment.cgi?id=44416 kernel32: Terminate threads before unloading DLLs on process exit
Does the attached patch help?
http://bugs.winehq.org/show_bug.cgi?id=33555
--- Comment #2 from Anastasius Focht focht@gmx.net 2013-05-10 05:44:02 CDT --- Hello Dmitry,
--- quote --- Does the attached patch help? --- quote ---
Yep, the regsvr32 process terminates now with the additional threads gone.
--- snip --- ... Successfully registered DLL PAWLegacy.dll 002b:Call KERNEL32.FreeLibrary(10000000) ret=7effc945 002b:Ret KERNEL32.FreeLibrary() retval=00000001 ret=7effc945 002b:Call ole32.OleUninitialize() ret=7effcfc3 ... 002b:Ret ole32.OleUninitialize() retval=00000000 ret=7effcfc3 002b:Call KERNEL32.ExitProcess(00000000) ret=7effd062 002b:Call PE DLL (proc=0x7907e547,module=0x79060000 L"mscorjit.dll",reason=PROCESS_DETACH,res=0x1) ... 002b:Call PE DLL (proc=0x19082444,module=0x19000000 L"Pchlib32.dll",reason=PROCESS_DETACH,res=0x1) ... 002b:Call ole32.CoUninitialize() ret=19060f90 002b:Call KERNEL32.SetEvent(0000021c) ret=7ecb54f0 002b:Ret KERNEL32.SetEvent() retval=00000001 ret=7ecb54f0 002b:Call KERNEL32.WaitForSingleObject(00000224,ffffffff) ret=7ecb5509 002b:Ret KERNEL32.WaitForSingleObject() retval=00000000 ret=7ecb5509 002b:Call KERNEL32.CloseHandle(0000021c) ret=7ecb5536 002b:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ecb5536 002b:Call KERNEL32.CloseHandle(00000224) ret=7ecb5547 002b:Ret KERNEL32.CloseHandle() retval=00000001 ret=7ecb5547 002b:Call ntdll.RtlFreeHeap(00110000,00000000,039cadc8) ret=7ecb5571 002b:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7ecb5571 002b:Call KERNEL32.RaiseException(c0020001,00000001,00000001,0032f874) ret=7a05a203 002b:trace:seh:raise_exception code=c0020001 flags=1 addr=0x7b83aabb ip=7b83aabb tid=002b 002b:trace:seh:raise_exception info[0]=8007042b 002b:trace:seh:raise_exception eax=7b826979 ebx=7b8ba000 ecx=8007042b edx=0032f778 esi=0032f86c edi=0032f7e0 002b:trace:seh:raise_exception ebp=0032f7b8 esp=0032f754 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00000287 002b:trace:seh:call_stack_handlers calling handler at 0x190824c9 code=c0020001 flags=1 002b:Call msvcrt._except_handler4_common(190b7988,19082832,0032f760,0032fb0c,0032f3f0,0032f2bc) ret=190824e9 ... 002b:Ret msvcrt._except_handler4_common() retval=00000001 ret=190824e9 002b:trace:seh:__regs_RtlUnwind handler at 0x190824c9 returned 1 002b:exception in PE entry point (proc=0x19082444,module=0x19000000,reason=PROCESS_DETACH,res=0x1) 002b:Ret PE DLL (proc=0x19082444,module=0x19000000 L"Pchlib32.dll",reason=PROCESS_DETACH,res=0x1) retval=0 ... --- snip ---
Regards
http://bugs.winehq.org/show_bug.cgi?id=33555
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru 2013-05-10 05:48:23 CDT --- Thanks, patch sent as a part of another patch sequence: http://www.winehq.org/pipermail/wine-patches/2013-May/124100.html
http://bugs.winehq.org/show_bug.cgi?id=33555
--- Comment #4 from Anastasius Focht focht@gmx.net 2013-05-10 10:11:53 CDT --- Hello Dmitri,
--- quote --- Thanks, patch sent as a part of another patch sequence: http://www.winehq.org/pipermail/wine-patches/2013-May/124100.html --- quote ---
it would be nice to have this in GIT, maybe as part of next Wine release. The patch fixes an important .NET Framework 2.0 installer bug -> bug 30162 (zombified mscorsvw compile worker), removing the need for winetricks hack (killing mscorsvw processes at the end of installer).
Regards
http://bugs.winehq.org/show_bug.cgi?id=33555
--- Comment #5 from Dmitry Timoshkov dmitry@baikal.ru 2013-05-10 10:22:22 CDT --- (In reply to comment #4)
it would be nice to have this in GIT, maybe as part of next Wine release. The patch fixes an important .NET Framework 2.0 installer bug -> bug 30162 (zombified mscorsvw compile worker), removing the need for winetricks hack (killing mscorsvw processes at the end of installer).
The patch probably won't go into next release, Alexandre wants to see whether terminating a thread that does hold a heap lock would cause a dead lock due to heap accesses from the DLL process detach handlers.
http://bugs.winehq.org/show_bug.cgi?id=33555
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |bfcdf6df8eea1230fb0e1835a80 | |9e49e5971e5d2 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #6 from Dmitry Timoshkov dmitry@baikal.ru 2013-06-18 22:56:20 CDT --- Should be fixed by bfcdf6df8eea1230fb0e1835a809e49e5971e5d2.
http://bugs.winehq.org/show_bug.cgi?id=33555
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2013-06-21 13:33:11 CDT --- Closing bugs fixed in 1.6-rc3.
https://bugs.winehq.org/show_bug.cgi?id=33555
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://archive.org/downloa | |d/Peachtree2010_201603/Peac | |htree-2010.iso Keywords| |download
--- Comment #8 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive for documentation.
https://web.archive.org/web/20160126165042/http://www.sage.com:80/us/sage-50...
https://archive.org/download/Peachtree2010_201603/Peachtree-2010.iso
$ sha1sum Peachtree-2010.iso 5461b349ce6acfbc53121f4ef7c0fb2c020f988b Peachtree-2010.iso
$ du -sh Peachtree-2010.iso 625M Peachtree-2010.iso
Regards