473,657 Members | 2,490 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 8202
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.comwrot e in message
news:11******** **************@ i42g2000cwa.goo glegroups.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\thunde rbolt\software\ main\utilities\ PTS6000\GUI\Deb ug\PTS6000.exe' ,
Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\ntdll.dll ', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\mscoree.d ll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\kernel32. dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\advapi32. dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\rpcrt4.dl l', Exports loaded.
'PTS6000.exe': Loaded
'E:\Development \Peforce\thunde rbolt\software\ main\utilities\ PTS6000\GUI\Deb ug\Updates.dll' ,
Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\msvcp71d. dll', Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\msvcr71d. dll', Symbols loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\W32N50.dl l', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\user32.dl l', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\gdi32.dll ', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\winspool. drv', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\msvcrt.dl l', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\shlwapi.d ll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \mscorwks.dll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \msvcr71.dll', Symbols loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \fusion.dll', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\ole32.dll ', Exports loaded.
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\shell32.d ll', Exports loaded.
'PTS6000.exe': Loaded
'C:\WINDOWS\Win SxS\x86_Microso ft.Windows.Comm on-Controls_6595b6 4144ccf1df_6.0. 2600.2180_x-ww_a84f1ff9\com ctl32.dll',
Exports loaded.
First-chance exception at 0x77d48fc0 (user32.dll) in PTS6000.exe:
0xC0000005: Access violation reading location 0x00000002.
'PTS6000.exe': Unloaded
'C:\WINDOWS\Win SxS\x86_Microso ft.Windows.Comm on-Controls_6595b6 4144ccf1df_6.0. 2600.2180_x-ww_a84f1ff9\com ctl32.dll'
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\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\sys tem32\comctl32. dll'
'PTS6000.exe': Loaded 'C:\WINDOWS\sys tem32\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\sys tem32\comctl32. dll'
'PTS6000.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \mscorlib.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******@neste rovsky-bros.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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
2927
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 flexible and solid wrapper and am deep into coding. The only problem is a noticed VARCHAR fields being drawn from SQL Server 2000 are being truncated to 255 characters. I searched around php.net and found the following : Note to Win32 Users: Due...
0
1765
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 child div lines up with the bottom of the parent div in Win IE6 and in Win NS6. However, Mac IE5 has a nasty bug -- it lines up the bottom of the child div with the *top of the body* -- I kid you
8
12275
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 Invalidate(Rectangle)) flickers in a nasty way when repainting. This does not happen in the Solitare (PC + WinCe) Versions a well as in a Card game where I have the C++ Source. The use of an empty OnPaintBackground brings no visable results.
19
1805
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
3840
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 is "Cy-sr-SP" but if you try this, you will get "Culture name Cy-sr-SP is not supported" exception. If you set up culture info via System.Globalization.CultureInfo(0x081A) and than retrieve
1
4874
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. my code is something like this ... Public Function DbconnStr(ByVal UID As String, ByVal Pwd As String, _ ByVal ServerName As String,
4
1234
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 is very unresponsive. What happens? Well, the site just becomes unresponsive after some time. It hangs, without giving an error whatsoever, not to the user, no errors in the Event Viewer either. The processor isn't going sky-high, no excessive...
5
1269
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 controls, all of which are bound to SqlDataSource controls: two dropdowns and a repeater. However, the contents of the second dropdown depend upon the selection made in the first dropdown, and the contents of the repeater depend upon the...
4
10100
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 both browsers. In one situation and frame I have a long scrollable list of cars offered for sale. Some list lines are linked to a separate page with images, to be loaded into the same frame as the listing. On closing this image page with <a...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
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 we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.