Very strange Segmentation fault analysis in GDB

3

I have application (server) written in C++ that are crashing around few hours, looks random probably.

Worst part is i trying to debug any of core file using gdb and i see that result:

gdb --core=core.668 --symbols=selectserver
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Core was generated by `./selectserver'.
Program terminated with signal 11, Segmentation fault.
[New process 672]
[New process 671]
[New process 670]
[New process 669]
[New process 668]
#0  0xb7866896 in ?? ()
(gdb) info threads
  5 process 668  0xffffe410 in __kernel_vsyscall ()
  4 process 669  0xffffe410 in __kernel_vsyscall ()
  3 process 670  0xffffe410 in __kernel_vsyscall ()
  2 process 671  0xffffe410 in __kernel_vsyscall ()
* 1 process 672  0xb7866896 in ?? ()
(gdb) bt
#0  0xb7866896 in ?? ()
#1  0x082da4b0 in ?? ()
#2  0xb79e4252 in ?? ()
#3  0xa2ba9014 in ?? ()
#4  0x0825e14c in ?? ()
#5  0x082da4b0 in ?? ()
#6  0xb56175e8 in ?? ()
#7  0x00000080 in ?? ()
#8  0xb5fe723f in ?? ()
#9  0xa2ba9014 in ?? ()
#10 0xa2ba9008 in ?? ()
#11 0xb7a32ff4 in ?? ()
#12 0x00000000 in ?? ()
(gdb) thread 2
[Switching to thread 2 (process 671)]#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7889486 in ?? ()
#2  0x00000000 in ?? ()
(gdb) thread 3
[Switching to thread 3 (process 670)]#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7889486 in ?? ()
#2  0x00000000 in ?? ()
(gdb) thread 4
[Switching to thread 4 (process 669)]#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7889486 in ?? ()
#2  0x00000000 in ?? ()
(gdb) thread 5
[Switching to thread 5 (process 668)]#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb78b7de1 in ?? ()
#2  0x00000032 in ?? ()
#3  0xbf849ae8 in ?? ()
#4  0xbf8499e8 in ?? ()
#5  0x00000000 in ?? ()
(gdb) quit

I dont know what is going on, why addresses on stack excluding __kernel_vsyscall are so wired not maps to symbol.

What i need to do to find the problem, debug memory dump of that problem.

Thanks for help!

c++
gdb
stack
segmentation-fault
asked on Stack Overflow Aug 15, 2012 by Svisstack

2 Answers

3

You need to compile the program with debugging symbols or get a separate file with debugging symbols. Pass the -g flag to gcc to enable these.

If you want to see what all of the functions are, even the ones inside library functions (for instance, standard library functions) you also need to get a version of the library with debugging symbols.

answered on Stack Overflow Aug 15, 2012 by Dirk Holsopple
1

Starting gdb --core=core.668 selectserver fixed problem.

answered on Stack Overflow Aug 15, 2012 by Svisstack

User contributions licensed under CC BY-SA 3.0