Randomly Named User
Randomly Named User

Reputation: 1949

gdb giving a function name followed by a number instead of file and line number

I have a segmentation fault in my program, and I'm using gdb to identify where it's happening. However, I am not able to see a clear line number where the error is occurring.

Below is a screenshot of my output.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 20065168 (LWP 4645)]
0x007e537f in _int_free () from /lib/libc.so.6
(gdb) backtrace
#0  0x007e537f in _int_free () from /lib/libc.so.6
#1  0x007e90f0 in free () from /lib/libc.so.6
#2  0x080d9e67 in CRYPTO_free ()
#3  0xbfd15f7c in ?? ()
#4  0xbfd16108 in ?? ()
#5  0x08070b3e in function_random.19532 ()
#6  0x00000001 in ?? ()
#7  0x00000000 in ?? ()
(gdb)

frame 5 is the piece of code that I have written, but I don't quite understand what it means.

Can someone please explain?

Upvotes: 1

Views: 297

Answers (1)

Sourav Ghosh
Sourav Ghosh

Reputation: 134286

Most likely, in your case, debug symbols are not present in the binary. That is why, gdb is not able to read the debugging info and display them.

Re-compile your code, with the debugging enabled.

Example: for gcc, use the -g options.

Upvotes: 4

Related Questions