Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed gpm connect attempt ... for vc /dev/tty0 #3208

Closed
mc-butler opened this issue May 5, 2014 · 22 comments
Closed

Failed gpm connect attempt ... for vc /dev/tty0 #3208

mc-butler opened this issue May 5, 2014 · 22 comments
Assignees
Labels
area: tty Interaction with the terminal, screen libraries prio: high Serious problem that could block progress ver: 4.8.12 Reproducible in version 4.8.12
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3208
Reporter onlyjob (@onlyjob)

As reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743566

Sometimes when running on virtual terminal, under screen(1), MC is super slow,
consuming 50% of CPU, and spewing literally hundreds of messages like
this to syslog:

mc: *** info
mc: Warning: closing connection
/usr/sbin/gpm[2296]: *** warning [daemon/processconn.c(133)]:
/usr/sbin/gpm[2296]: Failed gpm connect attempt by uid 500 for vc /dev/tty0

I couldn't reproduce it but reporter claims it's been OK with MC_4.8.3
so something could get broken in MC_4.8.11 or earlier.

The following ticket seems related: #3011.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by onlyjob (@onlyjob) on May 18, 2014 at 13:04 UTC (comment 1)

  • Priority changed from major to critical

I reproduced easily in (K)VM with gpm_1.20.4-6.1 on Debian "testing". It happens in "screen" and in "tmux" when TERM="screen" (over SSH connection) or TERM="screen.linux" (on framebuffer console) when panels are visible.

As temporary remedy setting TERM="xterm" helps.

Regression was introduced with #3011: I built MC_4.8.12 with reverted commit [9699d5d] and couldn't reproduce the issue any more.

I'm raising priority of this ticket as MC is practically not usable when this problem manifests.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 18, 2014 at 16:00 UTC (comment 2)

  • Cc set to acobar

@mc-butler
Copy link
Author

Changed by lzsiga (@lzsiga) on May 21, 2014 at 14:36 UTC (comment 3)

Hi,
I get the same (or similiar) problem in mc-4.8.11: I do remote access from Windows via putty or dtelnet; if TERM=rxvt/xterm/konsole, there is no problem; if TERM=ansi/linux/vt100 the problem arises: so it is related with the terminal's mouse support (to be more precise: if the terminal has no mouse support, mc tries to use gpm, which fails).

Here are the messages from /var/log/syslog

16:21:50 mcedit: *** info
16:21:50 mcedit: Warning: closing connection
16:21:50 /usr/sbin/gpm[1661]: *** warning [daemon/processconn.c(133)]:
16:21:50 /usr/sbin/gpm[1661]: Failed gpm connect attempt by uid 1001 for vc /dev/tty0

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 11, 2014 at 10:31 UTC (comment 4)

  • Cc acobar deleted
  • Component changed from mc-core to mc-tty

Would you please test the attached patch?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 11, 2014 at 10:31 UTC

@mc-butler
Copy link
Author

Changed by onlyjob (@onlyjob) on Sep 14, 2014 at 13:44 UTC (comment 4.5)

Replying to andrew_b:

Would you please test the attached patch?

Unfortunately it did not help... The following is still logged to "/var/log/messages":

mc: Warning: closing connection
mc: *** info

at the rate around 2800 times per second (with high CPU usage) -- I tested in "tmux" with TERM="screen".

@mc-butler
Copy link
Author

Changed by onlyjob (@onlyjob) on Dec 13, 2014 at 10:03 UTC (comment 6)

Any update please?

@mc-butler
Copy link
Author

Changed by boris on Dec 20, 2014 at 22:19 UTC (comment 7)

I propose the following simple patch:

--- a/lib/tty/key.c
+++ b/lib/tty/key.c
@@ -2092,7 +2092,6 @@
 
                         /* Try to reopen gpm_mouse connection */
                         disable_mouse ();
-                        enable_mouse ();
                     }
                 }
             }

Probably it's not a perfect solution, but it works.

@mc-butler
Copy link
Author

Changed by GlebHappy (g@….pw) on Oct 28, 2015 at 8:49 UTC (comment 8)

mc 4.8.13, ubuntu server 15.10 amd64
Problem still persists

@mc-butler
Copy link
Author

Changed by andrixnet (andrixnet@….com) on Oct 29, 2015 at 19:22 UTC (comment 9)

Under mc-4.8.10 (distribution version of Slackware-14.1) the problem exists as follows:

  • when logged in as regular user at console, the problem does not happen
  • when logged in via ssh, the problem exists.

