http://bugs.winehq.org/show_bug.cgi?id=19157
Summary: CoGetContextToken and CoGetObjectContext need to take existing MTA into account Product: Wine Version: 1.1.24 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ole32 AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
since ole32.CoGetContextToken() is no longer a stub, debugging of managed code (.NET) with cordbg/mdbg doesn't work anymore.
Main thread (tid=0009) creates MTA:
--- snip --- ... 0009:Call ole32.CoInitializeEx(00000000,00000000) ret=79ebfba8 ... 0009:trace:ole:apartment_construct creating new apartment, model=0 0009:trace:ole:apartment_construct Created apartment on OXID 80000cafe ... 0009:Ret ole32.CoInitializeEx() retval=00000000 ret=79ebfba8 --- snip ---
Helper thread (tid=001f) explicitly demands MTA after CoGetContextToken() failure:
--- snip --- ... 001f:Call ole32.CoGetContextToken(02c1e5f4) ret=79ee2b0f ... 001f:trace:ole:CoGetContextToken (0x2c1e5f4) 001f:Ret ole32.CoGetContextToken() retval=800401f0 ret=79ee2b0f ... 001f:Call ole32.CoInitializeEx(00000000,00000000) ret=79ebfba8 ... 001f:trace:ole:apartment_get_or_create entering the multithreaded apartment 80000cafe ... 001f:trace:ole:apartment_addref 80000cafe: before = 1 ... --- snip ---
Another debugger helper/worker thread gets created (tid=0021) which *never* initializes COM explicitly - unlike the other threads:
--- snip --- ... 0009:Call KERNEL32.CreateThread(00000000,00000000,63ea71dc,00176a58,00000000,00176a68) ret=63ea5b42 0009:Ret KERNEL32.CreateThread() retval=0000018c ret=63ea5b42 0009:Call ole32.CoCreateInstance(63ea5bfc,00000000,00000001,63ea5c0c,001768e8) ret=63ea5bda 0009:trace:ole:CoCreateInstance (rclsid={e5cb7a31-7512-11d2-89ce-0080c792e5d8}, pUnkOuter=(nil), dwClsContext=00000001, riid={809c652e-7396-11d2-9771-00a0c9b4d50c}, ppv=0x1768e8) ... 0021:Call ole32.CoGetContextToken(0319d730) ret=79ee2b0f 0021:trace:ole:CoGetContextToken (0x319d730) 0021:Ret ole32.CoGetContextToken() retval=800401f0 ret=79ee2b0f ... 0021:Call ole32.CoGetObjectContext(79ee2a20,00173224) ret=79f82943 ... 0021:trace:ole:CoGetObjectContext ({00000000-0000-0000-c000-000000000046}, 0x173224) 0021:err:ole:CoGetObjectContext apartment not initialised 0021:Ret ole32.CoGetObjectContext() retval=800401f0 ret=79f82943 ... 0021:Call KERNEL32.RaiseException(e06d7363,00000001,00000003,0319d644) ret=78158dd3 0021:trace:seh:raise_exception code=e06d7363 flags=1 addr=0x7b842f46 ip=7b842f46 tid=0021 0021:trace:seh:raise_exception info[0]=19930520 0021:trace:seh:raise_exception info[1]=0319d6b8 0021:trace:seh:raise_exception info[2]=79f9acc4 0021:trace:seh:raise_exception eax=7b82ca8d ebx=7b8d1398 ecx=00000000 edx=0319d630 esi=0319d630 edi=0319d5b0 0021:trace:seh:raise_exception ebp=0319d598 esp=0319d534 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00000246 ... <managed debugging hangs here> --- snip ---
This is most likely same problem domain as bug 17902 (fixed by http://source.winehq.org/git/wine.git/?a=commit;h=bd4975acb0b682bbf2b4934d12... - "ole32: Use existing MTA in CoGetClassObject and CoCreateInstance")
Since the thread in question doesn't initialize COM at all, CoGetContextToken and CoGetObjectContext most likely need to look at existing MTA(s).
Regards
http://bugs.winehq.org/show_bug.cgi?id=19157
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |dank@kegel.com Resolution| |FIXED
--- Comment #1 from Dan Kegel dank@kegel.com 2009-07-03 11:38:08 --- Fix committed, http://www.winehq.org/pipermail/wine-cvs/2009-July/057122.html
http://bugs.winehq.org/show_bug.cgi?id=19157
--- Comment #2 from Anastasius Focht focht@gmx.net 2009-07-03 13:54:05 --- Hello,
no offence Dan, but how about leaving it to me to verify if the bug is _really_ fixed? Sure, in the end my hypothesis proved to be correct and the patch was sufficient to make the app happy.
As you know, the win32 API is a beast and there are many quirks that require a fair balance between extending the conformance test suite and close examination of app behaviour.
Verified, fixed by commit 6986d97f18730710aad132989104df5dee45c99f Thanks Hans.
Regards
http://bugs.winehq.org/show_bug.cgi?id=19157
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org 2009-07-17 12:32:11 --- Closing bugs fixed in 1.1.26.
http://bugs.winehq.org/show_bug.cgi?id=19157
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |6986d97f18730710aad13298910 | |4df5dee45c99f
--- Comment #4 from Anastasius Focht focht@gmx.net 2011-10-11 15:21:55 CDT --- Hello,
filling/correcting fields ...
Regards
https://bugs.winehq.org/show_bug.cgi?id=19157
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dotnet, download URL| |https://web.archive.org/web | |/20111026224703/http://down | |load.microsoft.com/download | |/c/4/b/c4b15d7d-6f37-4d5a-b | |9c6-8f07e7d46635/setup.exe
--- Comment #5 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive for documentation.
https://web.archive.org/web/20111026224703/http://download.microsoft.com/dow...
https://www.virustotal.com/gui/file/1d7337bfbb2c65f43c82d188688ce152af403bcb...
$ sha1sum setup.exe 4e4b1072b5e65e855358e2028403f2dc52a62ab4 setup.exe
$ du -sh setup.exe 355M setup.exe
Regards