By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

Nasty Problem

P: n/a
I have a REALLY nasty problem and could use some expert help.

I have two mixed mode apps. Each uses a mixed mode DLL that exports a couple
of classes. There is no dll main as it is not needed. This was working fine
until a couple of days ago when I added some (a lot of) new code to the dll.
The apps generally do not run at the same time. Every thing compiles and
links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK to
terminate the application.

I have to click OK twice and then get:

Unhandled exceptionat 0x7c964ed1 (ntdll.dll) in myApp.exe: 0xC0000005:
Access violation.

This occurs very earily in the app loading and I can not even hit a break
point.

I have read all the google stuff about permissions and viruses but I am sure
that is not the problem here. After exhaustive debugging, I noted that in
one of my GUI apps (the simpler one) I had some MessageBox calls that would
be called if certain error conditions occured. I was able to determine that
the presence of these calls was enough to cause the problem - so I removed
them and that application started working fine. I had already been
suspecting some sort of run time library mismatch and this seems to confirm
that. I have removed all MessageBox calls in my other app but it still crash
immediately after starting.

My first question: what libraries would MessageBox require (implicitly
linked) and what might be some other library calls that may be causing
similar problems in my other application. I am using /clr and Multi-threaded
Debug (/MTd) for the application and /clr and Multi-threaded Debug DLL
(/MDd) for the DLL. This is such a subttle problem, it must be some sort of
run time mismatch deep under the covers and the error messaages and posted
articles are missleading at best. Could this be related to the app Message
Loop?

Kindly Experts, I could use your help!


Oct 6 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

Do you have any global variables defined in your code? That would be
first thing that I will check. Otherwise just comment all new code and
start uncommenting gradually untill you will hit the problem.

Max
http://ceeplusplus.com

S Wheeler wrote:
I have a REALLY nasty problem and could use some expert help.

I have two mixed mode apps. Each uses a mixed mode DLL that exports a couple
of classes. There is no dll main as it is not needed. This was working fine
until a couple of days ago when I added some (a lot of) new code to the dll.
The apps generally do not run at the same time. Every thing compiles and
links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK to
terminate the application.

I have to click OK twice and then get:

Unhandled exceptionat 0x7c964ed1 (ntdll.dll) in myApp.exe: 0xC0000005:
Access violation.

This occurs very earily in the app loading and I can not even hit a break
point.

I have read all the google stuff about permissions and viruses but I am sure
that is not the problem here. After exhaustive debugging, I noted that in
one of my GUI apps (the simpler one) I had some MessageBox calls that would
be called if certain error conditions occured. I was able to determine that
the presence of these calls was enough to cause the problem - so I removed
them and that application started working fine. I had already been
suspecting some sort of run time library mismatch and this seems to confirm
that. I have removed all MessageBox calls in my other app but it still crash
immediately after starting.

My first question: what libraries would MessageBox require (implicitly
linked) and what might be some other library calls that may be causing
similar problems in my other application. I am using /clr and Multi-threaded
Debug (/MTd) for the application and /clr and Multi-threaded Debug DLL
(/MDd) for the DLL. This is such a subttle problem, it must be some sort of
run time mismatch deep under the covers and the error messaages and posted
articles are missleading at best. Could this be related to the app Message
Loop?

Kindly Experts, I could use your help!
Oct 6 '06 #2

P: n/a
No globals are defined; there are 2 static mdthods, but other than that no
static variables either. Commenting new code is not simple beause the change
represents the merging of 2 libraries and there are dependancies through out
the main application which is some 50K+ lines of code. Any other thoughts?

"Maksim Libenson" <Ma*************@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi,

Do you have any global variables defined in your code? That would be
first thing that I will check. Otherwise just comment all new code and
start uncommenting gradually untill you will hit the problem.

Max
http://ceeplusplus.com

S Wheeler wrote:
>I have a REALLY nasty problem and could use some expert help.

