This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New problems with gcc-2.8.0 based code - NOW FIXED!


On Mon, 29 December 1997, 11:16:37, law@hurl.cygnus.com wrote:

 >   In message <199712291737.SAA07160@saturn.s-direktnet.de>you write:
 >   > Well, it wasn't a failure of the compiler! The kernel and all the modules
 >   > could be built successfully, but when booting this kernel some system
 >   > calls issued by the two programs `isapnp' and `clock' reproducably fail,
 >   > i.e. cause `segmentation violations' of the two programs.
 > OK.  That points to either a code generation bug or a bug in the linux
 > source.
 > 
 >   > I then recompiled isapnp and clock with gcc-2.8.0 and now the situation
 >   > became even worse: no more SIGSEGV's but kernel oops's!
 > :(
 > 
 > 
 >   > Perhaps I should look at the source of the particular programs and find
 >   > out using strace what's really going on.
 > Might be helpful.  Though I suspect it's a kernel module that's being
 > mis-compiled or is incorrectly written, so the strace might tell us
 > what syscall is failing.
 > 
 > jeff
 > 

I'm very sorry  for bothering you  with my kernel logs  :-( But as the
replies from RMS and likewise important GNU people indicate, it really
looks  as if we   reached a  situation  where  something needs to   be
clarified between the Linux and the GNU/gcc folks.

I just compiled Linux-2.1.76 twice:

  1. Using egcs-971225
  2. Using gcc-2.8.0-971225

Both compilations used the following flags and finished successfully:

  -march=pentium -mcpu=pentium -malign-loops=0 -malign-jumps=0 \
  -malign-functions=0 -DCPU=586 -fomit-frame-pointer -funroll-all-loops

Booting kernel 1. results in the following (from /var/log/kern.log):

  Dec 30 14:10:51 saturn kernel: klogd 1.3-3, log source = /proc/kmsg started.
  Dec 30 14:10:51 saturn kernel: Loaded 4218 symbols from /System.map.
  Dec 30 14:10:51 saturn kernel: Symbols match kernel version 2.1.76.
  Dec 30 14:10:51 saturn kernel: Error seeking in /dev/kmem 
  Dec 30 14:10:51 saturn kernel: Error adding kernel module table entry. 
  Dec 30 14:10:51 saturn kernel: Linux version 2.1.76 (manfred@saturn) (gcc version egcs-2.91.03 971225 (gcc-2.8.0)) #1 Sun Dec 28 12:20:54 MET 1997 
  Dec 30 14:10:51 saturn kernel: Console: 15 point font, 600 scans 
  Dec 30 14:10:51 saturn kernel: Console: colour VGA+ 100x40, 1 virtual console (max 63) 
  Dec 30 14:10:51 saturn kernel: PCI: BIOS32 Service Directory structure at 0xc00f99e0 
  Dec 30 14:10:51 saturn kernel: PCI: BIOS32 Service Directory entry at 0xf0400 
  Dec 30 14:10:51 saturn kernel: PCI: PCI BIOS revision 2.10 entry at 0xf0430 
  Dec 30 14:10:51 saturn kernel: Probing PCI hardware. 
  Dec 30 14:10:51 saturn kernel: Calibrating delay loop... 79.87 BogoMIPS 
  Dec 30 14:10:51 saturn kernel: Memory: 63132k/65536k available (952k kernel code, 392k reserved, 1028k data, 32k init) 
  Dec 30 14:10:51 saturn kernel: Swansea University Computer Society NET3.039 for Linux 2.1 
  Dec 30 14:10:51 saturn kernel: NET3: Unix domain sockets 0.16 for Linux NET3.038. 
  Dec 30 14:10:51 saturn kernel: Swansea University Computer Society TCP/IP for NET3.037 
  Dec 30 14:10:51 saturn kernel: IP Protocols: ICMP, UDP, TCP 
  Dec 30 14:10:51 saturn kernel: CPU: Intel Pentium 75+ stepping 0c 
  Dec 30 14:10:51 saturn kernel: Checking 386/387 coupling... Ok, fpu using exception 16 error reporting. 
  Dec 30 14:10:51 saturn kernel: Checking 'hlt' instruction... Ok. 
  Dec 30 14:10:51 saturn kernel: Intel Pentium with F0 0F bug - workaround enabled. 
  Dec 30 14:10:51 saturn kernel: POSIX conformance testing by UNIFIX 
  Dec 30 14:10:51 saturn kernel: Starting kswapd v 1.23  
  Dec 30 14:10:51 saturn kernel: Serial driver version 4.24 with no serial options enabled 
  Dec 30 14:10:51 saturn kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A 
  Dec 30 14:10:51 saturn kernel: ttyS01 at 0x02f8 (irq = 3) is a 16550A 
  Dec 30 14:10:51 saturn kernel: Uniform CD-ROM driver revision 2.0 
  Dec 30 14:10:51 saturn kernel: aic7xxx: <Adaptec AHA-294X SCSI host adapter> at PCI 12 
  Dec 30 14:10:51 saturn kernel: aic7xxx: BIOS enabled, IO Port 0xd800, IO Mem 0xe3800000, IRQ 11, Revision B 
  Dec 30 14:10:51 saturn kernel: aic7xxx: Single Channel, SCSI ID 7, 16/255 SCBs, QFull 16, QMask 0x1f 
  Dec 30 14:10:51 saturn kernel: scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 4.1/3.2 
  Dec 30 14:10:51 saturn kernel: scsi : 1 host. 
  Dec 30 14:10:51 saturn kernel: scsi0: Scanning channel A for devices. 
  Dec 30 14:10:51 saturn kernel:   Vendor: IBM       Model: DORS-32160        Rev: S82C 
  Dec 30 14:10:51 saturn kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02 
  Dec 30 14:10:51 saturn kernel: Detected scsi disk sda at scsi0, channel 0, id 0, lun 0 
  Dec 30 14:10:51 saturn kernel:   Vendor: IBM       Model: DORS-32160        Rev: WA0A 
  Dec 30 14:10:51 saturn kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02 
  Dec 30 14:10:51 saturn kernel: Detected scsi disk sda at scsi0, channel 0, id 1, lun 0 
  Dec 30 14:10:51 saturn kernel:   Vendor: PIONEER   Model: CD-ROM DR-124X    Rev: 1.00 
  Dec 30 14:10:51 saturn kernel:   Type:   CD-ROM                             ANSI SCSI revision: 02 
  Dec 30 14:10:51 saturn kernel: scsi : detected 2 SCSI disks total. 
  Dec 30 14:10:51 saturn kernel: SCSI device sda: hdwr sector= 512 bytes. Sectors= 4226725 [2063 MB] [2.1 GB] 
  Dec 30 14:10:51 saturn kernel: SCSI device sda: hdwr sector= 512 bytes. Sectors= 4226725 [2063 MB] [2.1 GB] 
  Dec 30 14:10:51 saturn kernel: Partition check: 
  Dec 30 14:10:51 saturn kernel:  sda: sda1 sda2 sda3 < sda5 > 
  Dec 30 14:10:51 saturn kernel:  sdb: sdb1 < sdb5 sdb6 sdb7 sdb8 > 
  Dec 30 14:10:51 saturn kernel: VFS: Mounted root (ext2 filesystem) readonly. 
  Dec 30 14:10:51 saturn kernel: Freeing unused kernel memory: 32k freed 
  Dec 30 14:10:51 saturn kernel: Adding Swap: 130748k swap-space (priority -1) 
  Dec 30 14:10:51 saturn kernel: Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996 

and so on .. nothing really interesting happens.
BUT booting kernel 2. will work comparable only until the swap file is
added:

[Same messages deleted]
  Dec 30 13:58:50 saturn kernel: Freeing unused kernel memory: 32k freed 
  Dec 30 13:58:50 saturn kernel: Adding Swap: 130748k swap-space (priority -1) 
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3e7b800, name=size-2048) 
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3e7b000, name=size-2048) 
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3e7a800, name=size-2048) 
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3e7a000, name=size-2048) 
  Dec 30 13:58:50 saturn kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000018 
  Dec 30 13:58:50 saturn kernel: current->tss.cr3 = 00101000, ^_r3 = 00101000 
  Dec 30 13:58:50 saturn kernel: *pde = 00000000 
  Dec 30 13:58:50 saturn kernel: Oops: 0000 
  Dec 30 13:58:50 saturn kernel: CPU:    0 
  Dec 30 13:58:50 saturn kernel: EIP:    0010:[<c01275d9>] 
  Dec 30 13:58:50 saturn kernel: EFLAGS: 00010002 
  Dec 30 13:58:50 saturn kernel: eax: 00000100   ebx: c02f52c0   ecx: 00000000   edx: c0221000 
  Dec 30 13:58:50 saturn kernel: esi: c3e79800   edi: 00000202   ebp: c3e79800   esp: c3e25f88 
  Dec 30 13:58:50 saturn kernel: ds: 0018   es: 0018   ss: 0018 
  Dec 30 13:58:50 saturn kernel: Process modutils (pid: 25, process nr: 8, stackpage=c3e25000) 
  Dec 30 13:58:50 saturn kernel: Stack: c3e24000 c3e887c0 00000400 00000021 c011b96d c009cda0 c011b99d c3e79800  
  Dec 30 13:58:50 saturn kernel:        c3e24000 ffffffff fffffffc 00000000 c011c14c 00000000 c0109f1a 00000000  
  Dec 30 13:58:50 saturn kernel:        00000000 400d2c44 ffffffff fffffffc 00000000 00000001 0000002b 0000002b  
  Dec 30 13:58:50 saturn kernel: Call Trace: [<c011b96d>] [<c011b99d>] [<c011c14c>] [<c0109f1a>]  
  Dec 30 13:58:50 saturn kernel: Code: 2b 69 18 89 e8 31 d2 f7 73 08 8b 51 04 8d 14 82 89 54 24 10  
  Dec 30 13:58:50 saturn kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000018 
  Dec 30 13:58:50 saturn kernel: current->tss.cr3 = 00101000, ^_r3 = 00101000 
  Dec 30 13:58:50 saturn kernel: *pde = 00000000 
  Dec 30 13:58:50 saturn kernel: Oops: 0000 
  Dec 30 13:58:50 saturn kernel: CPU:    0 
  Dec 30 13:58:50 saturn kernel: EIP:    0010:[<c01275d9>] 
  Dec 30 13:58:50 saturn kernel: EFLAGS: 00010002 
  Dec 30 13:58:50 saturn kernel: eax: 00000100   ebx: c02f52c0   ecx: 00000000   edx: c0221000 
  Dec 30 13:58:50 saturn kernel: esi: c3e79000   edi: 00000202   ebp: c3e79000   esp: c3e1ff88 
  Dec 30 13:58:50 saturn kernel: ds: 0018   es: 0018   ss: 0018 
  Dec 30 13:58:50 saturn kernel: Process modutils (pid: 26, process nr: 9, stackpage=c3e1f000) 
  Dec 30 13:58:50 saturn kernel: Stack: c3e1e000 c3e898e0 00000400 00000021 c011b96d c009cfa0 c011b99d c3e79000  
  Dec 30 13:58:50 saturn kernel:        c3e1e000 ffffffff fffffffc 00000000 c011c14c 00000000 c0109f1a 00000000  
  Dec 30 13:58:50 saturn kernel:        00000000 400d2c44 ffffffff fffffffc 00000000 00000001 0000002b 0000002b  
  Dec 30 13:58:50 saturn kernel: Call Trace: [<c011b96d>] [<c011b99d>] [<c011c14c>] [<c0109f1a>]  
  Dec 30 13:58:50 saturn kernel: Code: 2b 69 18 89 e8 31 d2 f7 73 08 8b 51 04 8d 14 82 89 54 24 10  
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3c57000, name=size-2048) 
  Dec 30 13:58:50 saturn kernel: kmem_free: Either bad obj addr or double free (objp=c3c56800, name=size-2048) 

And so on - a lot of kernel Oops's follow.  I really don't know, who's
to blame?!?!  Looking at Linux's `mm/slab.c' where the `kmem_free:..."
messages result from, doesn't really help, as there is _NO_ loop! BUT,
omitting `-funrool-all-loops' during compilation of the kernel results
in a working kernel without such messages?!?!

To summarize:

   - Kernel 2.1.76 built by egcs-971225 _and_ `-funroll-all-loops'
     works OK!
   - Kernel 2.1.76 built by egcs-971207 and -971215 and
     `-funroll-all-loops' DOESN'T work (for egcs-971207 we did
     the gcc-2.8.0 MERGE)!
   - Kernel 2.1.76 built by egcs-1.0 (and all previous snapshots!)
     and `-funroll-all-loops' works OK!
   - Kernel 2.1.76 built by gcc-2.8.0-971211, -971213 and -971225
     and `-funroll-all-loops' DOESN'T work!

Interestingly,    kernel    2.0.33    built   by  egcs-971225    _and_
`-funroll-all-loops' also doesn't work!

So, perhaps it's actually Linux or its  applications who's to blame?!?
Does  anybody know  an   e-mail address whom    we can  forward  these
questions?

Nevertheless, cheers 1998

Manfred


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]