Bug 57413 - kernel 2.4.16 compiled by gcc-3.1-10 oopses on boot
kernel 2.4.16 compiled by gcc-3.1-10 oopses on boot
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: kernel (Show other bugs)
1.0
athlon Linux
medium Severity high
: ---
: ---
Assigned To: Arjan van de Ven
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-12-11 17:43 EST by Need Real Name
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-12-18 10:41:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
See do_signal() at the end of the file (17.93 KB, text/plain)
2001-12-11 17:49 EST, Need Real Name
no flags Details
gdb's dissambly of do_signal() as compiled by gcc-2.96-101.9 (9.66 KB, text/plain)
2001-12-11 17:51 EST, Need Real Name
no flags Details
gdb's dissambly of do_signal() as compiled by gcc-3.1-10 (9.19 KB, text/plain)
2001-12-11 17:52 EST, Need Real Name
no flags Details
The semantic differences between the cpp output of signal.c for gcc 2.96-101.9 and 3.1-10 (1.69 KB, patch)
2001-12-11 18:33 EST, Need Real Name
no flags Details | Diff
The output of kymoops that started all this, I almost forgot. :-) (3.36 KB, text/plain)
2001-12-11 19:42 EST, Need Real Name
no flags Details
This quick patch may solve hardy@weyl.ps.uci.edu compile problem (1.49 KB, patch)
2001-12-12 23:45 EST, Need Real Name
no flags Details | Diff

  None (edit)
Description Need Real Name 2001-12-11 17:43:30 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Description of problem:
When I use gcc-3.1-10 to compile stock kernel 2.4.16, the resulting kernel
oopses during booting, just after init is executed.  gcc-2.96-101.9
compiles the same kernel tree without any problems.  
The earlier gcc3 packages also worked fine.

I will attach the two decoded oopses in do_signal(), the gdb disassembly of
do_signal for the two versions of gcc, and a short diff of the prepocessed
arch/i386/kernal/signal.c file (home of do_signal()).  This diff is due to
include/linux/spinlock.h testing the gcc version for 3 or higher, but as I
say, earlier RedHat Rawhide gcc3 versions worked OK.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Compile kernel 2.4.16 with gcc-3.1-10.
2. Boot the new kernel


Actual Results:  It oopses during the boot, just after init is started, in
do_signal().

Expected Results:  It should not have oopsed. :-)  Presumably gcc-3.1.10 is
miscompiling do_signal()

Additional info:

Thanks to Ben LaHaise for telling me what information to include here.
Comment 1 Need Real Name 2001-12-11 17:49:43 EST
Created attachment 40387 [details]
See do_signal() at the end of the file
Comment 2 Need Real Name 2001-12-11 17:51:20 EST
Created attachment 40388 [details]
gdb's dissambly of do_signal() as compiled by gcc-2.96-101.9
Comment 3 Need Real Name 2001-12-11 17:52:31 EST
Created attachment 40389 [details]
gdb's dissambly of do_signal() as compiled by gcc-3.1-10
Comment 4 Need Real Name 2001-12-11 18:33:34 EST
Created attachment 40390 [details]
The semantic differences between the cpp output of signal.c for gcc 2.96-101.9 and 3.1-10
Comment 5 Need Real Name 2001-12-11 19:42:33 EST
Created attachment 40391 [details]
The output of kymoops that started all this, I almost forgot. :-)
Comment 6 Hardy Mayer 2001-12-12 23:39:16 EST
I had truouble completing a compile of 2.4.16. 
The compile died in the linking stage with some unrecognized 
stuff in net/network.o.  Unfortunately I did not save the output, but
reinstalled gcc-2.96-101.i386.rpm  and the kernel compiled fine. 
I have also previously tried gcc3, which worked also.
Comment 7 Need Real Name 2001-12-12 23:45:56 EST
Created attachment 40467 [details]
This quick patch may solve hardy@weyl.ps.uci.edu compile problem
Comment 8 Jakub Jelinek 2001-12-18 10:41:32 EST
The do signal thing is a kernel bug. Using:
asmlinkage int FASTCALL(do_signal(struct pt_regs *regs, sigset_t *oldset));
which is in fact
__attribute__((regparm(0))) int do_signal(struct pt_regs *, sigset_t *) __attribute__((regparm(3)));
means: I really don't care what calling convention will it use, let's see.
Apparently gcc will prefer regparm(0) while older gcc's prefered regparm(3).
Likewise with save_x86_state.
I think gcc is free to pick anything here, gcc documentation never talks about
what is done when conflicting attributes are attached to the same function.
Will post a patch to lkml.
Comment 9 Need Real Name 2002-02-04 15:20:00 EST
The kernel's declaration of do_signal in arch/i386/kernel/signal.c was fixed in
2.4.18-pre1 and the original problem no longer occurs.  So I'm closing this bug,
I hope NOTABUG is the right resolution (since it was a kernel bug, not a gcc bug).

Note You need to log in before you can comment on or make changes to this bug.