I have two mixed mode apps. Each uses a mixed mode DLL that exports a
couple
of classes. There is no dll main as it is not needed. This was working
fine
until a couple of days ago when I added some (a lot of) new code to the
dll.
The apps generally do not run at the same time. Every thing compiles and
links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK
to
terminate the application.

I have to click OK twice and then get:

Unhandled exceptionat 0x7c964ed1 (ntdll.dll) in myApp.exe: 0xC0000005:
Access violation.

This occurs very earily in the app loading and I can not even hit a break
point.

I have read all the google stuff about permissions and viruses but I am
sure
that is not the problem here. After exhaustive debugging, I noted that in
one of my GUI apps (the simpler one) I had some MessageBox calls that
would
be called if certain error conditions occured. I was able to determine
that
the presence of these calls was enough to cause the problem - so I
removed
them and that application started working fine. I had already been
suspecting some sort of run time library mismatch and this seems to
confirm
that. I have removed all MessageBox calls in my other app but it still
crash
immediately after starting.

My first question: what libraries would MessageBox require (implicitly
linked) and what might be some other library calls that may be causing
similar problems in my other application. I am using /clr and
Multi-threaded
Debug (/MTd) for the application and /clr and Multi-threaded Debug DLL
(/MDd) for the DLL. This is such a subttle problem, it must be some sort
of
run time mismatch deep under the covers and the error messaages and
posted
articles are missleading at best. Could this be related to the app
Message
Loop?

Kindly Experts, I could use your help!

Oct 6 '06 #3

P: n/a
>I have a REALLY nasty problem and could use some expert help.
>
I have two mixed mode apps. Each uses a mixed mode DLL that exports a
couple of classes. There is no dll main as it is not needed. This was
working fine until a couple of days ago when I added some (a lot of) new
code to the dll. The apps generally do not run at the same time. Every
thing compiles and links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK to
terminate the application.
What do you see in the debugger output window?
Did you try to set "Break On Exception" (every type)?

--
Vladimir Nesterovsky
Oct 6 '06 #4

P: n/a

Vladimir -
Here is my debug widow output:

'PTS6000.exe': Loaded
'E:\Development\Peforce\thunderbolt\software\main\ utilities\PTS6000\GUI\Debug\PTS6000.exe',
Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\mscoree.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Exports loaded.
'PTS6000.exe': Loaded
'E:\Development\Peforce\thunderbolt\software\main\ utilities\PTS6000\GUI\Debug\Updates.dll',
Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\msvcp71d.dll', Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\msvcr71d.dll', Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\W32N50.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\winspool.drv', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msco rwks.dll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msvc r71.dll', Symbols loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusi on.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll',
Exports loaded.
First-chance exception at 0x77d48fc0 (user32.dll) in PTS6000.exe:
0xC0000005: Access violation reading location 0x00000002.
'PTS6000.exe': Unloaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll'
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Exports loaded.
First-chance exception at 0x7c90eae0 (ntdll.dll) in PTS6000.exe: 0xC0000005:
Access violation reading location 0x00000130.
'PTS6000.exe': Unloaded 'C:\WINDOWS\system32\comctl32.dll'
'PTS6000.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Symbols loaded.
First-chance exception at 0x77d49f29 (user32.dll) in PTS6000.exe:
0xC0000005: Access violation reading location 0x00000002.
'PTS6000.exe': Unloaded 'C:\WINDOWS\system32\comctl32.dll'
'PTS6000.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msco rlib.dll', No symbols
loaded.
First-chance exception at 0x00000000 in PTS6000.exe: 0xC0000005: Access
violation reading location 0x00000000.
First-chance exception at 0x791b7e5f (mscorwks.dll) in PTS6000.exe:
0xC0000005: Access violation reading location 0x000001b2.
The thread 'Win32 Thread' (0x8dc) has exited with code -2146233082
(0x80131506).
First-chance exception at 0x77d48ade (user32.dll) in PTS6000.exe:
0xC0000005: Access violation reading location 0x00000008.
First-chance exception at 0x7c964ed1 (ntdll.dll) in PTS6000.exe: 0xC0000005:
Access violation.
Unhandled exception at 0x7c964ed1 (ntdll.dll) in PTS6000.exe: 0xC0000005:
Access violation.
The program '[2868] PTS6000.exe: Native' has exited with code 0 (0x0).
"Vladimir Nesterovsky" <vl******@nesterovsky-bros.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I have a REALLY nasty problem and could use some expert help.

