Signal 11 while compiling the kernel

This FAQ describes what the possible causes are for an effect that bothers lots of people lately. Namely that a linux(*)-kernel (or any other large package for that matter) compile crashes with a "signal 11". The cause can be software or (most likely) hardware. Read on to find out more.
(*) Of course nothing is Linux specific. If your hardware is flaky, Linux, Windows 3.1, FreeBSD, Windows NT and NextStep will all crash.

If all is ok, this is now part of the Mini-Howto collection for Linux. If you're interested, the Web version of this document is now (june '96) accessed about 300 times per week. (a growth of a factor of three in 3 months)
If you are not reading this at http://www.bitwizard.nl/sig11/, that's where you can find the most recent version.
Email me at R.E.Wolff@BitWizard.nl if you find any spelling errors, worthwhile additions or with an "it also happened to me" story. (Note that I reject some suggested additions on my belief that it is technical nonsense).


The Sig11 FAQ


QUESTION

My kernel compile crashes with
      gcc: Internal compiler error: program cc1 got fatal signal 11
What is wrong with the compiler? Which version of the compiler do I need? Is there something wrong with the kernel?

ANSWER

Most likely there is nothing wrong with your installation, your compiler or kernel. It very likely has something to do with your hardware. There are a variety of subsystems that can be wrong, and there is a variety of ways to fix it. Read on, and you'll find out more.

QUESTION

Ok it may not be the software, How do I know for sure?

ANSWER

First lets make sure it is the hardware that is causing your trouble. When the "make" stops, simply type "make" again. If it compiles a few more files before stopping, it must be hardware that is causing you troubles. If it immediately stops again (i.e. scans a few directories with "nothing to be done for xxxx" before bombing at exactly the same place), try
        dd if=/dev/hda of=/dev/null bs=1024k count=16
Change "hda" to "sda" if you have a SCSI disk. Change the count=16 to the number of megabytes of main memory that you have. This will cause the first 16Mb of your harddisk to be read from disk, forcing the C source files and the gcc binary to be reread from disk the next time you run it. Now type make again. If it still stops in the same place I'm starting to wonder if you're reading the right FAQ, as it is starting to look like a software problem after all.... Take a peek at the "what are the other possibilities" question..... If without this "dd" command the compiler keeps on stopping at the same place, but moves to another place after you use the "dd" you definitely have a disk->ram transfer problem.

QUESTION

What does it really mean?

ANSWER

Well, the compiler accessed memory outside its memory range. If this happens on working hardware it's a programming error inside the compiler. That's why it says "internal compiler error". However when the hardware occasionally flips a bit, gcc uses so many pointers, that it is likely to end up accessing something outside of its addressing range. (random addresses are mostly outside your addressing range, as not very many people have a significant part of 4G as mainmemory... :-)

QUESTION

Ok. I may have a hardware problem what is it?

ANSWER

If it happens to be the hardware it can be:

QUESTION

RAM timing problems? I fiddled with the bios settings more than a month ago. I've compiled numerous kernels in the mean time and nothing went wrong. It can't be the RAM timing. Right?

ANSWER

Wrong. Do you think that the RAM manufacturers have a machine that makes 60ns RAMs and another one that makes 70ns RAMs? Off course not! They make a bunch, and then test them. Some meet the specs for 60 ns, others don't. Those might be 61 ns if the manufacturer would have to put a number to it. In that case it is quite likely that it works in your computer when for example the temperature is below 40 degrees centigrade (chips become slower when the temp rises. That's why some supercomputers need so much cooling).

However "the coming of summer" or a long compile job may push the temperature inside your computer over the "limit". -- Philippe Troin (ptroin@compass-da.com)


QUESTION

Memory problems? My BIOS tests my memory and tells me its ok. I have this fancy DOS program that tells me my memory is OK. Can't be memory right?

ANSWER

