473,320 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MDA Loader?

LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt
to run managed code inside a DllMain or image initialization function since
doing so can cause the application to hang.
I have no idea what its talking about.
it seems to be kicking this off when i do my remote registry read.

Thanks
Justin
Sep 12 '07 #1
5 3508
Justin Rich wrote:
LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not attempt
to run managed code inside a DllMain or image initialization function since
doing so can cause the application to hang.
I have no idea what its talking about.
it seems to be kicking this off when i do my remote registry read.
I don't know what you're using for the remote registry read. If you've
written code yourself that causes managed code to be executed inside the
initialization of a DLL, you may indeed want to heed the warning. There
are ways you can call .NET code that would result in a deadlock.

However, my only actual first-hand experience with this MDA has been
when using Microsoft-provided components that themselves cause the
exception. My assumption (and it is only an assumption :( ) has been
that even though in these cases some managed code is being executed in a
DLL initialization, the authors of that code have avoided (intentionally
or not) calling .NET in a way that would result in deadlock.

You can search this newsgroup (or possibly
microsoft.public.dotnet.framwework...I'm not actually sure which) for
"loaderlock" and find previous messages, including my own, regarding the
topic. The short answer though is that you should try to avoid
executing managed code in a DLL initialization, but if you're not doing
so explicitly yourself you may simply be stuck hoping that the component
you're using and which does do so is doing so safely.

If you can come up with a concise-but-complete example of code that
reproduces the exception, then at least someone might be able to offer
insight as to what component is causing the exception and whether you
can avoid it in any practical way.

Finally, note that the MDA exceptions are part of the debugger. You
should be able to run the application without the debugger without
getting the exceptions. If the MDA is warning of a real problem, that
problem still exists, but otherwise you can safely deploy code that
generates MDA exceptions without worrying about them being set off when
the end user is using the code.

Pete
Sep 12 '07 #2
Thanks for the info.
Based on what you have told me it sounds like i have just rely on microsoft
for this one because im not doing anything too crazy. also i only get that
exception every once in a while, its not consistant.. but im using basic
..net stuff in a pretty standard way.

I'll just assume its ok :)

Thanks for the info

Justin

"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:13*************@corp.supernews.com...
Justin Rich wrote:
>LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock. Do not
attempt to run managed code inside a DllMain or image initialization
function since doing so can cause the application to hang.
I have no idea what its talking about.
it seems to be kicking this off when i do my remote registry read.

I don't know what you're using for the remote registry read. If you've
written code yourself that causes managed code to be executed inside the
initialization of a DLL, you may indeed want to heed the warning. There
are ways you can call .NET code that would result in a deadlock.

However, my only actual first-hand experience with this MDA has been when
using Microsoft-provided components that themselves cause the exception.
My assumption (and it is only an assumption :( ) has been that even though
in these cases some managed code is being executed in a DLL
initialization, the authors of that code have avoided (intentionally or
not) calling .NET in a way that would result in deadlock.

You can search this newsgroup (or possibly
microsoft.public.dotnet.framwework...I'm not actually sure which) for
"loaderlock" and find previous messages, including my own, regarding the
topic. The short answer though is that you should try to avoid executing
managed code in a DLL initialization, but if you're not doing so
explicitly yourself you may simply be stuck hoping that the component
you're using and which does do so is doing so safely.

If you can come up with a concise-but-complete example of code that
reproduces the exception, then at least someone might be able to offer
insight as to what component is causing the exception and whether you can
avoid it in any practical way.

Finally, note that the MDA exceptions are part of the debugger. You
should be able to run the application without the debugger without getting
the exceptions. If the MDA is warning of a real problem, that problem
still exists, but otherwise you can safely deploy code that generates MDA
exceptions without worrying about them being set off when the end user is
using the code.

Pete

Sep 12 '07 #3
Justin Rich wrote:
Thanks for the info.
Based on what you have told me it sounds like i have just rely on microsoft
for this one because im not doing anything too crazy. also i only get that
exception every once in a while, its not consistant.. but im using basic
..net stuff in a pretty standard way.
For what it's worth, if you are just using "basic .NET stuff", I don't
think you should ever get that exception.

You should at least explore what in your code is causing it to happen.
It's one thing to know what's going on and accept it, but IMHO it's
quite another to not really know what in your code is causing the
exception and why. The latter is considerable more dangerous, I think,
but it sounds like that's what you're planning to do.

Pete
Sep 12 '07 #4
Id love to figure out what is doing it but everytime it tosses the exception
its at a different line.
There are only two things im doing that are sort of out of the norm.

Powershell, which is a RunspaceInvoke, and is pretty much the only way to do
it.
---------------
using (RunspaceInvoke rs = new RunspaceInvoke())
{
Collection<PSObjectresults = rs.Invoke(PScommand);
if (results.Count 0 && results[0] != null)
txthost.Text = results[0].BaseObject.ToString();
}
--------------
and then the remote registry, whiched based on my reading isnt anything too
special.
---------
RegistryKey rkey;
rkey = RegistryKey.OpenRemoteBaseKey(hive, computer).OpenSubKey(path);
if (rkey != null)
thereturn = rkey.GetValue(key).ToString();
else
{
thereturn = "value not found!";
}
--------------

"Peter Duniho" <Np*********@NnOwSlPiAnMk.comwrote in message
news:13************@corp.supernews.com...
Justin Rich wrote:
>Thanks for the info.
Based on what you have told me it sounds like i have just rely on
microsoft for this one because im not doing anything too crazy. also i
only get that exception every once in a while, its not consistant.. but
im using basic ..net stuff in a pretty standard way.

For what it's worth, if you are just using "basic .NET stuff", I don't
think you should ever get that exception.

You should at least explore what in your code is causing it to happen.
It's one thing to know what's going on and accept it, but IMHO it's quite
another to not really know what in your code is causing the exception and
why. The latter is considerable more dangerous, I think, but it sounds
like that's what you're planning to do.

Pete

Sep 13 '07 #5
Justin Rich wrote:
Id love to figure out what is doing it but everytime it tosses the exception
its at a different line.
Did you check every thread in the process? It may be that there's one
thread that is consistently at the same spot each time the exception occurs.
There are only two things im doing that are sort of out of the norm.

Powershell, which is a RunspaceInvoke, and is pretty much the only way to do
it.
Not that I know anything specific about it, but I suspect it's
PowerShell causing the issue. The only reason I say that is that it's
the one thing you've mentioned that involves any sort of non-managed
code. That is, while as near as I can tell PowerShell itself offers a
managed interface, it still has a strong tie to unmanaged code.

Hopefully it falls into that class of "things Microsoft publishes which
set off the LoaderLock MDA, but which don't actually have a problem". :)

If in the future you find your application hanging though, this would be
the first thing I'd revist. :)

Pete
Sep 13 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Naresh Agarwal | last post by:
Hi I've written a Custom class loader, which reads the bytecode from a database and returns the Class object. For example, bytecode of a class "Test" is stored in the database. Through custom...
2
by: Bo Brunsgaard | last post by:
I have a problem trying to run SQL*Loader after migrating to Oracle 9. It used to run with no hicups on Oracle 8i, and I'm at my wits' end. Any help? I'm trying to run SQL*Loader from a command...
6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
0
by: stef | last post by:
Hi, I have a range partitioned (one partition = one month) table. On this table I have a local unique index and a local domain index (Oracle Text) on a CLOB column. I'm running Oracle...
1
by: Roy Chastain | last post by:
I have read and re-read KB 814472. There appears to be a little 1984 New Speak in it. I am referring to option 3. DLL that contains consumers that use managed code and dll exports or managed...
3
by: noleander | last post by:
Im getting a runtime error because Ive got a static object that is not properly initialized. ---------- header file xxx.hpp --------------- class SomeClass { SomeClass() { .. constructor here...
6
by: Wilfried Mestdagh | last post by:
Hi, I'm trying out the demo version of FastReports. All is running fine in a small test project. I just copy my code from test project into a large application to demonstrate tomorrow but have...
0
by: gaikwadrachit | last post by:
Hi We are uploading a picture image(jpg) as a BLOB in a table using SQL Loader. We are parallely uploading the images at the same time from 2 different sessions on the server. The command for...
1
by: annappa | last post by:
hi friends, I have some doubt regarding loader, last stage in compilation is loader. After compilation we agail load the program, then what loader do in...
5
by: vshalpatel | last post by:
Hi I want to use SQL*Loader , an Oracle-supplied utility to load data from a flat file into one database tables. for this I have write the scripts in the SQL*LOADER control file named ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.