I have applied the latest version 4.8.14, the problem still persists.

screen was not involved in my testcases. Only remote sessions via ssh (putty client) using TERM=linux


Using the patch above by boris seems to reduce the problem. Only a single error in syslog when the user starts mc:

Oct 29 21:18:05 HOST /usr/sbin/gpm[1833]: *** warning [daemon/processconn.c(128)]:
Oct 29 21:18:05 HOST /usr/sbin/gpm[1833]: Failed gpm connect attempt by uid 1000 for vc /dev/tty0

I am not knowledgeable enough with the internals of GPM to be able to determine why this happens.

@mc-butler
Copy link
Author

Changed by grok (grok@….ca) on Jan 25, 2016 at 6:28 UTC (comment 10)

As of 2016.01.25 this is still a problem on an up-to-date:

* Debian Jessie: v 8.3
* Linux kernel: v 3.16.7 amd64
* gpm: v 1.20.4-6.1
* screen: v 4.2.1-3+deb8u1
* mc: v 4.8.13-3

And for that matter -- I'm also getting a version date on gpm of '29th of May 2008'.
Old!
:/

@mc-butler
Copy link
Author

Changed by zaytsev-work (@zyv) on Jan 25, 2016 at 8:35 UTC (comment 11)

Hmmm... I wasn't able to reproduce it in a long while. Another mystery case for our guru and to investigate?

@mc-butler
Copy link
Author

Changed by lzsiga (@lzsiga) on Sep 27, 2016 at 10:02 UTC (comment 12)

Still present in my Debian Jessie, mc-4.8.13, gpm-1.20.4, linux terminal (aka Alt+F1). (No problem with xterm, rxvt and alike.)

Now I compiled mc-4.8.17 from source, and it works without problem.

@mc-butler
Copy link
Author

Changed by Talkless (vindrg@….com) on Dec 11, 2018 at 7:23 UTC (comment 13)

It still reproduces on Debian Stretch. Connected to the Stretch mechine via SSH, launched tmux, split it horizontally and launched mc in it. Noticed huge input lag when navigating using arrow keys. Later I have noticed high CPU usage, because grep (via logcheck) started to collect log entries. /var/log/syslog contains around half a million of lines like this:

Dec 11 08:26:15 dev /usr/sbin/gpm[802]: *** warning [daemon/processconn.c(133)]:
Dec 11 08:26:15 dev /usr/sbin/gpm[802]: Failed gpm connect attempt by uid 1001 for vc /dev/tty0
Dec 11 08:26:15 dev mc: *** info
Dec 11 08:26:15 dev mc: Warning: closing connection

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Feb 27, 2019 at 19:57 UTC (comment 14)

On a side note, gpm should be reworked to emit xterm-compatible mouse sequences, and this would no longer would be a problem then. See telmich/gpm#29 .

@mc-butler
Copy link
Author

Changed by mikulas (mikulas@….com) on Feb 27, 2019 at 20:14 UTC (comment 15)

How to reproduce the bug:

  • compile mc with gpm support
  • run the gpm daemon on the console
  • login to the machine with ssh from console on another machine
  • run mc

At this situation, keyboard response will be sluggish and mc will consume
CPU time when idle. The reason is that mc is trying to reopen the Gpm
connection over and over again and gpm will try to close the connection
over and over again (because the user is not on the local console).

@mc-butler
Copy link
Author

Changed by mikulas (mikulas@….com) on Feb 27, 2019 at 20:16 UTC

Here I'm submitting a patch for this bug

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Feb 28, 2019 at 8:19 UTC (comment 16)

I hope this fixes #3614 too.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 2, 2019 at 11:35 UTC (comment 17)

  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.23
  • Owner set to andrew_b
  • Blocking set to #3614
  • Branch state changed from no branch to on review

Branch: 3208_gpm_connect_attempt
[02764a38931a58056cf71c02647a604c9a5faedf]

Please test.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 24, 2019 at 11:41 UTC (comment 18)

  • Votes set to andrew_b
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 24, 2019 at 11:43 UTC (comment 19)

  • Resolution set to fixed
  • Votes changed from andrew_b to committed-master
  • Branch state changed from approved to merged
  • Status changed from accepted to testing

Merged to master: [5389e3f].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 24, 2019 at 11:45 UTC (comment 20)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tty Interaction with the terminal, screen libraries prio: high Serious problem that could block progress ver: 4.8.12 Reproducible in version 4.8.12
Development

No branches or pull requests

2 participants