Bug 168076

Summary: gpm is blocking mc sometimes
Product: [Fedora] Fedora Reporter: Gerwin Krist <gerwinkrist>
Component: gpmAssignee: Tomas Janousek <tjanouse>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dmitry, hdegoede, leonard-rh-bugzilla, milan.kerslager, rudolf.ulc
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gpm-1.20.1-80 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-22 07:29:53 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Gerwin Krist 2005-09-12 03:15:45 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

Description of problem:
Sometime mc can't start because of a gpm socket blocking. 
When it happens again, i will include a strace.

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
Not reproducable

Actual Results:  blank screen appears but no mc

Expected Results:  mc appearing

Additional info:

stopping gpm service will "solve" the problem.
Comment 1 Gerwin Krist 2005-09-12 03:23:18 EDT
*** Bug 168077 has been marked as a duplicate of this bug. ***
Comment 2 Jindrich Novy 2005-09-12 03:29:11 EDT
I haven't seen such behaviour of mc so far, so please include strace, your mc
and gpm versions. Also a test case, when this happens every time would be good
to let me reproduce it.
Comment 3 Gerwin Krist 2005-09-12 04:26:16 EDT
All my colleagues do have these problems. I only saw it on desktop usage so far.
As stated in my first post, I will include a strace when it hangs again :)

Versions:
mc-4.6.1a-0.11.FC4
gpm-1.20.1-71
Comment 4 Jindrich Novy 2005-09-26 10:20:38 EDT
Seems like it turned stable after you reported the bug here ;)
[still waiting for a strace]
Comment 5 Gerwin Krist 2005-10-10 09:14:09 EDT
He I finally got it again :) Here are the last strace lines, it keeps hanging on
the /dev/gpmctl. After shutting down gpm mc starts up again :)

readlink("/proc/self/fd/0", "/dev/pts/10", 4095) = 11
open("/dev/pts/10", O_WRONLY)           = 5
ioctl(5, TIOCGWINSZ, {ws_row=55, ws_col=155, ws_xpixel=0, ws_ypixel=0}) = 0    
                                                                               
                              socket(PF_FILE, SOCK_STREAM, 0)         = 6
connect(6, {sa_family=AF_FILE, path="/dev/gpmctl"}, 13
Comment 6 Jindrich Novy 2005-10-10 09:18:55 EDT
Ok, seen a similar problem recently. Just killing gpm before mc solves the
problem for me. However, this seems more like gpm problem IMO.
Comment 7 Milan Kerslager 2005-11-11 06:37:13 EST
The problem is reproducible when gpm is running, user is logged to X Window and
the same user is trying to run mc via ssh connection.

I just restarted gpm when gpm hanged and now I'm not able to reproduce so some
other action should be made (mabe logout/login to the X or so).
Comment 8 Milan Kerslager 2005-11-11 06:48:27 EST
*** Bug 163061 has been marked as a duplicate of this bug. ***
Comment 9 Milan Kerslager 2005-11-11 06:58:09 EST
Bug #172921 has been opened for this gpm bug (under RHEL4 so this may be better
to open the same bug for FC4 or for upcoming FC5).
Comment 10 Jindrich Novy 2005-11-16 09:11:07 EST
Ok, gpm dependency removed and mc is no more compiled with gpm support since
mc-4.6.1a-0.15.FC4.
Comment 11 Fedora Update System 2005-11-16 13:49:51 EST
From User-Agent: XML-RPC

