www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Need help to find source file location by PC address

reply Calvin P <cloudlessapp gmail.com> writes:
I made a cross build with LDC -g -gdwarf-4 -O0 -D_DEBUG, the app 
crash with a report include PC address 0x005e34a9.

Is there a way to find the source location for that PC address?

==4172==ERROR: AddressSanitizer: stack-buffer-overflow on address 
0x035dfcf0 at pc 0x005e34a9 bp 0x035dfa20 sp 0x035dfa1c
WRITE of size 8 at 0x035dfcf0 thread T0
     <empty stack>

Address 0x035dfcf0 is a wild pointer.
SUMMARY: AddressSanitizer: stack-buffer-overflow
Shadow bytes around the buggy address:
   0x306bbf40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbf50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbf60: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 04 f3
   0x306bbf70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbf80: 00 00 00 00 00 00 00 00 f1 f1 04 f3 00 00 00 00
=>0x306bbf90: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1[04]f3
   0x306bbfa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbfb0: f1 f1 00 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00
   0x306bbfc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbfd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x306bbfe0: 00 f2 f2 f2 f2 f2 f2 f2 f2 f2 04 f2 00 00 f3 f3
Shadow byte legend (one shadow byte represents 8 application 
bytes):
   Addressable:           00
   Partially addressable: 01 02 03 04 05 06 07
   Heap left redzone:       fa
   Freed heap region:       fd
   Stack left redzone:      f1
   Stack mid redzone:       f2
   Stack right redzone:     f3
   Stack after return:      f5
   Stack use after scope:   f8
   Global redzone:          f9
   Global init order:       f6
   Poisoned by user:        f7
   Container overflow:      fc
   Array cookie:            ac
   Intra object redzone:    bb
   ASan internal:           fe
   Left alloca redzone:     ca
   Right alloca redzone:    cb
   Shadow gap:              cc
==4172==ABORTING
Dec 12 2020
parent Calvin P <cloudlessapp gmail.com> writes:
On Saturday, 12 December 2020 at 15:51:46 UTC, Calvin P wrote:
 I made a cross build with LDC -g -gdwarf-4 -O0 -D_DEBUG, the 
 app crash with a report include PC address 0x005e34a9.

 [...]
Find the solution: lldb-11 tests_curl (lldb) target create "tests_curl" Current executable set to 'tests_curl' (i686). (lldb) image lookup --address 0x005e34a9 Address: tests_curl[0x005e34a9] (tests_curl..text + 1975465) Summary: tests_curl`getinfo_offt + 1817 at getinfo.c (lldb) q
Dec 12 2020