1

I wrote a program in assembly and it segfaults at random times and all i am getting from gdb is this. Any idea why? I am not looking for a specific answer regarding my code, but gdb as a whole. Why does it say ?? () I have looked around the web and cant seem to find another instance of this posted anywhere. Wouldn't it usually tell me which function it is in?

Program received signal SIGSEGV, Segmentation fault.
0x53f63156 in ?? ()
Shane1022
  • 39
  • 5
  • Does `display/i $pc` help? – Leeor Dec 02 '13 at 21:16
  • it tells me 0x8048591 : leave I am new to assembly so is there anyway you could help me understand what that means? I know it must be happening in my end function. What does the +6 stand for? – Shane1022 Dec 02 '13 at 21:32
  • Well, it's hard to tell without your code. You won't have symbols like you may be used from debugging c of course, because you don't have any high level code here (which function names did you expect?) - you should be able to view the assembly code though – Leeor Dec 02 '13 at 22:21

2 Answers2

1

Program received signal SIGSEGV, Segmentation fault.
0x53f63156 in ?? ()

Usually this means that your program jumped to an invalid address.

Frequent causes:

  • calling a virtual function on a deleted object
  • using uninitialized function pointer
  • overwriting return address on stack

In the first two, (gdb) where should still be able to tell you how you got there.

In the last one, you may have to use tools, such as address sanitizer, to tell you where the overflow is happening (address sanitizer or Valgrind are tools of choice for debugging the other causes as well).

P.S. Your pointer 0x53f63156 looks like it could be ASCII: "S.1V" (where '.' is 0xF6). If your program deals with strings like 'S.1V', then stack overflow is a very likely cause.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
0

It's been a long time since those, but I guess:

Program received signal SIGSEGV, Segmentation fault. You are trying to access memory outside the range reserved for you. (bad pointer)

This:

0x53f63156 in ?? ()

probably tries to say, that the illegal memory address you tried to access was 0x53f63156 and the "??" means that there is no name given to that routine where the access took place - or at least it's not found in the symbol table.

turboscrew
  • 676
  • 4
  • 13