tags:

views:

69

answers:

1

I've got a SIGSEGV I'm trying to track down in my code, but I'm getting strange backtraces like this out of GDB:

#1  0x00407d15 in print_banner (msg=0x2e2e2e2e <Address 0x2e2e2e2e out of bounds>)
    at ../include/test_util.hh:20
#2  0x2e2e2e2e in ?? ()
#3  0x2e2e2e2e in ?? ()
#4  0x2e2e2e2e in ?? ()
#5  0x2e2e2e2e in ?? ()
#6  0x2e2e2e2e in ?? ()
#7  0x2e2e2e2e in ?? ()
#8  0x2e2e2e2e in ?? ()
#9  0x2e2e2e2e in ?? ()
#10 0x2e2e2e2e in ?? ()
#11 0x2e2e2e2e in ?? ()
#12 0x2e2e2e2e in ?? ()
#13 0x2e2e2e2e in ?? ()
#14 0x2e2e2e2e in ?? ()
#15 0x2e2e2e2e in ?? ()
#16 0x2e2e2e2e in ?? ()
#17 0x2e2e2e2e in ?? ()
#18 0x2e2e2e2e in ?? ()
#19 0x2e2e2e2e in ?? ()
#20 0x2e2e2e2e in ?? ()
#21 0x2e2e2e2e in ?? ()
#22 0x2e2e2e2e in ?? ()
#23 0x2e2e2e2e in ?? ()
#24 0x2e2e2e2e in ?? ()
#25 0x2e2e2e2e in ?? ()
#26 0x2e2e2e2e in ?? ()
#27 0x2e2e2e2e in ?? ()
#28 0x2e2e2e2e in ?? ()
#29 0x2e2e2e2e in ?? ()
#30 0x2e2e2e2e in ?? ()
#31 0x2e2e2e2e in ?? ()
#32 0x2e2e2e2e in ?? ()
#33 0x2e2e2e2e in ?? ()
#34 0x2e2e2e2e in ?? ()
#35 0x2e2e2e2e in ?? ()
#36 0x2e2e2e2e in ?? ()
#37 0x2e2e2e2e in ?? ()
#38 0x2e2e2e2e in ?? ()
#39 0x2e2e2e2e in ?? ()
#40 0x2e2e2e2e in ?? ()
#41 0x2e2e2e2e in ?? ()
#42 0x2e2e2e2e in ?? ()
#43 0x2e2e2e2e in ?? ()
#44 0x2e2e2e2e in ?? ()
#45 0x2e2e2e2e in ?? ()
#46 0x2e2e2e2e in ?? ()
#47 0x2e2e2e2e in ?? ()
#48 0x2e2e2e2e in ?? ()

Which isn't very help other than to tell me that print_banner is getting 0x2e2e2e2e as it's msg parameter (const char*), where are all these values coming from, is GDB trying to tell me something specific here?

+11  A: 

You get this when you've corrupted the stack, and overwritten stuff that gdb needs. Sounds like you've overflown a buffer with a bunch of "...." characters.

Tools like valgrind can more easily help you diagnose such problems.

nos
The print_banner function does indeed pad my message with enough '.' characters to align it to the right side of the screen, so I imagine you're exactly correct, I'll focus there, thanks for the help.
gct
Sure enough, was underflowing an unsigned int so I was writing a huge number of '.' to memory and smashing everything to hell.
gct