Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-19-2009, 10:50 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 10

Rep: Reputation: 0
GCC crashing machine when accessing swap file

Hi all,

I am trying to pinpoint why my application occasionally crashes the machine when compiling. I have monitored the compile process and it seems that it crashes only when memory is low and it is accessing the swap file.

In googling I found that others have had this problem and it appeared to be caused by the fact that the swap file was located on a different disk than the compiler.

Has anyone else had this problem or know the cause of it?

Old 07-20-2009, 04:07 PM   #2
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Originally Posted by tboss888 View Post
In googling I found that others have had this problem and it appeared to be caused by the fact that the swap file was located on a different disk than the compiler.
Do you have any links to those google results?

That answer sounds very unlikely.

With automatic tools rerunning a large number of compiles every day, I have seen a small number of non reproducible crashes of GCC. Those tools run several instances of GCC in parallel, so there is probably some memory pressure when the crashes occur. The tools then automatically rerun the failed compiles one at a time after all the rest are done. The non reproducible crashes of course never reproduce during the automatic individual rerun. Maybe the difference in memory pressure is a factor in the non reproducible results. But I don't know of any direct evidence supporting that guess.

Our swap file is on a local hard drive and the compiler is on an nfs mount. But I don't believe that could be a factor.

In my non reproducible failure I'm sure the swap file is big enough and the other processes run at the same time contained enough that I think I can safely rule out the possibility that there was a simple memory allocation failure triggered by Linux's complex heuristics for over commit limit. But if you see a GCC failure when memory is low, I think that is a cause you should consider:

Tasks can allocate large amounts of "demand zero" memory that take no physical ram and no swap space, but are treated by the kernel as committing memory, so that they might cause the kernel to refuse some later memory allocation request despite having a significant amount of free swap space.

The only possibilities I can think of for the symptom you describe are:
1) Flaky hardware
2) Obscure GCC bug mixed with some obscure way that memory pressure affects GCCs internal heuristics.
3) Linux kernel bug
4) Hitting the over commit limit.

Possibility 4 there is the only clean answer, so I expect it is correct for your problem. I'm pretty sure my non reproducible GCC crashes are possibility 2. That is absurdly unlikely, but in my case the others are more absurdly unlikely (1 is unlikely because the problem has occurred on multiple different computers).


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
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 02:16 PM
fedora core 6 crashing after attaching pendrive to machine linusunis Linux - Newbie 2 06-13-2008 09:45 AM
GUI keeps crashing on P2 machine watyoka Linux - Desktop 3 05-27-2007 11:11 AM
Problem accessing SWAP space by processes ajitup Linux - Software 7 12-03-2006 09:39 PM
YAST2 crashing with gcc rpm! HELP nectron101 Linux - Software 3 04-18-2006 09:44 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:38 PM.

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