LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-06-2008, 06:23 PM   #1
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
gdb itself Segmentation faults


I want to get a backtrace from a core dump file to understand a Segmentation fault in my program.

But when I try to do that, gdb pauses for a long time reading symbols from the .so file that contains all the interesting parts of my program, then gdb has a Segmentation fault.

Code:
#0  0x00000000004fba3a in dwarf2_read_section ()
#1  0x000000000050202d in dwarf2_build_psymtabs ()
#2  0x00000000004f3efb in read_pe_exported_syms ()
#3  0x00000000004b920b in syms_from_objfile ()
#4  0x00000000004ba6e3 in new_symfile_objfile ()
#5  0x00000000004baef5 in symbol_file_add_from_bfd ()
#6  0x00000000004557a6 in master_so_list ()
#7  0x000000000044712e in throw_exception ()
#8  0x0000000000447290 in catch_errors ()
#9  0x0000000000455b08 in solib_add ()
#10 0x0000000000457d78 in default_check_format ()
#11 0x000000000044712e in throw_exception ()
#12 0x0000000000447290 in catch_errors ()
#13 0x00000000004580ed in default_check_format ()
#14 0x00000000004472c0 in catch_errors ()
#15 0x000000000044712e in throw_exception ()
#16 0x0000000000447290 in catch_errors ()
#17 0x0000000000447303 in catch_command_errors ()
#18 0x000000000043e2b8 in main ()
My .so has a massive number of really LONG symbol names (from instantiation of some monster templated code). I assume there is some reasonable limit somewhere in gdb and my code goes way beyond it.

My .so file is 185MB. About 150MB of that is symbols. gdb's core dump file was 238MB. All those things seem rather tiny on an x86_64 system with 16GB of ram.

Any idea what limit I might have exceeded in gdb and how hard it might be to build or download a more robust gdb?

This gdb I'm using is
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
That seems to be pretty old.
I'm not the admin on this Linux system, nor do I know much about installing software on Red Hat even if had the rights to. But I expect/hope gdb is self contained enough that I could download a better version into my own directory.

I'd also prefer not to sidetrack that far if I don't need to.

I have an easily reproducible crash in my own program. Is there some other way to get it to print a backtrace?

Any suggestions?
 
Old 09-08-2008, 12:51 PM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
Upgrade your gdb. There was a locally exploitable overflow in the way gdb read dwarf2. Your output is probably triggering that. It should be solved when you upgrade.
 
Old 09-08-2008, 02:53 PM   #3
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Original Poster
Rep: Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194Reputation: 1194
Thumbs up Solved

Thanks for your reply. When I asked the admin if he could get that upgrade for me, I found out two Suse Linux systems were also available for my use that already had versions 6.6 and 6.6.50 of gdb.

It fails in 6.6 but works in 6.6.50, so my immediate problem is solved, plus I now have some idea how far less than current version will be OK when we get around to upgrading gdb on that Red Hat system (in other tools, we've found it hard to go all the way up to current version on this Red Hat system).

Last edited by johnsfine; 09-08-2008 at 02:54 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
segmentation faults crash88 Linux - Software 3 07-03-2006 11:22 PM
Some help with segmentation faults? captainslushie Linux - Software 5 06-23-2005 03:59 PM
Segmentation Faults. Terroth Linux - Hardware 1 06-19-2005 06:16 AM
Segmentation Faults ryankask Mandriva 2 06-13-2005 08:10 PM
Segmentation Faults? floyd Linux - General 5 09-02-2003 12:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:53 AM.

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