Bug 595915 - modpost segfaults on link when compiling x86 kernel on x86_64 system
Summary: modpost segfaults on link when compiling x86 kernel on x86_64 system
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-25 22:06 UTC by Alan Olsen
Modified: 2010-08-23 22:08 UTC (History)
9 users (show)

Fixed In Version: kernel-2.6.33.8-149.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-23 22:08:55 UTC
Type: ---


Attachments (Terms of Use)

Description Alan Olsen 2010-05-25 22:06:33 UTC
Description of problem:

Get a copy of the kernel source code. Get a config for an x86 (32 bit kernel). use either "make ARCH=x86" or "i386" and then "make". On a 32 bit machine, this will compile correctly. On a 64 bit machine it will segfault on the link.

Using the exact same code on Fedora 12 this works as expected.

Something in the current GCC is bjorked.


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

gcc-4.4.4-2.fc13.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Get kernel and config.
2. make ARCH=x86
3. Watch it segfault on link
  
Actual results:

Segfault on link.

Expected results:

Proper compile.

Additional info:

Comment 1 Jakub Jelinek 2010-05-25 22:34:23 UTC
Please post the exact error (and a few lines before it/after it, ideally with make V=1 so that it is clear what commands are executed.  From the above it isn't even clear which program segfaulted.

If it is gcc, please provide preprocessed source.

Comment 2 Alan Olsen 2010-05-26 16:32:31 UTC
Here is the crash point. I have tried this on two different 64 bit machines on Fedora 13 and one with Fedora 12.

  CC      arch/x86/lib/usercopy_32.o
  AR      arch/x86/lib/lib.a
  LD      vmlinux.o
  MODPOST vmlinux.o
/bin/sh: line 1: 26787 Segmentation fault      (core dumped) scripts/mod/modpost -a -o /home/alan/GitTrees/linux-2.6/Module.symvers -S vmlinux.o
make[1]: *** [vmlinux.o] Error 139
make: *** [vmlinux.o] Error 2

With V=1


make -f scripts/Makefile.build obj=arch/x86/lib
(cat /dev/null; ) > arch/x86/lib/modules.order
make -f scripts/Makefile.modbuiltin obj=arch/x86/lib
(for m in ; do echo kernel/$m; done;	\
	cat /dev/null ) > arch/x86/lib/modules.builtin
  ld -m elf_i386 -r -o vmlinux.o arch/x86/kernel/head_32.o arch/x86/kernel/head32.o arch/x86/kernel/head.o arch/x86/kernel/init_task.o  init/built-in.o --start-group  usr/built-in.o  arch/x86/built-in.o  kernel/built-in.o  mm/built-in.o  fs/built-in.o  ipc/built-in.o  security/built-in.o  crypto/built-in.o  block/built-in.o  lib/lib.a  arch/x86/lib/lib.a  lib/built-in.o  arch/x86/lib/built-in.o  drivers/built-in.o  sound/built-in.o  firmware/built-in.o  arch/x86/pci/built-in.o  arch/x86/power/built-in.o  arch/x86/video/built-in.o  net/built-in.o --end-group 
make -f /home/alan/GitTrees/linux-2.6/scripts/Makefile.modpost vmlinux.o
  scripts/mod/modpost  -a -o /home/alan/GitTrees/linux-2.6/Module.symvers    -S   vmlinux.o
/bin/sh: line 1:  7152 Segmentation fault      (core dumped) scripts/mod/modpost -a -o /home/alan/GitTrees/linux-2.6/Module.symvers -S vmlinux.o
make[1]: *** [vmlinux.o] Error 139
make: *** [vmlinux.o] Error 2

Comment 3 Jakub Jelinek 2010-05-26 16:42:30 UTC
So it is modpost rather than gcc or ld that segfaults.  That doesn't look like a gcc bug, most probably it is instead kernel bug.

Comment 4 Alan Olsen 2010-05-26 17:21:11 UTC
The exact same code compiles correctly under Fedora 12.

Comment 5 Chuck Ebbert 2010-05-27 01:43:14 UTC
Try using setarch when building 32-bit on 64-bit:

  setarch i386 make <...>

Comment 6 Alan Olsen 2010-05-27 22:13:23 UTC
I have used setarch, I have used i386 (which creates a i386 chroot), and I have used ARCH=. All of them give the same segfault results.  All of them work on Fedora 12 with the exact same code.

Comment 8 Philippe Dax 2010-06-19 20:02:09 UTC
I have the same problem to build a new kernel-2.6.33.112.fc13.x86_64 on a machine with this kernel.

uname -a
Linux mariane.enst.fr 2.6.33.5-112.fc13.x86_64 #1 SMP Thu May 27 02:28:31 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux

make
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  LD      vmlinux.o
  MODPOST vmlinux.o
/bin/sh: line 1: 27725 Segmentation fault      (core dumped) scripts/mod/modpost -a -o /root/rpmbuild/BUILD/kernel-2.6.33.new/Module.symvers -S -c vmlinux.o
make[1]: *** [vmlinux.o] Error 139
make: *** [vmlinux.o] Error 2

Comment 9 Alan Olsen 2010-06-21 17:55:35 UTC
Try the patch in comment 7. It works for me. (It should get into mainline sometime soon.)

Comment 10 Philippe Dax 2010-06-22 07:00:27 UTC
(In reply to comment #9)
> Try the patch in comment 7. It works for me. (It should get into mainline
> sometime soon.)    

Sorry, I posted before read your patch, thanks it works !

Comment 11 Chuck Ebbert 2010-07-09 12:11:37 UTC
Patch wen in kernel-2.6.34.1-6.fc13

Comment 12 Fedora Update System 2010-08-10 23:54:39 UTC
kernel-2.6.34.3-37.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/kernel-2.6.34.3-37.fc13

Comment 13 Fedora Update System 2010-08-11 07:26:59 UTC
kernel-2.6.34.3-37.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/kernel-2.6.34.3-37.fc13

Comment 14 Chuck Ebbert 2010-08-18 09:46:01 UTC
2.6.34 kernel has been withdrawn. This will be fixed in a 2.6.33 update kernel.

Comment 15 Fedora Update System 2010-08-18 10:19:12 UTC
kernel-2.6.33.8-149.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/kernel-2.6.33.8-149.fc13

Comment 16 Fedora Update System 2010-08-20 01:26:23 UTC
kernel-2.6.33.8-149.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update kernel'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/kernel-2.6.33.8-149.fc13

Comment 17 Fedora Update System 2010-08-23 22:08:40 UTC
kernel-2.6.33.8-149.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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