# cd / # sh -x mkinitrd /boot/initrd-2.6.4-1.303custom.img 2.6.4-1.303 ... + TMPDIR= + '[' '!' -d /tmp ']' + echo access -w /tmp + /sbin/nash --quiet mkinitrd: line 305: 2702 Done echo access -w $t 2703 Segmentation fault | /sbin/nash --quiet + continue + '[' '!' -d /var/tmp ']' + echo access -w /var/tmp + /sbin/nash --quiet mkinitrd: line 305: 2704 Done echo access -w $t 2705 Segmentation fault | /sbin/nash --quiet + continue + '[' '!' -d /root ']' + echo access -w /root + /sbin/nash --quiet mkinitrd: line 305: 2706 Done echo access -w $t 2707 Segmentation fault | /sbin/nash --quiet + continue + '[' '!' -d / ']' + echo access -w / + /sbin/nash --quiet mkinitrd: line 305: 2708 Done echo access -w $t 2709 Segmentation fault | /sbin/nash --quiet + continue + '[' -z '' ']' + echo 'no temporary directory could be found' no temporary directory could be found + exit 1 # strace /sbin/nash --quiet execve("/sbin/nash", ["/sbin/nash", "--quiet"], [/* 51 vars */]) = 0 getppid() = 2719 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ # rpm -qf /sbin/nash mkinitrd-3.5.19-1
This works OK under 2.6.4-1.305, but does not work under 2.6.4-1.303 (or at least in SELinux enforcing mode). Weird...
I can not reroduce it under kernel 2.6.4-1.305, and under 2.6.4-1.303 (where I saw it) a lot of weird things were happening. Should this be considered a kernel-related bug that was already fixed and be closed, or are you interested in trying to investigate it further?
I'm going to guess "bogon kernel" -- if it happens in something newer, could you reopen?
I got similar bug running nash(initrd) in User Mode Linux environment. mkinitrd-3.5.19 I used Linux + uml patch - v2.6.6. My general kernel is FC2 derived (kernel 2.6.3-2.1.253) I found such dependencies. If I compile nash against dynamic libc library it works without segfault. It crashes when it is linked statically against dietlibc library. FYI GDB output: Program received signal SIGSEGV, Segmentation fault. 0xa0290b68 in ?? () (gdb) bt #0 0xa0290b68 in ?? () #1 0x0804c740 in __unified_syscall () at i386/unified.S:46 [\u@\h \W]$ strace /bin/nash.static execve("/bin/nash.static", ["/bin/nash.static"], [/* 26 vars */]) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++trace output:
I've also met this bug in User Mode Linux (both UML and host has 2.6.8.1 kernel, Fedora Core 2 was used on both UML and Host)
UML doesn't support NPTL yet and isn't expected to work with a FC2 userland