FS#54240 - [mkinitcpio-busybox][glibc] Segfault with glibc-2.25-2 at boot time
Attached to Project:
Arch Linux
Opened by Natrio (natrio) - Wednesday, 31 May 2017, 12:57 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Sunday, 18 June 2017, 22:02 GMT
Opened by Natrio (natrio) - Wednesday, 31 May 2017, 12:57 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Sunday, 18 June 2017, 22:02 GMT
|
Details
Description:
After glibc update from 2.25-1 to 2.25-2 and rebuilding of initramfs system can not boot anymore, because of busybox init process crash. Rollback to glibc-2.25-1 and initramfs rebuilding fixes the problem. Steps to reproduce: install glibc-2.25-2 and run /usr/lib/initcpio/busybox ash (for example, mkinitcpio-busybox with glibc-2.25-2 segfaults on some else commands, not init only) |
This task depends upon
Closed by Bartłomiej Piotrowski (Barthalion)
Sunday, 18 June 2017, 22:02 GMT
Reason for closing: Fixed
Sunday, 18 June 2017, 22:02 GMT
Reason for closing: Fixed
Simply rebuilded mkinitcpio-busybox 1.25.1 also segfaulted.
Latest 1.26.2 version seems to be good (on ash test)
Latest 1.26.2 (without any patches) version also segfaulted at boot time.
/usr/lib/initcpio/busybox ash
(on glibc-2.25-2 i686)
I mean, busybox have segfault trying to START the interactive shell, without any command INSIDE it.
But primary manifestation of this bug is exactly segfault of busybox init process at boot time.
Tested on Intel Celeron G530 and Intel Pentium G2010, both i686 Arch.
--------------------------------------
(gdb) run ash
Starting program: /tmp/bysybox/busybox ash
Program received signal SIGSEGV, Segmentation fault.
0xb7ee611d in __strcspn_sse42 () from /usr/lib/libc.so.6
(gdb) backtrace
#0 0xb7ee611d in __strcspn_sse42 () from /usr/lib/libc.so.6
#1 0x0805e760 in ?? ()
--------------------------------------
(gdb) run ipaddr
Starting program: /tmp/bysybox/busybox ipaddr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 1500 qdisc noqueue qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
Program received signal SIGSEGV, Segmentation fault.
0xb7ee63c3 in __strspn_sse42 () from /usr/lib/libc.so.6
(gdb) backtrace
#0 0xb7ee63c3 in __strspn_sse42 () from /usr/lib/libc.so.6
#1 0x0807b2ee in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Upstream busybox 1.26.2 :
--------------------------------------
(gdb) run ipaddr
Starting program: /tmp/bysybox/1.26.2/busybox ipaddr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 1500 qdisc noqueue qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
Program received signal SIGSEGV, Segmentation fault.
0xb7ee63c3 in __strspn_sse42 () from /usr/lib/libc.so.6
(gdb) backtrace
#0 0xb7ee63c3 in __strspn_sse42 () from /usr/lib/libc.so.6
#1 0x0807aebc in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
I made static build (CONFIG_STATIC=y) of upstream busybox 1.26.2, it much bigger (1.3M vs 325K binary), but works fine in initramfs, without any errors, regardless of GCC-6 or GCC-7, used for building.
Maybe the bug is inside glibc, or in gcc... The package glibc-2.25-1 was built with gcc 6
I did try to rebuild glibc-2.25-1 with gcc 7 and I do have the same crash in ../sysdeps/x86_64/multiarch/strcspn-c.c:96
Then I did the following tests (the version of busybox is not relevant) :
* busybox + Custom glibc 2.25-1 built with gcc 7.1.1-2 => Crash
* busybox + Custom glibc 2.25-2 built with gcc 7.1.1-2 => Crash
* busybox + glibc 2.25-2 (from arch repository, which was built with gcc 7) => Crash
* busybox + Custom glibc 2.25-2 built with gcc 6.3.1 => Ok
* busybox + glibc 2.25-1 (from arch repository, which was built with gcc 6) => Ok
static busybox (built with gcc 7.1.1-2 and glibc 2.25) => OK
To get a static busybox build, find the "CONFIG_STATIC" line in the "config" file and fix it to
CONFIG_STATIC = y
But glibc-2.25-2-i686 package causes segfaults not only in busybox (but VirtualBox GUI, for example, mkinitcpio-busybox is just worst case), so I will keep it rolled back to glibc-2.25-1 on i686 system.
So @Barthalion you fix a particular case, not the whole problem.
We really should create a bug report upstream, but I have no idea where is the problem (glibc or gcc) ?
Problem is only in the dynamic libc.so.6 binary from glibc-2.25-2-i686.
If time permits, I'll try to compile glibc with GCC-7 on i686 with different options and check what the segfault in __strspn_sse42 () depends on.
Just saw the comment https://bugs.archlinux.org/task/54240#comment158296 - I will test and report back asap!
@Barthalion: I've upgraded glibc to testing -> 2.25-3 with no change. I still get a kernel panic.. Do I need to upgrade any other package from testing?
mkinitcpio -P
before reboot. This build is not depend on glibc and works well.
from testing?