Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256979 - sys-fs/openrc-0.4.2 - /sbin/rc segfaults on empty /dev
Summary: sys-fs/openrc-0.4.2 - /sbin/rc segfaults on empty /dev
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-30 19:54 UTC by Dennis Schridde
Modified: 2009-10-11 09:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/init script (init.sh,675 bytes, text/plain)
2009-01-30 19:55 UTC, Dennis Schridde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2009-01-30 19:54:37 UTC
I wiped my /dev directory, and am populating it on bootup using (busybox) "mdev -s" (using the attached /init script). Apparently some device nodes are missing for /sbin/rc, which makes it segfault.

The output is:
rc[729] segfault at 0 ip 400b65a sp 7fff8dc68430 error 4 in rc[400000+19000]
(I guess most of this line is quite useless to you, but maybe one of those numbers contains a hint for you, which I may not spot.)

While I admit that having /dev nearly empty is quite a crazy action, I would like openrc to output an error message like "unable to open /dev/important, aborting boot".

Reproducible: Always
Comment 1 Dennis Schridde 2009-01-30 19:55:33 UTC
Created attachment 180313 [details]
/init script
Comment 2 Dennis Schridde 2009-01-30 19:58:43 UTC
PS: I just tested: Even when /dev is not unmounted before switching root, I assume that the /dev directory is not accessible by /sbin/rc after switching root. So openrc is probably always left with an entirely empty /dev when using my script.
I now wonder why it is not populated using udev, or similar.
Comment 3 Matthias Schwarzott gentoo-dev 2009-01-31 09:36:55 UTC
What you have is a shell-script part of an initramfs. It does switch root at the end. So /dev will be empty in this root, as you do not copy over /dev from the tmpfs.

So your final system should call any dev manager (e.g. udev or mdev) or will have no device nodes.
So you should make sure you have udev added to sysfs runlevel.

About that segfault you should create a backtrace, but no idea how to easily do it. But I guess you should at least compile openrc with debug information.
Maybe someone can at least tell you how to find out the source line from the ip value.
Or if $root is rw, maybe you can force the kernel to write a core-dump.
Comment 4 Roy Marples 2009-04-23 20:48:31 UTC
I'll need a backtrace to fix this
Comment 5 SpanKY gentoo-dev 2009-10-11 09:35:21 UTC
or just create a qemu vhost ...