Most recent kernel where this bug did not occur: 2.6.17.11 Distribution: Gentoo Linux, kernel from kernel.org, no patches Hardware Environment: x86, VIA C3-2 Software Environment: recent stable Gentoo Linux Problem Description: compiled kernel with gcc 3.4.6 and -Os and with gcc 4.1.1 and -Os: random crashes while compiling non-kernel packages, often during configure step. Trying on kernel without -Os optimization now. Seems to work that way. Never had a problem building on the -Os optimized kernel using gcc 3.4.6. Steps to reproduce:
Maybe I should add that the system crashed entirely. Could not log into the machine and loggers stopped recording.
Please ignore the "Most recent kernel where this bug did not occur" part.
This could be a bug in your gcc or a bug in the kernel exposed only by -Os. It's hard to debug without any additional information. You said you never had a problem before. Which is the most recent kernel that works for you with -Os? Can you confirm that your current gcc 3.4.6 builds a working version of this older kernel?
You probably misunderstood me. The only kernel version I'm talking of is 2.6.17.11. Never tried gcc 4.1.1 on any before that. gcc 3.4.6 always worked fine with size optimizations enabled in the kernel config. It is only since gcc 4.1.1 (don't know whether that applies to previous kernel versions, too) that I detect problems when compiling apps on a size-optimized kernel. I have recompiled the kernel again, this time without the optimization. gcc 4.1.1 seems to run properly now.
So gcc 3.4.6 builds your 2.6.17.11 with -Os, and this kernel works without any problems? (I'm trying to understand whether the gcc update or a kernel update causes your issue) I don't remember having seen any recent gcc 4.1.1 -Os micompilation on i386. Can you turn on all debug options in the kernel and check whether you can get any output at the console? Please attach the following: - dmesg from a -O2 2.6.17.11 - dmesg from a -Os 2.6.17.11 - your .config
Hmmm... I cannot reproduce the problem any more. Looks like it was some intermediary bootstrapping issue due to an "unclean/mixed" toolchain.
Ok, the problem is still there. I had enabled all debug options for the -Os optimized kernel and it crashed. But I don't see any log messages in my log files... the system seems to just stop.
Created attachment 8945 [details] config-2.6.17.11
Reinstalled last system backup before upgrade to gcc 4.1.1. I recompiled the whole system using gcc 3.4.6 without any instability issues (this time I masked the gcc4 package on my Gentoo Linux system). It is definitely the gcc 4.1.1 compiler that makes the kernel crash on my VIA C3 system. The problem does not exist on my Athlon XP system.
processor : 0 vendor_id : CentaurHauls cpu family : 6 model : 9 model name : VIA Nehemiah stepping : 8 cpu MHz : 1202.802 cache size : 64 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr cx8 sep mtrr pge cmov pat mmx fxsr sse up rng rng_en ace ace_en bogomips : 2407.62
There's a Fedoro Core 5 bug on this as well. FC5 is using gcc-4.1.0. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186852
I don't see any connection to the RedHat bug: neither does the problem go away when -Os is disabled during kernel compilation, nor does the problem occur during low load situations, nor is there any connection to VIA C3 hardware in the RedHat bug.
Read zleite's commments. He's saying that when he doesn't have CONFIG_CC_OPTIMIZE_FOR_SIZE set his system works. That's the same as what you wrote: "Trying on kernel without -Os optimization now. Seems to work that way."
That's what I said first. I had to revise it.
Problem is not there any more after I have upgraded the Gentoo Linux system profile to the recent non-SELinux profile and after having recompiled the system. I'm also running a non-SELinux kernel now. Maybe there is a bug with the kernel SE Linux.