[comp.windows.x] problems with keyboard after server crash

ndd@romeo.cs.duke.edu (Ned D. Danieley) (03/15/89)

I'm trying to debug an application which occasionally crashes,
taking the server with it. When this happens, the keyboard is
left in an unuseable state. I've tried kbd_mode -a: 

	1) by logging in from another machine

	2) by putting the following in my startup script:
		xinit ...
		kbd_mode -a
	
	3) by putting the following in my startup script:
		xinit ...; kbd_mode -a

None of these work: I have to reboot the machine to reset the
keyboard. (I've also tried the other options to kbd_mode; none
of them work, either.)

Has anyone seen this behaviour? How can I gracefully reset my
keyboard?

Sun 3/280 running SunOs 3.5
X11R3, patches 1-8, purdue 2.0 speedups, gcc 1.33

Ned Danieley (ndd@sunbar.mc.duke.edu)
Basic Arrhythmia Laboratory
Box 3140, Duke University Medical Center
Durham, NC  27710
(919) 684-6807 or 684-6942

meo@stiatl.UUCP (Miles O'Neal) (03/16/89)

In article <13862@duke.cs.duke.edu> ndd@romeo.cs.duke.edu (Ned D. Danieley) writes:
-I'm trying to debug an application which occasionally crashes,
-taking the server with it. When this happens, the keyboard is
-left in an unuseable state. I've tried kbd_mode -a: 
   (list of nonworking attempts to fix was here)
-Has anyone seen this behaviour? How can I gracefully reset my
-keyboard?
-
-Sun 3/280 running SunOs 3.5
-X11R3, patches 1-8, purdue 2.0 speedups, gcc 1.33

Two possibilities:

login as yourself or rrot from elsewhere; run kbd_mode -a with
std<in, out & err> all going to the keyboard device. Seems like this
used to work when we tried it.

What we do now is: run a script that brings up X11; in this script we
set an environment variable (eg, XWINDOWS_UP); then we run xinit to
bring up a CONSOLE xterm. Our .cshrc files contain
the following code:

if ($?XWINDOWS_UP) then
	unsetenv XWINDOWS_UP
	source .xwindows
endif

The above code should get run only the 1 time (that the xinit is run, starting
the console xterm).

The .xwindows file looks something like:

setenv xterm
set T = "`hostname` : `whoami` - `echo $cwd`"
if (-f ~meo/.4term_hist) then
        source ~meo/.4term_hist
endif
xset m 4 2 
xset s noblank 
xset s 600 30 
xterm -title "$T" -fn a14 -geometry 80x56+5+5 -rw -s &
xterm -title "$T" -fn a14 -geometry 80x36+575+5 -rw -s &
xclock -chime -geometry 110x110+1035+785 -rv &
if (! $?remote) then
        xmodmap -e "keycode 0x39 = Delete KP_Decimal"
        xmodmap -e "keycode 0x65 = Insert KP_0"
endif
exit
#
#       The xmodmaps should be used ONLY on Sun 386i's running Sun's X11R2.
#
#       User cust. stuff, such as xsetroot, etc, should also go in here

notes:
1) xterm is used in the .cshrc file to determine when to set the term
   variable to xterm (vs when you might be using real terminals, the
   Sun console, etc).
2) remote is set when coming in from an X11 display terminal, so that
   the Sun modmaps won't happen.


-Miles (gatech!stiatl!meo)

ndd@romeo.cs.duke.edu (Ned D. Danieley) (03/16/89)

In article <13862@duke.cs.duke.edu>, ndd@romeo.cs.duke.edu (Ned D. Danieley) writes:
> I'm trying to debug an application which occasionally crashes,
> taking the server with it. When this happens, the keyboard is
> left in an unuseable state. I've tried kbd_mode -a: 
> 

Thanks to tadguy@cs.odu.edu, I now have more info. It appears to
not be a kbd_mode problem (or, at least, not entirely). I had a
screensaver program in the way; when I removed it, I saw that I
was getting four or five login messages, followed by 'getty failing,
sleeping'. It seems that something is sending characters to the
console. I've been able to get around this problem by killing getty
on the console, connecting to the console with kermit, exiting kermit,
and then restarting getty. It's not clear why this works, but it
seems to. Obviously, I'd like to avoid having to do this; surely
the server should be exiting more gracefully.

Has anyone else seen this kind of problem?


Ned Danieley (ndd@sunbar.mc.duke.edu)
Basic Arrhythmia Laboratory
Box 3140, Duke University Medical Center
Durham, NC  27710
(919) 684-6807 or 684-6942

yerneni@pdn.nm.paradyne.com (Prasad Yerneni) (03/17/89)

In article <13881@duke.cs.duke.edu>, ndd@romeo.cs.duke.edu (Ned D. Danieley) writes:
> In article <13862@duke.cs.duke.edu>, ndd@romeo.cs.duke.edu (Ned D. Danieley) writes:
> > I'm trying to debug an application which occasionally crashes,
> > taking the server with it. When this happens, the keyboard is
> > left in an unuseable state. I've tried kbd_mode -a: 
> > 
> Has anyone else seen this kind of problem?
> 
> Ned Danieley (ndd@sunbar.mc.duke.edu)

I seem to be having the same problem with the Sun server (X11V3).
However, the problem occassionly occurs even when the server exits
normally (i.e., I type "exit" at the xterm prompt). 
All I get is a bunch of control characters when I type something.
Killing my login shell doesn't help either.  I have to boot my workstation
to correct the problem.

Any better solutions?

prasad.
-- 
AT&T-Paradyne 			UUCP: yerneni@pdn.nm.paradyne.com
PO Box 2826
Largo, Fl 34649