Wrong. The memory test in the BIOS is utterly useless. It may even occasionally OK more memory than really is available, let alone test whether it is good or not.
A friend of mine used to have a 640k PC which had a single 64kbit chip instead of a 256kbit chip in the second 256k bank. This means that he effectively had 320k working memory. Sometimes the BIOS would test 384k as "OK". Anyway, only certain applications would fail. It was very hard to diagnose the actual problem....
Most memory problems only occur under special circumstances. Those circumstances are hardly ever known. gcc Seems to exercise them. Some memory tests, especially BIOS memory tests, don't. I'm working on creating a floppy with a linux kernel and a good memory tester on it. Bug me about it again......
The floppy is not ready yet, but if you have a working Linux system you could try my memtesting program. It is available from http://www.bitwizard.nl/sig11/memtest.tar.gz (binary) and from http://www.bitwizard.nl/sig11/memtest.tgz.uue (uuencoded tarred gzipped). I'm working on something even better, but you will have to wait for that.....

QUESTION

Does it only happen when I compile a kernel?

ANSWER

Nope. There is no way your hardware can know that you are compiling a kernel. It just so happens that a kernel compile is very tough on your hardware, so it just happens a lot when you are compiling a kernel.

QUESTION

Nothing crashes on NT, Windows 95, OS/2 or DOS. It must be something Linux specific.

ANSWER

First of all, Linux stresses your hardware more than all of the above. Some OSes like the Microsoft ones named above crash in unpredictable ways anyway. Nobody is going to call Microsoft and say "hey, my windows box crashed today". If you do anyway, they will tell you that you, the user, made an error (see the interview with Bill Gates in a German magazine....) and that since it works now, you should shut up.
Those OSes are also somewhat more "predictable" than Linux. This means that Excel might always be loaded in the exact same memory area. Therefore when the bit-error occurs, it is always excel that gets it. Excel will crash. Or excel will crash another application. Anyway, it will seem to be a single application that fails, and not related to memory.
What I am sure of is that a cleanly installed 1.2.13 Linux system should be able to compile the kernel without any errors. Certainly no sig-11 ones.
Really Linux and gcc stress your hardware more than other OSes. If you need a non-linux thingy that stresses your hardware to the point of crashing, you can try winstone. -- Jonathan Bright (bright@informix.com)

QUESTION

Is it always signal 11?

ANSWER

Nope. Other signals like six and four also occur occasionally. Signal 11 is most common though.

As long as memory is getting corrupted, anything can happen. I'd expect bad binaries to occur much more often than they really do. Anyway, it seems that the odds are heavily biased towards gcc getting a signal 11. Also seen:

The first few ones are cases where the kernel "suspects" a kernel-programming-error that is actually caused by the bad memory. The last few point to application programs that end up with the trouble.

-- S.G.de Marinis (trance@interseg.it)
-- Dirk Nachtmann (nachtman@kogs.informatik.uni-hamburg.de)


QUESTION

What do I do?

ANSWER

Things to try when you want to find out what is wrong... The hardest part is that most people will be able to do all of the above except borrowing memory from someone else, and it doesn't make a difference. This makes it likely that it really is the RAM. Currently RAM is the most pricy part of a PC, so you rather not have this conclusion, but I'm sorry, I get lots of reactions that in the end turn out to be the RAM. However don't despair just yet: your RAM may not be completely wasted: you can always try to trade it in for different or more RAM.

QUESTION

I had my RAMs tested in a RAM-tester device, and they are OK. Can't be the RAM right?

ANSWER

Wrong. It seems that the errors that are currently occuring in RAMS are not detectable by RAM-testers. It might be that your motherboard is accessing the RAMs in dubious ways or otherwise messing up the RAM while it is in YOUR computer. The advantage is that you can sell your RAM to someone who still has confidence in his RAM-tester......

QUESTION

What are other possibilities?

ANSWER


QUESTION

I don't believe this. To whom has this happened?

ANSWER

Well for one it happened to me personally. But you don't have to believe me. It also happened to:
I'm interested in new stories. If you have a problem and are unsure about what it is, it may help to Email me at R.E.Wolff@BitWizard.nl . My curiosity will usually drive me to answering your questions until you find what the problem is..... (on the other hand, I do get pissed when your problem is clearly described above :-)
This page is hosted by www.bitwizard.nl