LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-06-2004, 04:09 AM   #1
jnusa
Member
 
Registered: Jul 2004
Location: Denmark, Aarhus
Distribution: Ubuntu, Suse
Posts: 98

Rep: Reputation: 15
How to interpret backtrace (gdb)


Hi, I'm having 'random' segmentation fault, with my program. It's a server app, and normally runs with a fork() statement, to enable multible process'. But when I disable this, and just run 1 process at a time, I get ramdom segmentation faults. I want to fix this, and I'm using gdb for the first time (couldn't get anjuta to view stack ect.... also crashes now and then). I've run the program in gdb and typed bt to see the stack. But I'm having difficulty interpreting the output. Can anyone explain it to me?
Any information will be greatly appriciated

Regards Jnusa

Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1073801472 (LWP 5604)]
0x4108e0ca in mallopt () from /lib/tls/libc.so.6
(gdb) bt
#0  0x4108e0ca in mallopt () from /lib/tls/libc.so.6
#1  0x41150fcc in ?? () from /lib/tls/libc.so.6
#2  0x0000000a in ?? ()
#3  0x41151988 in __after_morecore_hook () from /lib/tls/libc.so.6
#4  0x41151988 in __after_morecore_hook () from /lib/tls/libc.so.6
#5  0x0000000a in ?? ()
#6  0x41151940 in __after_morecore_hook () from /lib/tls/libc.so.6
#7  0x080555e0 in ?? ()
#8  0x00000048 in ?? ()
#9  0x41151940 in __after_morecore_hook () from /lib/tls/libc.so.6
#10 0x41150fcc in ?? () from /lib/tls/libc.so.6
#11 0x41151940 in __after_morecore_hook () from /lib/tls/libc.so.6
#12 0x00000001 in ?? ()
#13 0x0000003e in ?? ()
#14 0x4108d11d in malloc () from /lib/tls/libc.so.6
#15 0x41151940 in __after_morecore_hook () from /lib/tls/libc.so.6
#16 0x0000003e in ?? ()
#17 0x00000000 in ?? ()
#18 0xbffff8e0 in ?? ()
#19 0xbffffad0 in ?? ()
#20 0xbffff898 in ?? ()
#21 0x0804a5dc in read_header (fd=0, obj=0x0) at util.c:304
Previous frame inner to this frame (corrupt stack?)
 
Old 12-06-2004, 09:16 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
mallopt at the end of a stack dump usually means that you corrupted a pointer in heap memory. You freed a pointer then created another one, then came back to free it again. If you share global pointers this could happen.

Or you tried to free (delete) a pointer that was not created by malloc (new).



Usually it is the latter problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kde crash backtrace help MRDucks Mandriva 1 11-14-2005 01:10 PM
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
Backtrace / stack dump for all Linux platforms GreyBeard Programming 7 07-21-2005 12:04 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration