Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2017 14:29:55 +1100 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Andrey Chernov <ache@freebsd.org>
Cc:        "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>, bde@freebsd.org,  current@freebsd.org
Subject:   Re: New syscons bugs: shutdown -r doesn't execute rc.d sequence and others
Message-ID:  <20170329132927.U882@besplex.bde.org>
In-Reply-To: <51045bee-a626-efb3-4b1e-0c3d36abb1ab@freebsd.org>
References:  <7d5bbbf0-6908-185c-2ee0-29e0a4f60591@freebsd.org> <D9EAB41D-CE19-4225-8868-F4AFE461F903@gmail.com> <5587c798-d36c-9074-1060-30e206db5571@freebsd.org> <69af07a7-ec8f-9b7f-8b93-9ba148f30fec@freebsd.org> <8C24D1BA-1607-4C19-BA38-39256E82C7AF@gmail.com> <51045bee-a626-efb3-4b1e-0c3d36abb1ab@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 29 Mar 2017, Andrey Chernov wrote:

> On 29.03.2017 0:46, Ngie Cooper (yaneurabeya) wrote:
>>
>>> On Mar 28, 2017, at 14:27, Andrey Chernov <ache@freebsd.org> wrote:
>>
>> =E2=80=A6
>>
>>>> Using rc_debug=3Dyes I see that it is the kernel problem, not rc probl=
em.
>>>> Sometimes rc backward sequence executed even fully, sometimes only
>>>> partly, but in unpredictable moment inside rc sequence the kernel deci=
de
>>>> to reboot quickly (or even deadly hang in rare cases). Always without
>>>> any "Syncing buffers..." leaving FS dirty. No zfs etc. just normal UFS=
,
>>>> no EFI, no GPT.
>>>> I change GELI swap to normal one, but it does not help. The same
>>>> untouched config works for years, I see this bug for the first time in
>>>> FreeBSD.
>>>
>>> I forget to mention that typescript and dmesg does not survive after
>>> this reboot (or rare hang).
>>
>> Good to note.
>> The simple explanation to the problem might be r307755, depending on whe=
n you last synced/built ^/head.
>>
>> I have a few more questions (if reverting that doesn't pan out):
>
> I just found the cause, it is new syscons bug (bde@ cc'ed). I never
> compile vt driver into kernel, i.e. I don't have this lines in the
> kernel config:
>
> device=09vt
> device=09vt_vga
> device=09vt_efifb
>
> When I add them, the bug described is gone. It seems syscons goes off to
> early, provoking reboot.

Bah, I only have vt and vt_vga to check that I didn't break them.

Unfortunately, syscons still works right when I remove these lines.

> I also find some lines of the kernel messages strange colored instead of
> white in the syscons only mode. Even in vt mode vidcontrol errors have
> invisible escapes prepended (although visible through /var/log/messages).

Kernel messages in syscons are now supposed to be colorized by CPU.  The
boot messages should show all the colors.  Shutdown and ddb are normally
done by a single random CPU, so are shown in a single random color.  The
colors are bright (light) 8-15 foreground, except bright black (8) is not
so bright.  Configure with a non-default KERNEL_SC_CONS_ATTR (maybe
yellow on black instead of lightwhite on black) to turn of the colorization=
=2E
I haven't tested this recently.  There is also a sysctl for setting all
the colors.

> Moreover, I can't enter KDB via Ctrl-Alt-ESC in the syscons only mode
> anymore - nothing happens. In the vt mode I can, but can't exit via "c"
> properly, all chars typed after "c" produce beep unless I switch to
> another screen and back.
>
> All it means that syscons becomes very broken now by itself and even
> damages the kernel operations.

Try backing out r315984 only.  This is supposed to fix parsing of output.
It switches to a state indexed by the CPU for every character, and switches
back.  Screen switching does a different switch and would fix any bug in
switching back.

But I suspect it is a usb keyboard problem.  Syscons now does almost
correct locking for the screen, but not for the keyboard, and the usb
keyboard is especially fragile, especially in ddb mode.  Console input
is not used in normal operation except for checking for characters on
reboot.

Try using vt with syscons unconfigured.  Syscons shouldn't be used when
vt is selected, but unconfigure it to be sure.  vt has different bugs
using the usb keyboard.  I haven't tested usb keyboards recently.

Bruce
From owner-freebsd-current@freebsd.org  Wed Mar 29 04:40:18 2017
Return-Path: <owner-freebsd-current@freebsd.org>
Delivered-To: freebsd-current@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC59D23204
 for <freebsd-current@mailman.ysv.freebsd.org>;
 Wed, 29 Mar 2017 04:40:18 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3])
 by mx1.freebsd.org (Postfix) with ESMTP id D4DDB67AC0
 for <freebsd-current@freebsd.org>; Wed, 29 Mar 2017 04:40:18 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: by mailman.ysv.freebsd.org (Postfix)
 id D0907D23203; Wed, 29 Mar 2017 04:40:18 +0000 (UTC)
