Bug 192248 - [vt] panic in vtbuf_fill_locked from vt_upgrade with no vt(4) drivers attached
Summary: [vt] panic in vtbuf_fill_locked from vt_upgrade with no vt(4) drivers attached
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: vt
Depends on:
Blocks:
 
Reported: 2014-07-29 19:01 UTC by Ed Maste
Modified: 2014-10-20 12:49 UTC (History)
1 user (show)

See Also:


Attachments
vtterm_cnprobe: Only recompute term size if screen size != 0 (568 bytes, patch)
2014-10-04 11:25 UTC, Jean-Sébastien Pédron
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2014-07-29 19:01:43 UTC
** I have no early vt(4) driver:
VT: init without driver.

** My WIP vt(4) fb driver fails to attach:
terasic_mtl0: Failed to attach fbd device

** Later vt_upgrade gets called and panics:
panic: vtbuf_fill_locked begin.tp_row 0 must be < screen height 0
cpuid = 0
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at      kdb_enter+0x8c: lui     at,0x0
db> bt
Tracing pid 0 tid 100000 td 0xffffffff80729c20
db_trace_thread+40 (?,?,?,?) ra ffffffff80117514 sp 98000000007c5ca0 sz 32
ffffffff80117388+18c (ff0000,?,ffffffff,?) ra ffffffff801165f0 sp 98000000007c5cc0 sz 64
ffffffff80116168+488 (?,?,?,?) ra ffffffff801168bc sp 98000000007c5d00 sz 224
db_command_loop+f4 (?,?,?,?) ra ffffffff8011a2c8 sp 98000000007c5de0 sz 32
ffffffff8011a120+1a8 (?,?,?,?) ra ffffffff802e3e10 sp 98000000007c5e00 sz 832
kdb_trap+1f0 (?,?,?,?) ra ffffffff80515bb0 sp 98000000007c6140 sz 64
trap+10d8 (?,?,?,?) ra ffffffff804ff34c sp 98000000007c6180 sz 320
MipsKernGenException+168 (0,0,80582490,aa) ra ffffffff802e3944 sp 98000000007c62c0 sz 448
kdb_enter+8c (?,?,?,?) ra ffffffff80293800 sp 98000000007c6480 sz 32
ffffffff80293550+2b0 (?,?,?,?) ra ffffffff80293930 sp 98000000007c64a0 sz 32
kassert_panic+c8 (?,0,0,107b3ac) ra ffffffff80186fd4 sp 98000000007c64c0 sz 128
vtbuf_fill_locked+54 (?,?,?,?) ra ffffffff80188ddc sp 98000000007c6540 sz 64
ffffffff80188dc8+14 (?,?,?,?) ra ffffffff802fc28c sp 98000000007c6580 sz 32
terminal_set_winsize_blank+1bc (?,?,?,?) ra ffffffff802fc2e0 sp 98000000007c65a0 sz 96
terminal_set_winsize+28 (?,?,?,?) ra ffffffff80189654 sp 98000000007c6600 sz 32
vt_upgrade+194 (?,?,?,?) ra ffffffff802231dc sp 98000000007c6620 sz 160
mi_startup+20c (?,?,?,?) ra ffffffff8010026c sp 98000000007c66c0 sz 32
_start+dc (?,?,?,?) ra 0 sp 98000000007c66e0 sz 0
pid 0
db>

presumably vt_upgrade needs to detect the case that only the dummy driver exists, and do nothing
Comment 1 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-10-04 11:25:58 UTC
Created attachment 147965 [details]
vtterm_cnprobe: Only recompute term size if screen size != 0

I see that there's no vt(4) driver built into RPI-B kernel configuration, therefore, the screen size is unknown (and set to 0).

Could you please try the attached patch?
Comment 2 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2014-10-04 11:27:00 UTC
Oops, sorry, I added the patch to the wrong bug report... I meant to do this in 193981 :)
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-17 13:55:54 UTC
A commit references this bug:

Author: emaste
Date: Fri Oct 17 13:55:46 UTC 2014
New revision: 273219
URL: https://svnweb.freebsd.org/changeset/base/273219

Log:
  Do nothing in vt_upgrade if there is no vt driver

  Previously, if no drivers attached at boot we would panic with
  "vtbuf_fill_locked begin.tp_row 0 must be < screen height 0".

  PR:		192248
  Reviewed by:	ray
  MFC after:	3 days
  Sponsored by:	DARPA, AFRL
  Differential Revision: https://reviews.freebsd.org/D954

Changes:
  head/sys/dev/vt/vt_core.c
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-10-20 01:02:14 UTC
A commit references this bug:

Author: emaste
Date: Mon Oct 20 01:01:55 UTC 2014
New revision: 273296
URL: https://svnweb.freebsd.org/changeset/base/273296

Log:
  MFC r273219: Do nothing in vt_upgrade if there is no vt driver

    Previously, if no drivers attached at boot we would panic with
    "vtbuf_fill_locked begin.tp_row 0 must be < screen height 0".

  PR:		192248

Changes:
_U  stable/10/
  stable/10/sys/dev/vt/vt_core.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-10-20 03:18:24 UTC
A commit references this bug:

Author: emaste
Date: Mon Oct 20 03:17:49 UTC 2014
New revision: 273300
URL: https://svnweb.freebsd.org/changeset/base/273300

Log:
  MFS10 r273296 (r273219 in HEAD):

    Do nothing in vt_upgrade if there is no vt driver

    Previously, if no drivers attached at boot we would panic with
    "vtbuf_fill_locked begin.tp_row 0 must be < screen height 0".

  PR:		192248
  Approved by:	re

Changes:
_U  releng/10.1/
  releng/10.1/sys/dev/vt/vt_core.c