mc-4.6.1a-0.15.FC4 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 12 Dmitry Butskoy 2005-11-21 09:43:10 EST
(for comment #10):

Jindrich,

I had the same issue as in comment #7 . Invoking mc with `-d' option solves this
issue ("mc -d" -- disable gpm at runtime).

As actually for most Fedora users "mc" is an alias for
/usr/share/mc/bin/mc-wrapper.sh, it looks more easy and correct just to add `-d'
option somewhere in that script, rather than disable gpm completely at compile
time...
Comment 13 Jindrich Novy 2005-12-01 06:02:28 EST
Dmitry, thanks for the comment, maybe fixing the wrapper scripts would cause
less pain to users that still want to use the mc with the gpm support enabled.
Comment 14 Jindrich Novy 2005-12-01 07:54:34 EST
The problem is that the -d option disables the mouse support completely what we
don't want. We need to disable only the mouse support for gpm and mc doesn't
have an option for that. It's bad as the xterm mouse support works fine on
gnome-terminal/xterm/konsole but -d disables it completely. The only effect of
the disabled gpm is that mouse services won't work on text console.
Comment 15 Dmitry Butskoy 2005-12-01 08:31:46 EST
Well,

What about something like:

[ -n "$DISPLAY" ] && opts="-d"

in the wrapper script?
Comment 16 Dmitry Butskoy 2005-12-01 08:42:26 EST
Typo... :)

[ -z "$DISPLAY" ] && opts="-d"

Comment 17 Hans de Goede 2005-12-01 09:07:01 EST
That won't help if you ssh to a machine from xterm then xterm support will still
work, but DISPLAY won't be set you could however test for TERM==xterm.
Comment 18 Hans de Goede 2005-12-01 09:19:54 EST
As discussed in bug 168076 I've done a localbuild of mc with gpm support
reanbled and now I've tried recreating the problem as described in bug 163061:
-start pc with gdm and gpm (runlevel 5)
-log into gdm as hans
-log into console as hans
-start mc, starts fine, mouse works fine
-ssh to localhost as hans
-start mc, the following message is printed over mc's screen:
 --
 *** info [lib/liblow.c(458)]:
 EditWarning: closing connection
 --
 and the mouse works as if mc has been compiled without gpmsupport, iow
 you can select parts of the screen but not control mc.
-as root from another console do: service restart gpm
-start mc again in the ssh session now the message is:
 *** warning [client.c(183)]: Failed gpm connect attempt by uid 500 for vc 0
 *** info [lib/liblow.c(458)]:
 EditWarning: closing connection

So I believe that this bug is now fixed somehow. Notice that since the version
used by the reporter of this bug (4.6.1a-0.11) a lott of syncs with upstream
have been done, so most likely this has been fixed / worked around upstream.
Comment 19 Hans de Goede 2005-12-01 09:33:51 EST
Some more digging has gotten some new insight, the messages shown I've reported
in comment #18 are actually gpm and/or libgpm messages, so probably this is
fixed in a newer gpm.
Comment 20 Petr Rockai 2006-02-14 03:48:34 EST
I have been digging around in this bug, but could not figure an easy solution.   
The problem apparently is that libgpm hangs on opening communication with gpm.  
If gpm hangs, the client will hang as well. It could be possibly worked around  
with a timeout, but the code is already somewhat hairy... I will think about  
it. Either that, or make gpm (daemon) not hang :-). 
Comment 21 Hans de Goede 2006-02-16 08:40:09 EST
Erm,

As I already reported this seems fixed, how can I reproduce this?
Comment 22 Petr Rockai 2006-02-16 09:03:37 EST
I would suspect that the "fix" is the fact that gpm support in mc is now 
disabled in fedora core. So the issue is not fixed, just worked around. I am 
not sure it is worth the effort to fix it for real, though :). For now, the 
"solution" is good enough. However, it will affect other apps than mc still, 
that use gpm mouse support. 
Comment 23 Hans de Goede 2006-02-16 09:44:53 EST
I know gpm is disabled *by default* I build a local mc rpm however with it
enabled and couldn't reproduce the problem.

See above.
Comment 24 Petr Rockai 2006-02-16 10:14:50 EST
You mean comment #19? There were no updates to gpm since 2004. 
Comment 25 Hans de Goede 2006-02-16 14:21:47 EST
Strange, maybe some change in mc then has fixed this? Like I said I can't
reproduce it. And yes I meant comment 19 (and mostly 18)

Comment 26 Tomas Janousek 2007-01-04 07:37:35 EST
fc4 is out of support and this has been worked around by disabling gpm in mc,
therefor closing. I could try to fix it in RHEL4 though.
Comment 27 Tomas Janousek 2007-01-22 03:38:23 EST
Oh, got it. Will start working on a fix...
Comment 28 Fedora Update System 2007-04-17 08:47:51 EDT
mc-4.6.1a-36.20070124cvs.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 29 Fedora Update System 2007-04-17 08:51:29 EDT
mc-4.6.1a-36.20070124cvs.fc5 has been pushed for fc5, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.