Debugging Dynamic Memory Usage Errors Using HP WDB (766161-001, March 2014)
Example 26 Work-Around when program execution is in a frame that belongs to the GDB internal
leak detection library
...
(gdb) set heap-check on
(gdb) r
Starting program: corruption
warning: Memory block (size = 80 address = 0x40453970) appears to be corrupted at the end.
Allocation context not found
#1 main() at corruption.c:4
#2 main_opd_entry() from
warning: Use command backtrace (bt) to see the current context.
Ignore top 4 frames belonging to leak detection library of gdb.
__rtc_event () at ../../../Src/gnu/gdb/infrtc.c:1173
warning: Source file is more recent than library library librtc.so.
1173 */
(gdb) bt
#0 __rtc_event () at ../../../Src/gnu/gdb/infrtc.c:1173
#1 0x200000007d0fbd40:0 in check_bounds (pointer=0x40453970, size=80,
pclist=0x404309e4) at ../../../Src/gnu/gdb/infrtc.c:1278
#2 0x200000007d100f50:0 in rtc_record_free ()
at ../../../Src/gnu/gdb/infrtc.c:2261
#3 0x200000007d1025a0:0 in free () at
../../../Src/gnu/gdb/infrtc.c:2575
#4 0x4000950:0 in main () at corruption.c:10
(gdb) info corruption
Analyzing heap ...
Current thread is inside the allocator. Try again later.
(gdb) frame 3
#3 0x200000007d1025a0:0 in free () at
../../../Src/gnu/gdb/infrtc.c:2575
2575 __rtc_event (RTC_HEAP_GROWTH, pointer,0,0);
(gdb) finish
Run till exit from #3 0x200000007d1025a0:0 in free ()
at ../../../Src/gnu/gdb/infrtc.c:2575
0x4000950:0 in main () at corruption.c:10
10 free (x);
(gdb) info corruption
Analyzing heap ...
Additional Examples 89