RE: Problem with MFC extension DLL, threads, and .Net loader lock



Hi Norman,

Based on my understanding, the problem is your application implicitly links
to a MFC extension DLL(XMap), and use that DLL's function in a worker
thread. When that worker thread exits, yo receive an error message about
the OS Load Locker issue which invoked from another mixed DLL
(RegexWrapD.dll). Please correct me if I misunderstood anything.

Before we dig into this problem, would you please tell us whether this
problem occurs outside the VS2005 debugger? If your application could work
well without VS2005' s debugger, then this problem may occur because of the
way in which the debugger in Visual Studio 2005 runs managed applications
that use Microsoft Foundation Classes version 8.0 in one or more DLL files.
We have an MSDN KB article which targets on this issue:

FIX: Error message when you use the debugger in Visual Studio 2005 to debug
an MFC class library application: "Managed Debugging Assistant 'LoaderLock'
has detected a problem in '<filename.exe>'"
http://support.microsoft.com/default.aspx/kb/913996

If the above KB article cannot resolve your problem, we may need more info
to isolate the issue:

1. How about that mixed DLL, how do you use it in your application? It
seems that worker thread also load that DLL.

2. Each thread's call stack info while the application breaks on that
error. You can get a specific thread's call stack by select the target
thread ID in the Debug | Windows | Threads window, then invoke its
corresponding Call Stack window.

Before doing this, you may need to setup the debugging symbols for your
VS2005. For example to set the Symbol Server path you need to input
"srv*c:\LocalSymbols*http://msdl.microsoft.com/download/symbols;"; in the
Tools | Options | Debugging | Symbols as the directory. This will tell the
VS2005 debugger to lookup symbol from the Microsoft symbol server
"http://msdl.microsoft.com/download/symbols"; and cache the downloaded
symbol in "c:\LocalSymbols" folder.

By the way, there would be many reasons to cause the loader locker problem
in the case of the mixed DLL, I suggest you refer to the following MSDN
articles for the details:

Converting Managed Extensions for C++ Projects from Pure Intermediate
Language to Mixed Mode
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmex/html/
vcconconvertingmanagedextensionsforcprojectsfrompureintermediatelanguagetomi
xedmode.asp

Mixed DLL Loading Problem
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechar
t/html/vcconMixedDLLLoadingProblem.asp


Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Hang when new DirectoryEntry declared
    ... the VS.net2003 debugger is trying to ... Microsoft symbol server for the VS.net2003, ... the Output window in the VS.net2003 IDE after you pressed F5. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • Re: Hang when new DirectoryEntry declared
    ... the VS.net2003 debugger is trying to ... Microsoft symbol server for the VS.net2003, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • RE: Releasing Unmanaged Object when closing debugger
    ... If a process is terminated by TerminateProcess, ... When you press Shift+F5 in debugger, the debugger does the similar thing as ... Microsoft Online Community Support ...
    (microsoft.public.vsnet.debugging)
  • Microsoft Security Bulletin MS02-024
    ... Authentication Flaw in Windows Debugger can Lead to ... Software: Microsoft Windows ... A successful attack requires the ability to logon interactively to the ... systems and terminal servers. ...
    (microsoft.public.security)
  • Re: AppleWin Debugger & AppleWin Ports
    ... Hey Blurry ... current debugger would be all that user-friendly on a zarus. ... I agree -- mousewheel support needs to be in. ... macros (maybe with assignable hotkeys like you have with space bar for ...
    (comp.emulators.apple2)

Loading