Application hang without debug information

Eric,

What do you mean by backtrace isn’t working?

Is it showing something like:

#0 0x(some address) in ?? ()

The ?? indicates a stack corruption. A successful trace should always show several layers of function addresses (but not names since you are in release mode) that go all the way back up to the start point of the program/thread.

You can see this if you create a simple test program like:

void foo()
{
    char buf[4];   // local buffer

    memset(buf, 0, 20);   // buffer over run corrupts stack 

    int a = 10/0;   // divide by 0 does not corrupt stack

    printf("A is %d\n", a);    // Needed or compiler optimizes out the a=10/0 line
}

main {
    foo();
}

If you compile with the memset line active it will mangle the backtrace in the core file. If you comment that memset out and instead do the divide by 0 you will get a valid backtrace.

So it appears you mangled the stack in a local variable via a buffer overrun of some kind. I would think your other threads would still have valid backtraces…

This will be hard to solve from this core dump because you have no real info on where it happened. The only clue is its a stack issue and you have to look for local buffers that could be over run.

Tim

Thanks, Tim.
Yes, it shows like “#0 0x00000000 in ?? ()” in the debugger.

Then I put the debug version of binary and finally got a core dump after a few times of execution. Then I tried the postmortem debugger, it gave me the same result: no back trace information available… still have the “#0 0x00000000 in ?? ()” in the console debugger, though the symbols of the binary is available. Then is there any possible way to find the crash line information from this core dump file? I have tried to search for the possible local buffer overrun issues. Thanks.

Regards,
Eric

Eric,

Unfortunately I don’t know any way to find stack corruptions from dump files whether they are from release or debug executables.

You will literally have to hand trace the problem by examining the local variables in every function. This shouldn’t be too bad because normally there aren’t a lot of stack variables that can over flow. It’s pretty much limited to local arrays like the one in my sample program OR wrong arguments to printf %'s.

If you are really struggling to find it you should be able to add some printf debug statements in those functions that have local arrays and print out something like ‘enter XXX’ when entering and ‘exit XXX’ when exiting function XXX.

Tim