I have two mixed mode apps. Each uses a mixed mode DLL that exports a
couple of classes. There is no dll main as it is not needed. This was
working fine until a couple of days ago when I added some (a lot of) new
code to the dll. The apps generally do not run at the same time. Every
thing compiles and links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK
to terminate the application.

What do you see in the debugger output window?
Did you try to set "Break On Exception" (every type)?

--
Vladimir Nesterovsky

Oct 6 '06 #5

P: n/a
I have two mixed mode apps. Each uses a mixed mode DLL that exports a couple
of classes. There is no dll main as it is not needed. This was working fine
until a couple of days ago when I added some (a lot of) new code to the dll.
The apps generally do not run at the same time. Every thing compiles and
links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK to
terminate the application.

I have to click OK twice and then get:

Unhandled exceptionat 0x7c964ed1 (ntdll.dll) in myApp.exe: 0xC0000005:
Access violation.
Do you initialize CRT in the mixed DLLs? (as described in KB below)
http://support.microsoft.com/?id=814472

Also, try to compile the application with /MDd and see if the problem
still occurs after that.

If none of this helps, enable breaking into debugger on first chance exceptions
as Vladimir said (Debug | Exceptions | Win32 Exceptions | at least C0000005,
check "When exception is thrown - break into debugger"), run the application under
debugger, and check call stacks for all exceptions. You can post the call stacks here.

You might need to configure symbol server to see good call stacks:
http://msdn.microsoft.com/library/en...mbolServer.asp

--
Oleg
[VC++ MVP http://www.debuginfo.com/]


Oct 9 '06 #6

P: n/a
Hi I got the The application failed to initialize properly - 0xc0000005
message several times whenn using applications that used to work fine
on my computer. It especially messed with spybot and Ad-aware. AVG
didn't see the problem (which worked in regular mode), niether did
Ad-aware (which worked in safe mode). nor Spybot (in safe mode).
Finally I was tipped off
(http://forums.microsoft.com/MSDN/Sho...07630&SiteID=1)
to use Panda Activescan. It found the trojan, or virus or whatever it
was and now all my applications are working. I just though I should
write this in case it helps somebody out there.

Raphael

Oleg Starodumov ha escrito:
I have two mixed mode apps. Each uses a mixed mode DLL that exports a couple
of classes. There is no dll main as it is not needed. This was working fine
until a couple of days ago when I added some (a lot of) new code to the dll.
The apps generally do not run at the same time. Every thing compiles and
links OK. But at run time I now immediately get :

The application failed to initialize properly (0xc0000005). Click on OK to
terminate the application.

I have to click OK twice and then get:

Unhandled exceptionat 0x7c964ed1 (ntdll.dll) in myApp.exe: 0xC0000005:
Access violation.

Do you initialize CRT in the mixed DLLs? (as described in KB below)
http://support.microsoft.com/?id=814472

Also, try to compile the application with /MDd and see if the problem
still occurs after that.

If none of this helps, enable breaking into debugger on first chance exceptions
as Vladimir said (Debug | Exceptions | Win32 Exceptions | at least C0000005,
check "When exception is thrown - break into debugger"), run the application under
debugger, and check call stacks for all exceptions. You can post the call stacks here.

You might need to configure symbol server to see good call stacks:
http://msdn.microsoft.com/library/en...mbolServer.asp

--
Oleg
[VC++ MVP http://www.debuginfo.com/]
Nov 2 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.