LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 03: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, 06:07 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
- 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, 06: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, 01: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 07:34 AM
C seg fault drigz Programming 5 10-01-2004 04:35 PM
xmms - seg fault :( :( xconspirisist Linux - Software 2 02-07-2004 06:38 PM
seg fault on fclose (); lackluster Programming 4 06-28-2003 08:30 PM
gnome_error_dialog seg fault?? Castro Programming 3 06-11-2003 02:28 PM


All times are GMT -5. The time now is 12:32 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration