LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-25-2005, 02:40 AM   #1
dh0104
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Rep: Reputation: 0
seg fault on fedora only


hi, i am still new to linux, so please give me as much advise as you can. thank you.

what's the best way to debug a seg fault if it only happens on my fedora linux 3 laptop? it runs without problem on my friend's debian-based machine, and also on school's solaris workstation. it's driving me crazy and i can find the line where the program hangs but it makes no sense to me.

any suggestion is greatly appreciated.
 
Old 03-25-2005, 05:07 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
- Run it in the debugger (gdb). Sometimes a program does not segfault when running in gdb, while it does segfault without gdb.

- Thorougly read the code.

- run it with "valgrind".
 
Old 03-25-2005, 05:18 AM   #3
Kode
LQ Newbie
 
Registered: Dec 2004
Location: Barrie, Ontario
Distribution: Fedora 11, Prime GNU/Linux
Posts: 2

Rep: Reputation: 0
95% of the segfaults I get are because of bad RAM in the machine... just something to keep in mind if you don't see anything strange from gdb.
 
Old 03-26-2005, 12:57 PM   #4
dh0104
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Original Poster
Rep: Reputation: 0
thank you both.

the code is written by my friend, he tested it on his machine with valgrind to avoid memory leaks. it returned no error. on my machine valgrind returns a whole bunch of "mismatched free/delete" thing, and sometimes during run time, instead of seg fault, it says something like"*****glibc detects double free******"

my friend says it might be glibc that's giving me problem. i think the version i have is the most current one. how do i fix this?

oh, i've also swapped different memory modules, same result, so i don't think it's hardware issue.

thank you again, and any suggestion is helpful.
 
  


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
weird seg fault zaichik Programming 7 01-29-2005 06:34 AM
C seg fault drigz Programming 5 10-01-2004 03:35 PM
xmms - seg fault :( :( xconspirisist Linux - Software 2 02-07-2004 05:38 PM
seg fault on fclose (); lackluster Programming 4 06-28-2003 07:30 PM
gnome_error_dialog seg fault?? Castro Programming 3 06-11-2003 01:28 PM

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

All times are GMT -5. The time now is 05:41 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