LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2011, 12:41 PM   #1
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Rep: Reputation: 107Reputation: 107
What could cause segfaults while compiling, if the ram seems to be fine?


I googled around but most of what I could find said that segfaults are generally a memory issue.

I've noticed lately that I'll occasionally get a segfault while compiling on my computer. There's no noticeable pattern, just that every now and then a bit of software that I'm trying to compile will segfault on me, even software that I've compiled in the past.

I ran memtest86+, but it showed no issues at all. I run a stock kernel on Slackware, with no modifications to the system other than installing multilib support (which I'm 100% sure is done correctly).

What else could be the issue?
 
Old 07-22-2011, 01:38 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by Cultist View Post
I googled around but most of what I could find said that segfaults are generally a memory issue.

I've noticed lately that I'll occasionally get a segfault while compiling on my computer. There's no noticeable pattern, just that every now and then a bit of software that I'm trying to compile will segfault on me, even software that I've compiled in the past.

I ran memtest86+, but it showed no issues at all. I run a stock kernel on Slackware, with no modifications to the system other than installing multilib support (which I'm 100% sure is done correctly).

What else could be the issue?
Could it be heat damage?

I was having this problem on a machine that I used to overclock with.

I kept switching out parts trying to figure out what the problem was.

It turned out that there was some damage to the motherboard that resulted in segfaults.

I was getting them even when the system was not hot.

Luckily this was an older board that I replaced and all is good now ( except for the motherboard and the Athlon 64x2-5600 that I used to have in the board when I was overclocking. )
 
Old 07-22-2011, 01:44 PM   #3
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by andrewthomas View Post
Could it be heat damage?
Its possible, but I don't really think that's the problem. Its a laptop, it stays on pretty much 24/7 but its also on a laptop cooling fan most of the time too. It isn't overclocked and I don't do much to push the hardware. I use a temperature gauge widget and it generally stays right at the line between normal and hot. Its also in an air conditioned room 99% of the time.
 
Old 07-22-2011, 03:41 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
segfaults are mostly caused by buggy programs, not by hardware. A segfault is when a process tries to access a memory address that doesn't belong to it.
 
Old 07-22-2011, 10:32 PM   #5
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by MTK358 View Post
segfaults are mostly caused by buggy programs, not by hardware. A segfault is when a process tries to access a memory address that doesn't belong to it.
Yet, in my case it certainly was not a software problem. I was having problems compiling gcc and kernels. When I moved the drive to a similar machine, it compiled just fine.
 
Old 07-23-2011, 12:32 AM   #6
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by andrewthomas View Post
Yet, in my case it certainly was not a software problem. I was having problems compiling gcc and kernels. When I moved the drive to a similar machine, it compiled just fine.
If on another machine with same hard drive compilation works sure it's hardware problem. But if it's a laptop I guess changing the parts is a bit of challenge
 
Old 07-23-2011, 01:18 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Cultist View Post
I googled around but most of what I could find said that segfaults are generally a memory issue.
That is not correct. Segfaults are almost certainly caused by bugs in software and very unlikely to indicate a hardware problem.

Quote:
I've noticed lately that I'll occasionally get a segfault while compiling on my computer.
I have seen that a few times myself and never pinned it down, but I did see a noticeable pattern.

Quote:
There's no noticeable pattern, just that every now and then a bit of software that I'm trying to compile will segfault on me, even software that I've compiled in the past.
I often run multiple copies of the compiler simultaneously, nearly filling physical ram and typically using a small amount of swap. I have seen rare random segfaults in gcc only when doing that. If there is a significant margin of free ram beyond what one or more copies of gcc need, then there is no segfault.

Since I always have lots of free swap space, I'm pretty sure there is no commit limit issue (no memory request from gcc is being rejected by the kernel).

Some programs detect system resource levels (such as physical ram) and adjust their internal algorithms (time space trade off alternatives) to make better use of available resources. A bug in such code would exactly fit the symptoms I saw. But I don't know whether gcc even includes such code. I certainly have not been able to pin down the details.

I also don't know whether the segfault you've seen is related to the one I've seen.

Quote:
Originally Posted by Valery Reznic View Post
If on another machine with same hard drive compilation works sure it's hardware problem. But if it's a laptop I guess changing the parts is a bit of challenge
Same software working symptom free on another machine is still not much of an indication that the original problem was hardware. I think a software bug is still a more likely theory.

A program might take a different path based on any detail of the CPU or any resource level that the program cares to check. One path might hit the bug and another not.

Last edited by johnsfine; 07-23-2011 at 01:22 AM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kaffeine segfaults but xine works fine... daihard Linux - Software 1 11-07-2006 09:41 AM
added ram - system unstable, segfaults slackhack Linux - Hardware 7 11-03-2005 04:29 PM
2.6.6 segfaults whilst compiling kinasz Linux - General 2 06-26-2004 05:44 AM
Make Segfaults Or Spews Random Errors When Compiling 2.6 kernel johnleemk Linux - General 0 12-28-2003 09:50 AM
gcc 3.3.2 segfaults when compiling 2.4.23 kernel Azmeen Slackware 5 11-29-2003 07:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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