Visual Studio 2005, iTunes 7.*.* and LoaderLock Error [modified]
-
Recently I had iTunes open at work, listening to music as I was working, when I launched the application I was working on I got a "LoaderLock" error the first time I tried to hit any key in the application. Once I clicked OK like 9 times the application ran as normal and operated this way until I ended the session, changed/wrote some code, then launched again. This was baffling to say the least, a couple of us did massive Googling on the issue and found very little that could even remotely be causing the problem I was experiencing, and no one else working on the same application was experiencing this, and a simple reboot seemed to solve the problem (keep in mind after the reboot I had a habit of not re-starting application I had running, ie iTunes). After several days of this frustrating error I realized that the only time this occurred was when I had iTunes running at the same time as Visual Studio 2005, so I did some Googling on that assumtion and ran across many other developers having the same issue[^]. Part of the way through this thread is a posting from Liz - MSFT with this response:
Hello all,
We are sorry that you are experiencing problems when running iTunes 7.1 and VS 2005. Here is the results of our research:
We noticed that iTunesKeyboardCompatibility.dll is causing the LoaderLock MDA to fire. The most likely reason is that the
DLL entry point for this DLL is doing some non-trivial work which causes managed code to run. There are serious limits on
what a DLL can do in the DLL entry point (i.e. DllMain()). For more information, you can refer to http://msdn2.microsoft.com/en-us/library/ms682583.aspx[^].This will need to be resolved by iTunes.
Regards,
Liz
Since "Liz" states this has to be fixed on iTunes end the only workaround we have found is to uninstall iTunes 7.*.* and install iTunes 6.5 (since this issue doesn't seem to exist with 6.5). This was several frustrating days until I finally found a way to resolve this issue. PS: Since that day I also found out you can turn off the MDA (Debug -> Exceptions -> Managed Debug Assistants then uncheck the LoaderLock item).
-
Recently I had iTunes open at work, listening to music as I was working, when I launched the application I was working on I got a "LoaderLock" error the first time I tried to hit any key in the application. Once I clicked OK like 9 times the application ran as normal and operated this way until I ended the session, changed/wrote some code, then launched again. This was baffling to say the least, a couple of us did massive Googling on the issue and found very little that could even remotely be causing the problem I was experiencing, and no one else working on the same application was experiencing this, and a simple reboot seemed to solve the problem (keep in mind after the reboot I had a habit of not re-starting application I had running, ie iTunes). After several days of this frustrating error I realized that the only time this occurred was when I had iTunes running at the same time as Visual Studio 2005, so I did some Googling on that assumtion and ran across many other developers having the same issue[^]. Part of the way through this thread is a posting from Liz - MSFT with this response:
Hello all,
We are sorry that you are experiencing problems when running iTunes 7.1 and VS 2005. Here is the results of our research:
We noticed that iTunesKeyboardCompatibility.dll is causing the LoaderLock MDA to fire. The most likely reason is that the
DLL entry point for this DLL is doing some non-trivial work which causes managed code to run. There are serious limits on
what a DLL can do in the DLL entry point (i.e. DllMain()). For more information, you can refer to http://msdn2.microsoft.com/en-us/library/ms682583.aspx[^].This will need to be resolved by iTunes.
Regards,
Liz
Since "Liz" states this has to be fixed on iTunes end the only workaround we have found is to uninstall iTunes 7.*.* and install iTunes 6.5 (since this issue doesn't seem to exist with 6.5). This was several frustrating days until I finally found a way to resolve this issue. PS: Since that day I also found out you can turn off the MDA (Debug -> Exceptions -> Managed Debug Assistants then uncheck the LoaderLock item).
The only safe thing to do in
DllMain
is nothing. That means not creating any static objects in a C++ DLL which have constructors, since the constructors get run when the DLL is loaded. That's not completely true - you can get away with calling some operations inkernel32.dll
, like creating a new heap, and you probably need to save yourHINSTANCE
for later - but in general, you should just ignore the fact thatDllMain
exists. Instead, require explicit initialisation and cleanup of your DLL. I'm guessing that this iTunes DLL is doing something to hook keypresses (it's probably a low-level keyboard hook) to get loaded into every process. This is lame - if you want to handle keypresses from other processes, you should callRegisterHotKey
.Stability. What an interesting concept. -- Chris Maunder
-
The only safe thing to do in
DllMain
is nothing. That means not creating any static objects in a C++ DLL which have constructors, since the constructors get run when the DLL is loaded. That's not completely true - you can get away with calling some operations inkernel32.dll
, like creating a new heap, and you probably need to save yourHINSTANCE
for later - but in general, you should just ignore the fact thatDllMain
exists. Instead, require explicit initialisation and cleanup of your DLL. I'm guessing that this iTunes DLL is doing something to hook keypresses (it's probably a low-level keyboard hook) to get loaded into every process. This is lame - if you want to handle keypresses from other processes, you should callRegisterHotKey
.Stability. What an interesting concept. -- Chris Maunder
And another for my "Why I hate iTunes list." I'll need a separate hard drive for those lists of mine soon. What with the "Data that Google has on me"...
Need Another Seven Acronyms...
Confused? You will be... -
Recently I had iTunes open at work, listening to music as I was working, when I launched the application I was working on I got a "LoaderLock" error the first time I tried to hit any key in the application. Once I clicked OK like 9 times the application ran as normal and operated this way until I ended the session, changed/wrote some code, then launched again. This was baffling to say the least, a couple of us did massive Googling on the issue and found very little that could even remotely be causing the problem I was experiencing, and no one else working on the same application was experiencing this, and a simple reboot seemed to solve the problem (keep in mind after the reboot I had a habit of not re-starting application I had running, ie iTunes). After several days of this frustrating error I realized that the only time this occurred was when I had iTunes running at the same time as Visual Studio 2005, so I did some Googling on that assumtion and ran across many other developers having the same issue[^]. Part of the way through this thread is a posting from Liz - MSFT with this response:
Hello all,
We are sorry that you are experiencing problems when running iTunes 7.1 and VS 2005. Here is the results of our research:
We noticed that iTunesKeyboardCompatibility.dll is causing the LoaderLock MDA to fire. The most likely reason is that the
DLL entry point for this DLL is doing some non-trivial work which causes managed code to run. There are serious limits on
what a DLL can do in the DLL entry point (i.e. DllMain()). For more information, you can refer to http://msdn2.microsoft.com/en-us/library/ms682583.aspx[^].This will need to be resolved by iTunes.
Regards,
Liz
Since "Liz" states this has to be fixed on iTunes end the only workaround we have found is to uninstall iTunes 7.*.* and install iTunes 6.5 (since this issue doesn't seem to exist with 6.5). This was several frustrating days until I finally found a way to resolve this issue. PS: Since that day I also found out you can turn off the MDA (Debug -> Exceptions -> Managed Debug Assistants then uncheck the LoaderLock item).
OHHHH GOD!!! I had this same error... and it took me 5 days or working without the debugger (it works find if you don't run it in the debugger). I didn't relate the two together until i searched MSDN. A faster solution over rolling back the version, is to delete the keyboardcompatability.dll file, and replace it with a folder of the same name.
-
OHHHH GOD!!! I had this same error... and it took me 5 days or working without the debugger (it works find if you don't run it in the debugger). I didn't relate the two together until i searched MSDN. A faster solution over rolling back the version, is to delete the keyboardcompatability.dll file, and replace it with a folder of the same name.
Thanks for the tip, Ill try that as well (even though I already rolled back the version). It drove me nuts for days too.
"Okay, I give up: which is NOT a real programming language????" Michael Bergman
-
Thanks for the tip, Ill try that as well (even though I already rolled back the version). It drove me nuts for days too.
"Okay, I give up: which is NOT a real programming language????" Michael Bergman
Thanks for posting. I hadn't noticed this problem yet, I don't have iTunes on my development machines anymore. Actually, I don't have it installed at all, anymore. I can't stand iTunes, or iPod for that matter. I gave my shuttle to my daughter because it annoyed me *that* much. I just want to copy .mp3 over to a USB device in Explorer. Why is that so hard for apple to do? Sometimes I wish "artistic" people would stay away from utility software development.
-
Recently I had iTunes open at work, listening to music as I was working, when I launched the application I was working on I got a "LoaderLock" error the first time I tried to hit any key in the application. Once I clicked OK like 9 times the application ran as normal and operated this way until I ended the session, changed/wrote some code, then launched again. This was baffling to say the least, a couple of us did massive Googling on the issue and found very little that could even remotely be causing the problem I was experiencing, and no one else working on the same application was experiencing this, and a simple reboot seemed to solve the problem (keep in mind after the reboot I had a habit of not re-starting application I had running, ie iTunes). After several days of this frustrating error I realized that the only time this occurred was when I had iTunes running at the same time as Visual Studio 2005, so I did some Googling on that assumtion and ran across many other developers having the same issue[^]. Part of the way through this thread is a posting from Liz - MSFT with this response:
Hello all,
We are sorry that you are experiencing problems when running iTunes 7.1 and VS 2005. Here is the results of our research:
We noticed that iTunesKeyboardCompatibility.dll is causing the LoaderLock MDA to fire. The most likely reason is that the
DLL entry point for this DLL is doing some non-trivial work which causes managed code to run. There are serious limits on
what a DLL can do in the DLL entry point (i.e. DllMain()). For more information, you can refer to http://msdn2.microsoft.com/en-us/library/ms682583.aspx[^].This will need to be resolved by iTunes.
Regards,
Liz
Since "Liz" states this has to be fixed on iTunes end the only workaround we have found is to uninstall iTunes 7.*.* and install iTunes 6.5 (since this issue doesn't seem to exist with 6.5). This was several frustrating days until I finally found a way to resolve this issue. PS: Since that day I also found out you can turn off the MDA (Debug -> Exceptions -> Managed Debug Assistants then uncheck the LoaderLock item).
Had the same problem and spent a couple of days tracking it down. I should know better ... no non-essential software on the development machine. Maybe in a VPC. As a note it seems to have an adverse affect on Ultramon as well. When I upgraded iTunes it went whacky. With iTunes out things are stable again. I'll pass on iAnything (tunes, pod, phone). Thomas
Thomas