Re: Debug OK! Release Wrong! - ntdll.dll heap manager
7c941230 cc int 3
But what it means? Is there any message telling me where my program is
wrong?
int 3 is a breakpoint, which indicates the ntdll.dll is detecting some
problem and triggering the breakpoint because of it. To see where the
problem originates you should inspect the callstack in the WinDbg. On
the callstack you should see an allocation or deallocation which has
detected the problem. If detection on deallocation is not enough for
you, you might want to give a try running in a "Full-Page Heap" as
described in the MS KB document I have linked before.
I understand WinDbg is not very comfortable compared to VS IDE, but if
you read its help you should soon be able to perform basic operations in
it. First you need to check the callstack, and if the callstack is
missing symbols, you need to add path to your symbols. Setting up
automatic download for OS symbols using the SYMSRV could help as well,
as the callstacks will probably contain a lot of OS DLLs in them.
Cheers
Ondrej
hill_yuan@hotmail.com napsal(a):
On 6$B7n(B24$BF|(B, $B8a8e(B6:15, Ondrej Spanel <OndrejSpanel.n...@microsoft.com>
wrote:
> One low-level difference which comes to mind mind between those two is
> the heap manager in ntdll.dll is checkin for the debugger and acts
> slightly differently depending on whether the debugger is present or
> not. This is why release version act different when running without
> debugging.
For more info about this see:http://www.debuginfo.com/tips/userbpntdll.html
(Links also tohttp://support.microsoft.com/?id=286470)
It also gives some tips how can heap corruption be detected and debugged.
Ondrej
Ondrej Spanel napsal(a):
> 2. It workd fine in release version when ruuning after "Start
> Bebugging" menu selection.
> 3. When running the release version after "Start Without Bebugging",
> 95% of my program workds fine but it refuse to enter one of a class
> memeber funtion!
One low-level difference which comes to mind mind between those two is
the heap manager in ntdll.dll is checkin for the debugger and acts
slightly differently depending on whether the debugger is present or
not. This is why release version act different when running without
debugging.
My crystal ball guess is you are experiencing some subtle heap
corruption (strangled pointer, or perhaps a buffer overrun) somewhere in
your code.
> Problem solved after changing /MT to /MTd. I don't know why and if it
> is good to do so. But At least, it works!
If my crystall ball is right, the fix above is very dangerous, as it
only hides the problem (most likely by allocating a little but more
memory for each object, which "fixed" the buffer overun), but it may hit
you anytime later. As usual - it will be some inconvenient time like a
day before you ship, or the day some important customer will test your
application ;)
Cheers
Ondrej
hill_y...@hotmail.com napsal(a):
Same question has been asked here several years ago but I still got
not much help from its anwsers.
My project is MFC build in VS2005. The program is:
1. It works fine in bebug version.
2. It workd fine in release version when ruuning after "Start
Bebugging" menu selection.
3. When running the release version after "Start Without Bebugging",
95% of my program workds fine but it refuse to enter one of a class
memeber funtion!
My checking code is something like:
class A
{
void dosomething()
{
::AfxMessageBox( L"entering A", MB_ICONWARNING );
}
};
class B
{
void dosomething()
{
A a;
::AfxMessageBox( L"entering B", MB_ICONWARNING );
}
};
I can get "entering B" message but fails to get "enetering A"!.
Any suggestion about this problem? Thanks in advance.- $B0zMQ%F%-%9%H$rI=<($7$J$$(B -
- $B0zMQ%F%-%9%H$rI=<((B -
There IS a error in ntdl.dll. The message looks like
Microsoft (R) Windows Debugger Version 6.9.0003.113 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: E:\C++\asu_motion\release\ASUmotion.exe
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search
path. *
* Use .symfix to have the debugger choose a symbol
path. *
* After setting your symbol path, use .reload to refresh symbol
locations. *
****************************************************************************
Executable search path is:
ModLoad: 00400000 009a2000 image00400000
ModLoad: 7c940000 7c9dd000 ntdll.dll
ModLoad: 7c800000 7c932000 C:\WINDOWS\system32\kernel32.dll
ModLoad: 76c40000 76c68000 C:\WINDOWS\system32\imagehlp.dll
ModLoad: 77bc0000 77c18000 C:\WINDOWS\system32\msvcrt.dll
(324.c2c): Break instruction exception - code 80000003 (first chance)
eax=00051eb4 ebx=7ffdf000 ecx=00000004 edx=00000010 esi=00051f48
edi=00051eb4
eip=7c941230 esp=127cfb20 ebp=127cfc94 iopl=0 nv up ei pl nz
na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00000202
*** ERROR: Symbol file could not be found. Defaulted to export
symbols for ntdll.dll -
ntdll!DbgBreakPoint:
7c941230 cc int 3
But what it means? Is there any message telling me where my program is
wrong?