|
Bugzilla – Full Text Bug Listing |
| Summary: | /init crashes in initramfs | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Hannes Reinecke <hare> |
| Component: | Kernel | Assignee: | Hannes Reinecke <hare> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Critical | ||
| Priority: | P5 - None | CC: | ihno |
| Version: | Beta 4 | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Development | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
screenlog.1
init screenlog.2 |
||
|
Description
Hannes Reinecke
2005-09-07 06:54:24 UTC
Created attachment 49014 [details]
screenlog.1
Logfile captured from serial console. Doesn't show everything, I'm afraid, as
the kernel panic occured before everything was flushed.
Created attachment 49015 [details]
init
/init script used within the initramfs
Created attachment 49016 [details]
screenlog.2
Full screenlog; most clutter removed.
This seems to be the relevant part: this shell closes its sourcefile when it
sources dhcpcd-eth0.info.
open("/init.real", O_RDONLY) = 3
dup2(3, 10) = 10
read(10, "#! /bin/sh\n\nexport PATH=/sbin:/u"..., 4088) = 4088
open("/var/lib/dhcpcd/dhcpcd-eth0.info", O_RDONLY) = 3
dup2(3, 10) = 10
[...original fd 10 now and not saved anywhere...]
close(3) = 0
read(10, "IPADDR=10.10.101.227\nNETMASK=255"..., 4088) = 657
read(10, "", 4088) = 0
close(10) = 0
[...some more temporary use of fd 10, eventually closing it again...]
read(10, 0x528680, 4088) = -1 EBADF (Bad file descriptor)
Yep. there is a bug in /lib/klibc/bin/sh; dup2() will close the destination fd if already open. One should use fcntl() to always get a new free fd. Raising priority as this potentially affects all installations. Fixed klibc submitted to stable. Just use dup() instead of dup2() closed. |