Bug 427707
Summary: | i686 io_getevents syscalls clobbers registers it shouldn't | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Robert Scheck <redhat-bugzilla> | ||||||||
Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> | ||||||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
Severity: | high | Docs Contact: | |||||||||
Priority: | low | ||||||||||
Version: | rawhide | CC: | drepper, jakub, mebrown, mingo, roland, tglx | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | i686 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2008-04-11 21:46:12 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 235706 | ||||||||||
Attachments: |
|
Description
Robert Scheck
2008-01-06 23:28:00 UTC
Created attachment 290923 [details]
Output of "rpmbuild -ba --target i686,i386 glibc.spec"
Jakub, I'm seeing the same with gcc-4.3.0-0.5... I'm still seeing the same when building glibc-2.7.90-4 by using gcc-4.3.0-0.6 Oh, same with gcc-4.3.0-0.7 and glibc-2.7.90-6 as well as in a local mock. Jakub? Roland? Those crashes are not coming up in the koji builds. Maybe experiment with different kernels to see if that affects this showing up. Roland, is it enough to switch kernel-headers or should I completely change the kernel including reboots etc.? I was referring to the kernel running when you do 'make check', not to the headers used to build glibc. Roland, I can see this with any F8 kernel, e.g. 2.6.24.3-12.fc8. I didn't try all Rawhide kernels yet, but it seems only to succeed on a RHEL5 kernel, which is just horribly wrong then. Can you please really have a closer look to it? I think, I know why this not shows up in mockbuild, because of mock! :-( So here are the parallels visible for me: Mockbuild (part a): make -s subdir=rtkaio -C rtkaio ..=../ tests make[2]: Entering directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' failed to create a shared memory object: shm_open: Function not implemented make[2]: Leaving directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' My build without mock (part a): make -s subdir=rtkaio -C rtkaio ..=../ tests make[2]: Entering directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl/rtkaio/tst-aiod.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl/rtkaio/tst-aiod64.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl/rtkaio/tst-aiod3.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl/rtkaio/tst-aiod4.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl/rtkaio/tst-aiod5.out] Error 1 make[2]: Target `tests' not remade because of errors. make[2]: Leaving directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' make[1]: *** [rtkaio/tests] Error 2 Mockbuild (part b): make -s subdir=rtkaio -C rtkaio ..=../ tests make[2]: Entering directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' make[2]: Leaving directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' make[2]: Entering directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' failed to create a shared memory object: shm_open: Function not implemented make[2]: Leaving directory `/builddir/build/BUILD/glibc-20080305T0857/rtkaio' My build without mock (part a): make -s subdir=rtkaio -C rtkaio ..=../ tests make[2]: Entering directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' make[2]: Leaving directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' make[2]: Entering directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-aiod3.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-aiod5.out] Error 1 Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-aiod4.out] Error 1 make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-cpuclock1.out] Error 1 Didn't expect signal from child: got `Segmentation fault' Didn't expect signal from child: got `Segmentation fault' make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-aiod64.out] Error 1 make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-aiod.out] Error 1 make[2]: *** [/usr/src/rpm/BUILD/glibc-20080305T0857/build-i686-linuxnptl-nosegneg/rtkaio/tst-cpuclock2.out] Error 1 make[2]: Target `tests' not remade because of errors. make[2]: Leaving directory `/usr/src/rpm/BUILD/glibc-20080305T0857/rtkaio' make[1]: *** [rtkaio/tests] Error 2 For me it seems, that it doesn't change anything when 'make check' is executed with another kernel running. Is it possible, that mock doesn't support shm_open? I have added support for shm to mock in git. Can you please test this version to see if it fixes your problem? Instructions on how to download and compile new version are here: https://fedorahosted.org/mock Using the latest mock, I'm now able to see this segmentation faults in mock as well, thanks to Ricky Zhou for testing this on a more fast machine. Okay...work for you, Roland and/or Jakub -- "make check" of glibc is now always segfaulting for these special parts in mock...upgrading to blocker, as this seems more critical to me now. Created attachment 297377 [details]
build.log
Jakub, ping on this issue, do you think it's reasonable to have a fix for Fedora 9 or should we punt to 10? Got to test this on i686 kernel and this is a kernel bug. See following small testcase. gcc -m32 -O2 -o io_getevents_bug io_getevents_bug.c ./io_getevents_bug For i?86, glibc (and other userland stuff) assumes that syscalls only clobber %eax register (with the return value), all other registers have their value preserved. I don't have access to many i686 kernels anymore, so all I could verify is that on 2.6.23.12-52.fc7.x86_64 and current RHEL5.2 beta x86_64 kernels %esi is preserved across io_getevents int $0x80, but in 2.6.24.4-64.fc8.i686 and as ajax tested for me also in 2.6.25-0.204.rc8.git4.fc9.i686 this prints: Bug - %esi modified by io_getevents syscall, 2 * sizeof (struct kio_event) has been added (where instead of 2 it can print 1 through 10, basically io_getevents changes %esi to point after the last struct kio_event). This seems pretty serious bug, could kernel folks please investigate ASAP at least which syscalls are broken in which kernels? Created attachment 302012 [details]
io_getevents_bug.c
Looking at kernel code and googling around, this smells like http://kerneltrap.org/node/6521, except that in this case it isn't a sibcall that causes a problem, but probably high register presure together with inlining the read_events function which increments the events argument. As a quick hack adding noinline attribute to read_events could very likely help (just guessing, haven't tried that) and guess we should revive PR27234. We definitely need that ABI-changing attribute to solve this sanely in the future. I reproduced a build with the problem using vanilla upstream sources (and f8's compiler). I tried an asm hack akin to prevent_tail_call(), to keep the args live at the end of the function, and that changed code generation not to tickle the problem. I'll turn it into a general macro hack and send it upstream. This is fixed in 2.6.25-rc9. A subset of that fix is in 2.6.24.4-80.fc8 |