Delivered-To: current@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D01ACD23202
 for <current@mailman.ysv.freebsd.org>; Wed, 29 Mar 2017 04:40:18 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au
 [211.29.132.42])
 by mx1.freebsd.org (Postfix) with ESMTP id 64D7D67ABE;
 Wed, 29 Mar 2017 04:40:18 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au
 [122.106.153.191])
 by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 6F9BC3C5758;
 Wed, 29 Mar 2017 15:40:15 +1100 (AEDT)
Date: Wed, 29 Mar 2017 15:40:14 +1100 (EST)
From: Bruce Evans <brde@optusnet.com.au>
X-X-Sender: bde@besplex.bde.org
To: Bruce Evans <brde@optusnet.com.au>
cc: Andrey Chernov <ache@freebsd.org>, 
 "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com>, bde@freebsd.org, 
 current@freebsd.org
Subject: Re: New syscons bugs: shutdown -r doesn't execute rc.d sequence and
 others
In-Reply-To: <20170329132927.U882@besplex.bde.org>
Message-ID: <20170329150903.T1156@besplex.bde.org>
References: <7d5bbbf0-6908-185c-2ee0-29e0a4f60591@freebsd.org>
 <D9EAB41D-CE19-4225-8868-F4AFE461F903@gmail.com>
 <5587c798-d36c-9074-1060-30e206db5571@freebsd.org>
 <69af07a7-ec8f-9b7f-8b93-9ba148f30fec@freebsd.org>
 <8C24D1BA-1607-4C19-BA38-39256E82C7AF@gmail.com>
 <51045bee-a626-efb3-4b1e-0c3d36abb1ab@freebsd.org>
 <20170329132927.U882@besplex.bde.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0
 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17
 a=kj9zAlcOel0A:10 a=ffRTqb9OHUFA3UoZTXcA:9 a=CjuIK1q_8ugA:10
X-Mailman-Approved-At: Wed, 29 Mar 2017 11:39:38 +0000
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Mar 2017 04:40:19 -0000

On Wed, 29 Mar 2017, Bruce Evans wrote:

> On Wed, 29 Mar 2017, Andrey Chernov wrote:
> ...
>> Moreover, I can't enter KDB via Ctrl-Alt-ESC in the syscons only mode
>> anymore - nothing happens. In the vt mode I can, but can't exit via "c"
>> properly, all chars typed after "c" produce beep unless I switch to
>> another screen and back.
>> 
>> All it means that syscons becomes very broken now by itself and even
>> damages the kernel operations.
>
> ...
> But I suspect it is a usb keyboard problem.  Syscons now does almost
> correct locking for the screen, but not for the keyboard, and the usb
> keyboard is especially fragile, especially in ddb mode.  Console input
> is not used in normal operation except for checking for characters on
> reboot.
>
> Try using vt with syscons unconfigured.  Syscons shouldn't be used when
> vt is selected, but unconfigure it to be sure.  vt has different bugs
> using the usb keyboard.  I haven't tested usb keyboards recently.

I tested usb keyboards again.  They sometimes work, much the same as
a few months ago after some fixes:
- after booting with -d, they never work (give no input) at the ddb
   prompt with either sc or vt.  usb is not initialized then, and no usb
   keyboard is attached to sc or vt
- after booting without loader with -a, sc rarely or never works (gives
   no input) at the mountroot prompt
- after booting with loader with -a, vt works at the mountroot prompt.
   I don't normally use loader but need to use it to change the configuration.
   This might be better than before.  There used to be a screen refresh bug.
- after booting with loader with -a, sc works at the mountroot prompt too.
   I previously debugged that vt worked better because it attaches the keyboard
   before this point, while sc attaches it after.  Booting with loader
   apparently fixes the order.
- after any booting, sc works for user input (except sometimes after a
   too-soft hard reset, the keyboard doesn't even work in the BIOS, and it
   takes unplugging the keyboard to fix this)
- after almost any booting, vt doesn't work for user input (gives no input).
   However, if ddb is entered using a serial console, vt does work!  A few
   months ago, normal input was fixed by configuring kbdmux (the default in
   GENERIC).  It is not fixed by unplugging the keyboard.  kbdmux has a known
   bug of not doing nested switching for the keyboard state.  Perhaps this
   "fixes" ddb mode.  But I would have expected it to break ddb mode.
- I didn't test sc after entering ddb, except early when it doesn't work.

The above testing is with a usb keyboard, no ps/2 keyboard, and no kbdmux.
Other combinations and dynamic switching move the bugs around, and a
serial console is needed to recover in cases where the bugs prevent any
keyboard input.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170329132927.U882>