Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88281 - generic linuxrc causes segfaults calling umount
Summary: generic linuxrc causes segfaults calling umount
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard: >> 3.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-07 11:19 UTC by Chris Bainbridge (RETIRED)
Modified: 2005-07-17 14:39 UTC (History)
0 users

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


Attachments
linuxrc-umountfix.patch (linuxrc-umountfix.patch,2.27 KB, patch)
2005-04-07 11:21 UTC, Chris Bainbridge (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Bainbridge (RETIRED) gentoo-dev 2005-04-07 11:19:54 UTC
On a livecd, after pivot_root is called the file /etc/mtab either:

1. Doesn't exist. umount will segfault [of course, it shouldn't. It probably never checks the return status of open()]. This is the bug reported on gentoo-catalyst ml last month with the thread "LiveCD - mtab" that had unknown cause/no resolution.

2. Exists (catalyst bug - should put an empty file here, at the moment mtab is missing see bug #79218).

1 is a umount bug. 2 is a catalyst bug.

The genkernel problem at the root of this is linuxrc doing umounts after the pivot_root. After pivot_root, mtab is on a read only file system, so we can't write to it. umount -n should be used instead.
Comment 1 Chris Bainbridge (RETIRED) gentoo-dev 2005-04-07 11:21:32 UTC
Created attachment 55573 [details, diff]
linuxrc-umountfix.patch

Apply with 'epatch ${FILESDIR}/linuxrc-umountfix.patch' from
genkernel-3.1.6.ebuild.
Comment 2 Chris Bainbridge (RETIRED) gentoo-dev 2005-04-14 05:39:25 UTC
Very rarely I still see:

umount: /tmp/.initrd: device is busy
*: Failed to unmount the initrd!

Might need something extra to fix that... but it is rare.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2005-04-14 15:58:32 UTC
Hrm, the "failed to unmount" failure might possibly be caused by a race condition of some sort due to the mounts/unmounts. Strange. The fix for this bug will be in the 3.2.0 branch, if you would like it backporting to 3.1 please let me know.
Comment 4 Barry Dunn 2005-04-28 15:27:17 UTC
I've been getting these errors from a catalyst built livecd, after which it continues and boots ok:

>> Filling filesystem...
>> Booting.warning: can't open /etc/mtab: No such file or directory
Segmentation fault
*: Failed to unmount the initrd /proc!
Segmentation fault
*: Failed to unmount the initrd /sys!
..
Segmentation fault
*: Failed to unmount the initrd!
INIT: version 2.84 booting

Touching mtab with fsscript.sh only gave one less umount segmentation fault, with /dev no longer complaining, but it turns out other files are missing. In my case these errors only happen with kerncache enabled, and only after a previous build has been cached AND the kernel config hasn't changed. On rebuilding not only does mtab go missing, so does the /etc/kernels directory, the contents of /usr/share/genkernel/pkg/x86 (except the README), and in /boot, the kernel, initrd and System.map are all missing.

With kerncache removed from catalyst.conf, or the kernel config modified, all those files return and there's no errors. This is with all stable packages, using pretty basic livecd.spec files, and pkgcache and ccache enabled the whole time.

emerge --info, fwiw
Portage 2.0.51.19 (hardened/x86/2.6, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.11-hardened-r1-01 i686)
=================================================================
System uname: 2.6.11-hardened-r1-01 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 28 2005, 14:35:11)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-mcpu=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox strict"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ftp.gentoo.skynet.be/pub/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://ftp.heanet.ie/pub/gentoo/ http://gentoo.tiscali.nl/gentoo/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage//packages/x86/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage/"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow acl alsa berkdb cdr crypt curl dlloader flac gif hardened imlib mmx motif ncurses nls ogg opengl pam perl pic png python readline slang sse ssl tcpd tiff truetype userlocales vorbis x86 xml2 zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

Comment 5 Barry Dunn 2005-04-28 23:46:30 UTC
Small correction on comment #4, adding an mtab produces an extra segmentation fault on unmounting /dev, not the other way round.
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2005-07-17 14:39:29 UTC
Can you please test if this issue is still outstanding with genkernel 3.2.7; if
you are still getting problems please reopen this bug. Thanks!