Bug 155028 - init(8): "init q" in single user causes segfault
Summary: init(8): "init q" in single user causes segfault
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2011-02-25 14:00 UTC by Matthias Andree
Modified: 2015-10-25 21:33 UTC (History)
1 user (show)

See Also:
ngie: mfc-stable10-
ngie: mfc-stable9-
ngie: mfc-stable8-


Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Andree freebsd_committer 2011-02-25 14:00:24 UTC
"init q" in single-user mode causes init to segfault, and subsequently
the kernel to panic (..."going nowhere without my init")

How-To-Repeat: boot into single-user at loader prompt
enter root /bin/sh
type "init q" and press enter
Comment 1 Jaakko Heinonen freebsd_committer 2011-06-08 15:30:39 UTC
State Changed
From-To: open->patched

I was able to reproduce this on 8.2-RELEASE but not on 9.0-CURRENT. 
I guess that this has been fixed in r217750.
Comment 2 Matthias Andree freebsd_committer 2011-06-08 15:52:49 UTC
Comment 3 Jilles Tjoelker freebsd_committer 2011-07-03 17:48:58 UTC
> [r217750 fixes segfault on "init q" in single user]

Commit r217750 certainly fixes that segfault (deliberately) but also
makes it such that /etc/rc.shutdown is not executed if /etc/rc was not
finished. That change fixes some things (like losing mixer settings when
using shutdown or ctrl+alt+del from single user) but might also break

Perhaps it is indeed safe enough.

Jilles Tjoelker
Comment 4 Enji Cooper freebsd_committer 2015-10-25 21:33:01 UTC
The symptom noted in the description can no longer be hit as noted in comment # 1 and comment # 3. Closing this bug even though the commit was not MFCed because 8.x has been EOLed.

Please open a new bug for the item noted in comment # 3 if you believe it /etc/rc.shutdown should be run again if `init q` is interrupted -- although, I personally think the problem is that certain scripts like mixer need to be taught to do the right thing each time they're stopped instead of going and corrupting state.