Bug 13002

Summary: attempt to switch to console from snes9x/X11 fullscreen mode locks syscons
Product: Base System Reporter: lcremeans <lcremeans>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-STABLE   
Hardware: Any   
OS: Any   

Description lcremeans 1999-08-06 16:20:00 UTC
When I use snes9x in its fullscreen mode (which uses XFree86 DGA and
VME), and try to switch from X to the console while fullscreen is 
enabled, syscons completely locks up -- I can't switch back to the 
console even after quitting snes9x and restarting X. Only a reboot 
resets it.

How-To-Repeat: Run snes9x with the -y switch (you have to be root or have snes9x setuid
for this to work, since it wants /dev/mem), then switch to fullscreen mode
with PrtSc, try to switch to console 1 (Ctrl-Alt-F1), then quit snes9x and 
try again -- it'll refuse to work.
Comment 1 lcremeans 1999-08-06 16:28:12 UTC
It's worse than I thought. Apparently, trying to restart X (with 
Ctrl-Alt-Backspace) leaves me stuck in the FUBAR'd syscons -- only sane thing
that works is Ctrl-Alt-Del. :/ 

-lee
Comment 2 yokota 1999-08-07 00:52:45 UTC
>>Number:         13002
>>Category:       kern
>>Synopsis:       attempt to switch to console from snes9x/X11 fullscreen mode 
>locks syscons
[...]
>>Release:        3.2-STABLE
>>Organization:
>>Environment:
>FreeBSD lcremeans.erols.com 3.2-STABLE FreeBSD 3.2-STABLE #1: Tue Jun 29 18:02
>:52 EDT 1999     lee@lcremeans.erols.com:/usr/src/sys/compile/CURRENT  i386
>XFree86 3.3.3.1, SVGA server, Matrox G200 AGP with 8MB
>snes9x 1.19 (from ports)
>>Description:
>When I use snes9x in its fullscreen mode (which uses XFree86 DGA and
>VME), and try to switch from X to the console while fullscreen is 
>enabled, syscons completely locks up -- I can't switch back to the 
>console even after quitting snes9x and restarting X. Only a reboot 
>resets it.

First, I would like to point out that when the X server is running, it
is the X server which is in control of vt switching, not syscons.
Therefore, when you are unable to switch from the X server to a text
vty, it means that the X server is somehow refusing vt switching;
syscons can do nothing in this situation.

However, you seem to be having difficulty even after you quit snes9x.
Would you describe some more details?  When you quit snes9x, do you
also quit the X server and drop to the text console from which you
started the X server and snes9x?

>>How-To-Repeat:
>Run snes9x with the -y switch (you have to be root or have snes9x setuid
>for this to work, since it wants /dev/mem), then switch to fullscreen mode
>with PrtSc, try to switch to console 1 (Ctrl-Alt-F1), then quit snes9x and 
>try again -- it'll refuse to work.

What is actually happening when you say "it'll refuse to work"?

What if you do NOT hit Ctl-Alt-F1 while snes9x is running and quit
snes9x and the X server?

Kazu
Comment 3 lcremeans 1999-08-07 01:13:35 UTC
On Sat, Aug 07, 1999 at 08:52:45AM +0900, Kazutaka YOKOTA wrote:

> First, I would like to point out that when the X server is running, it
> is the X server which is in control of vt switching, not syscons.
> Therefore, when you are unable to switch from the X server to a text
> vty, it means that the X server is somehow refusing vt switching;
> syscons can do nothing in this situation.

All righty...

> However, you seem to be having difficulty even after you quit snes9x.
> Would you describe some more details?  When you quit snes9x, do you
> also quit the X server and drop to the text console from which you
> started the X server and snes9x?

When I quit snes9x and shut down X in this case, I go to the console, but
xdm never restarts and there's a field of white-on-blue garbage covering the
bottom half to 3/4 of the screen. Keys seem to work (I was able to use
Ctrl-Alt-Del), but you can't see anything.

> >>How-To-Repeat:
> >Run snes9x with the -y switch (you have to be root or have snes9x setuid
> >for this to work, since it wants /dev/mem), then switch to fullscreen mode
> >with PrtSc, try to switch to console 1 (Ctrl-Alt-F1), then quit snes9x and 
> >try again -- it'll refuse to work.
> 
> What is actually happening when you say "it'll refuse to work"?

It'll refuse to switch back to the console -- it's like the key combination
is being ignored.

> What if you do NOT hit Ctl-Alt-F1 while snes9x is running and quit
> snes9x and the X server?

In this case, everything works fine; I can switch back to the vty with no
trouble, and also restart X without it getting stuck.

-lee

-- 
+--------------------------------------------------------------------+
|      Lee Cremeans -- Manassas, VA, USA  (WakkyMouse on WTnet)      |  
|         lcremeans@erols.com | http://wakky.dyndns.org/~lee         |
Comment 4 yokota 1999-08-07 05:06:53 UTC
>> However, you seem to be having difficulty even after you quit snes9x.
>> Would you describe some more details?  When you quit snes9x, do you
>> also quit the X server and drop to the text console from which you
>> started the X server and snes9x?
>
>When I quit snes9x and shut down X in this case, I go to the console, but
>xdm never restarts and there's a field of white-on-blue garbage covering the
>bottom half to 3/4 of the screen. Keys seem to work (I was able to use
>Ctrl-Alt-Del), but you can't see anything.
>
>> >>How-To-Repeat:
>> >Run snes9x with the -y switch (you have to be root or have snes9x setuid
>> >for this to work, since it wants /dev/mem), then switch to fullscreen mode
>> >with PrtSc, try to switch to console 1 (Ctrl-Alt-F1), then quit snes9x and 
>> >try again -- it'll refuse to work.
>> 
>> WHAT is actually happening when you say "it'll refuse to work"?
>
>It'll refuse to switch back to the console -- it's like the key combination
>is being ignored.
>
>> What if you do NOT hit Ctl-Alt-F1 while snes9x is running and quit
>> snes9x and the X server?
>
>In this case, everything works fine; I can switch back to the vty with no
>trouble, and also restart X without it getting stuck.

Hmm, I am beginning to wonder if the X server does try to switch to
vty when you hit Ctl-Alt-F1, but then, changes mind in the middle of
switching process and leaves syscons in an arbitrary state.
(It's possible that we cannot switch to a vty when the X client
is using the XF86 DGA extention.)

There is a protocol to follow to switch vtys. Under normal
circumstances the X server and syscons cooperates to activate a text
vty, according to this protocol.  I suspect that somehow the X server
may be stepping out of this protocol in your case.

I will send you a patch to syscons, so that we can get some more
information during the vty switching.

Kazu
Comment 5 yokota freebsd_committer freebsd_triage 1999-08-22 11:32:57 UTC
State Changed
From-To: open->closed

Fix is committed to -STABLE (syscons.c 1.293.2.7).