So I'm debugging a C++ program I wrote using game library allegro. I fixed a problem with returning a pointer from a function, recompiled, retested, and I got the following from GDB:
ok so its a segmentation fault, so I should be looking for an out of bounds array call or write-to?
Code:
****** malloc error repeated 1000 times ******
p9rev6(6901,0xb00a1000) malloc: *** error for object 0xfa910b88: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
p9rev6(6901,0xb00a1000) malloc: *** error for object 0x3376a0: double free
*** set a breakpoint in malloc_error_break to debug
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xc0000023
0x91c79688 in objc_msgSend ()
(gdb) backtrace
#0 0x91c79688 in objc_msgSend ()
#1 0x96f5b38a in CFRelease ()
#2 0x90b8d866 in ReleaseEvent ()
#3 0x910d280c in -[NSEvent dealloc] ()
#4 0x95ff444f in NSPopAutoreleasePool ()
#5 0x0020e929 in osx_event_handler ()
Cannot access memory at address 0x2ff
(gdb) x/i $pc
0x91c79688 <objc_msgSend+24>: mov 0x20(%edx),%edi
(gdb) p/x $edx
$1 = 0xc0000003
(gdb) p/x $edi
$2 = 0x3473f0
(gdb)
ok so its a segmentation fault, so I should be looking for an out of bounds array call or write-to?