Bug 37479

Summary: mouseconfig segfaults if /dev/mouse is set to ttyS0 and X is not configured.
Product: [Retired] Red Hat Linux Reporter: Panic <mdrew>
Component: mouseconfigAssignee: Matt Wilson <msw>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: low    
Version: 7.1CC: acyr54, ccleary, ponytail, uwe
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-04-24 20:48:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Panic 2001-04-24 20:28:23 UTC
mouseconfig segfaults if /dev/mouse points to ttyS0 (1,2,...), X is not
configured, and no mouse is present.  If the soft link is returned to psaux
manually, mouseconfig runs normally again.

Reproducible: Always (the 3 times I tested it)

Steps to reproduce:

1.  Run mouseconfig, and choose a Generic Mouse on ttyS0 (with no mouse
present, simulating user confusion over which serial port the mouse is
plugged into). 

2.  Select No when asked to make the XF86Config changes.

3.  mouseconfig exits.  note the symlink /dev/mouse -> /dev/ttyS0, but
/etc/sysconfig/mouse looks like this:

MOUSETYPE="Microsoft"
XMOUSETYPE="Microsoft"
FULLNAME="Generic Mouse (serial)"
XEMU3=yes
DEVICE=/dev/mouse

4.  Running mouseconfig again gives this error (across the top of the screen):

mouseconfig: line 5 unexpected in /etc/sysconfig/mouse

And the box shows:

There was an error reading the file /etc/sysconfig/mouse.  Would you like
to proceed in creating a new configuration?

5.  Hit OK.  This presents you with a choice of serial mice.  Choosing
another mouse again results in the same behavior (probably because of the
missing mouse).

6.  The problem comes when you try to get back to using a PS/2 mouse. 
Since mouseconfig no longer gives you the option to choose a PS/2 mouse (or
anything else) you delete /etc/sysconfig/mouse and...

7.  Run mouseconfig again, which tries to probe for a mouse and then
segfaults when it can't find one.

Results:

This seems to result from mouseconfig checking to see where /dev/mouse is
pointing, and then presenting you with options that apply there (apparently
all options apply to PS/2 mice).  If /dev/mouse is pointed to a serial port
without a mouse, mouseconfig cannot handle that situation and either
segfaults or presents with the error and won't allow you to switch back to
/dev/psaux.

Expected behavior:

The expected behavior would be for mouseconfig to allow you to choose your
mouse, and set up /dev/mouse, /etc/sysconfig/mouse, and the XF86Config file
accordingly.

Comment 1 Panic 2001-04-24 20:30:43 UTC
small addendum:  If /etc/sysconfig/mouse does not exist, mouseconfig continues
to segfault until you touch or otherwise re-create the file.

Comment 2 Panic 2001-04-24 20:48:08 UTC
another small addition:  Now my mouseconfig doesn't work at all (/dev/mouse ->
/dev/psaux, /etc/sysconfig/mouse exists but is empty).  I tried cleaning out
everything I could find -- the symlink, the /etc/sysconfig/mouse file, and the
XF86Config-4. Still no go.  I love test boxes...

Comment 3 Panic 2001-07-27 22:05:04 UTC
This should've been fixed by the 7.1 mouseconfig errata.  Closing - Errata.