Click here to Skip to main content
15,887,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a win32 console app create din VS 2003 .net.

If I compile and run in debug, it crashes after a couple of seconds with an exception coming from ntdll.dll. It does not give any helpful info, everything in the callstack points to ntdll.dll. It didn't always do this, it seemed to be an intermittent problem for a while which I hoped would go away. But it didn't, and now it seems here to stay!

This does not happen when I compile in release and run it.

So I cannot debug my code at the moment.

I was thinking of just starting a new project and copying all my files in and seeing if it happens again, but does anyone know what may be causing this?
Posted
Comments
Richard MacCutchan 16-Jul-12 7:31am    
There could be lots of reasons, but it is fairly certain that there is a potential bug in your code. You need to narrow down the problem to the last call out of your code into NTDLL and try to figure out what you may have done wrong. Check all the information provided by the debugger.
Jochen Arndt 16-Jul-12 7:59am    
Common errors that can cause such problems are buffer overruns. The exception is thrown when some debug code detects the damaged memory (often when heap memory is released inside destructors). When I have such errors, I will check all pointers and array indices of the classes involved prior to the exception (especially the code that has just been added or changed).
Jackie Lloyd 16-Jul-12 9:19am    
Thankyou, I will try all your suggestions. However, what is weird that if I revert to a version of my code from a couple of months ago when I am sure (as i can be) that I didn't have the problem, it now has the problem. And the call stack info is:

=> cccccccc()ntdll.dll! 0x7c903218()ntdll.dll! 0x7c90327a()

ntdll.dll! 0x7c92a98f()ntdll.dll 7c0e46a()(

and that's it - there is nothing else to give me any idea
Richard MacCutchan 16-Jul-12 10:15am    
You need to figure out the nearest point in your code to the error, place a breakpoint there, and then use your debugger to step through it until you isolate the bug. There is no way we can figure it out on your behalf since we have even less information than you do.

I agree with Richard - I've not seen an exception in ntdll that wasn't actually my fault for years and years now ...

It's normally a broken string or a corrupt pointer - the 'works in release' is a very good indicator it's memory related

What you can try to do is enable OS symbols - downloadable from the MS Symbol server - it makes the stack dump considerably more intelligible - somewhere in options/debug

You may have to update some dll's to make it work[^]
 
Share this answer
 
Comments
Jackie Lloyd 16-Jul-12 9:20am    
Thankyou, I will try all your suggestions. However, what is weird that if I revert to a version of my code from a couple of months ago when I am sure (as i can be) that I didn't have the problem, it now has the problem. And the call stack info is:
=> cccccccc()
ntdll.dll! 0x7c903218()
ntdll.dll! 0x7c90327a()
ntdll.dll! 0x7c92a98f()
ntdll.dll 7c0e46a()(

and that's it - there is nothing else to give me any idea
enhzflep 16-Jul-12 11:36am    
That's a further indication of it being a memory problem.
You see, the thing is - a program with an error won't necessarily crash - it _may_ do, but it's not a guarantee.

Since your old code that was working is now crashing - but has not been modified, I can confidently say that your old code had the same error.
Thanks to everyone, I did step through and eventually found the problem. Needless to say, you were all right, it was my error (trying to check disk usage on a raid drive that wasn't switched on).
Never again will I try to blame something else! Sorry.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900