Analysing debugger output for an aplication in release mode

324 views Asked by At

I develop a win32 application using i686-w64-mingw32-gcc 4.7.2 crosscompiler under Ubuntu 12.10.

When I run my application compiled in the release mode and it crashes, I may receive an output like bellow.

I am wondering how to interpret it? Is there some useful information that I could get from that? For example would it be possible to get lines in my source code from the Stack dump?

wine: Unhandled page fault on read access to 0x00006c11 at address 0x401cb1 (thread 0009), starting debugger...
Application tried to create a window, but no driver could be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly.
Unhandled exception: page fault on read access to 0x00006c11 in 32-bit code (0x00401cb1).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:00401cb1 ESP:007af750 EBP:007af9c8 EFLAGS:00010206(  R- --  I   - -P- )
 EAX:00406a20 EBX:00000004 ECX:00006c11 EDX:00006c11
 ESI:00000068 EDI:00110440
Stack dump:
0x007af750:  007af7df 00000030 00000043 00000004
0x007af760:  00142fc0 3ff54e5b 00406a20 3ff57208
0x007af770:  0207251c 3ff4cb7d 02072574 3ff51f7f
0x007af780:  ea9e6eeb 3ff49b90 e09fe868 3ff4c562
0x007af790:  00006c11 00000045 0209c5b4 007afa0c
0x007af7a0:  00000004 019b0000 007af7f8 00110000
000c: sel=0067 base=00000000 limit=00000000 16-bit --x
Backtrace:
=>0 0x00401cb1 in analyser (+0x1cb1) (0x007af9c8)
  1 0x00536147 in analyser (+0x136146) (0x007afd98)
  2 0x004013fa __tmainCRTStartup+0x279() [/home/ruben/mingw-w64/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:313] in analyser (0x007afe70)
  3 0x7b859ddc call_process_entry+0xb() in kernel32 (0x007afe88)
  4 0x7b85b04f in kernel32 (+0x4b04e) (0x007afec8)
  5 0x7bc71d90 call_thread_func_wrapper+0xb() in ntdll (0x007afed8)
  6 0x7bc7486d call_thread_func+0x7c() in ntdll (0x007affa8)
  7 0x7bc71d6e RtlRaiseException+0x21() in ntdll (0x007affc8)
  8 0x7bc49f4e call_dll_entry_point+0x61d() in ntdll (0x007affe8)
0x00401cb1: movl    0x0(%edx),%eax
Modules:
Module  Address         Debug info  Name (89 modules)
PE    240000-  273000   Deferred        ssleay32
PE    280000-  37e000   Deferred        libeay32
...
1

There are 1 answers

1
Employed Russian On BEST ANSWER

I am wondering how to interpret it?

It appears pretty clear already: your code, more precisely: instruction at address 0x401cb1, attempted to dereference memory at address 0x00006c11. That memory access was not valid, and triggered a page fault.

Is there some useful information that I could get from that?

Yes, as above.

For example would it be possible to get lines in my source code from the Stack dump?

Sure: when you build your application in release mode, add the -g flag. Then

addr2line -fe analyser 0x401cb1

should tell you which file/line the address 0x401cb1 corresponds to.