DBGENG is thread safe as conceptually itself will serialize all calls (using own global critical section). You could call DBGENG APIs from multiple threads as this is how WINDBG does.
As earlier post suggested, you could try call DebugCreate() then QI for different IDebugxxx interfaces from every thread.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@resplendence.com
Sent: Tuesday, September 25, 2012 09:41 AM
To: Kernel Debugging Interest List
Subject: Re:[windbg] Re:is DbgEng actually thread-safe ?
There is a separate local different object pointer (and everything) for each thread. I was assuming the threading model was inherited from COM call through the CoInitialieEx calls and the parameter passed to it.
But Joe says it’s NOT thread-safe. Or should I be sharing one of the interface pointers between the threads to make it work ?
//Daniel
“Jen-Lung Chiu” wrote in message news:xxxxx@windbg…
DBGENG API IS THREAD SAFE.
One question, how did you share the IDebugControl “interface” pointer among the threads?
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@resplendence.com
Sent: Tuesday, September 25, 2012 09:28 AM
To: Kernel Debugging Interest List
Subject: Re:[windbg] is DbgEng actually thread-safe ?
Thanks for your answer. As it shows, even serialzing the jobs will not help avoiding the problems. As it appears to me, there can be only one thread in a process that makes calls to the engine. Multiple threads are not supported, even if only one of them does a DBGENG job at a time.
Another question, is DBGENG using any global or kernel resources that would make it not thread-safe even between different processes ? Because every process instance gets a fresh copy of DBGENG.DLL, can I spawn as many processes as I desire and still achieve multithreading through multiple processes ?
//Daniel
“Joe Ballantyne” wrote in message news:xxxxx@windbg…
No, DbgEng is NOT thread safe.
You will need to synchronize yourself before calling into it.
Joe.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@resplendence.com
Sent: Tuesday, September 25, 2012 1:15 AM
To: Kernel Debugging Interest List
Subject: [windbg] is DbgEng actually thread-safe ?
When I call my dump analysis code from multiple threads, any call to the debug engine can fail with E_UNEXPECTED Catastrophic failure. For instance:
:
IDebugControl::GetNumberProcessors
IDebugControl::GetPageSize
IDebugControl::GetStackTrace
If all calls are made from the same thread, there is never an error returned.
I have made sure all there are no resources shared between the threads whatsoever and that all my own code is thread safe. If I serialize the entire routine that uses DbgEng with a critical section, so no multiple threads are using the engine at the same time, the problem remains.
Is there some magic switch somewhere to put the engine into thread-safe mode ? Or is it not supported ? If it is not supported, can I safely assume that I can at least start one thread that uses dbgeng per process ?
//Daniel
—
WINDBG is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
—
WINDBG is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
WINDBG is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer