473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nasty Problem

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
6 8194
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
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
>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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2911
by: James | last post by:
I am currently working on a PHP based website that needs to be able to draw from Oracle, MS SQL Server, MySQL and given time and demand other RDBMS. I took a lot of time and care creating a...
0
1761
by: Jonas Smithson | last post by:
<div style="position: relative;> <!-- I'm the parent --> blah blah blah <div style="position: absolute; bottom: 0;> <!-- I'm the child --> blah blah blah </div> </div> The bottom of the...
8
12252
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or...
19
1789
by: Jerry | last post by:
I managed to narrow this down to a very simple expression. try this: private void Bug() { bool b = false; Test(3, (b || b) && b && !b); } private void Works() {
1
3833
by: Dejan Vesic | last post by:
I found nasty "documentation" bug; ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemglobalizationcultureinfoclasstopic.htm claims that proper culture info name for Serbian (Cyrillic) - Serbia...
1
4868
by: james | last post by:
I am creating an connection string at runtime using decryption (crypto libraries). i have a very unpridictable error while assinging the generated connection string to the connection property. ...
4
1227
by: Koen Hoorelbeke | last post by:
Hi there, I'm about to commit suicide :) Since a couple of weeks I have a persistent problem with the performance of my sites (well, actually it's one particular site). For some reason the site...
5
1259
by: Mark Olbert | last post by:
I just spent several frustrating hours tracking down a subtle problem involving a simple web page. I'm sharing the solution so as to spare others a similar experience. The web page has only three...
4
10089
by: Heinrich Wolf | last post by:
Hi all I have a history.back() problem with FF(2). IE works as expected, while FF does not. The multi frame website setup as a whole with a lot of frame content switching works flawlessly in...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1501
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.