Bug 506369 - under load, metacity's run_command_x keybinding runs command many times
Summary: under load, metacity's run_command_x keybinding runs command many times
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: metacity
Version: 11
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 513728 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-16 22:07 UTC by Jason Woofenden
Modified: 2010-06-28 13:04 UTC (History)
2 users (show)

Fixed In Version: 2.28.0-11.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-28 13:04:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
a patch (2.78 KB, patch)
2009-11-25 02:42 UTC, Matthias Clasen
no flags Details | Diff

Description Jason Woofenden 2009-06-16 22:07:18 UTC
Description of problem:

When my machine is busy (most often happens during heavy swapping), when I press a key that I've mapped to run_command_2 (or any run_command_* with gconf-editor /apps/metacity) I sometimes get that command run many (10-100) times. 


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

metacity-2.26.0-1.fc11

How reproducible:

Most of the time, if you really get your machine swapping heavily.

Under normal load, maybe 1/100 times. (So about once a day, my machine is incapacitated while it tries to open 50 gnome-terminal windows each with zsh in them)


Steps to Reproduce:

Create a new user who logs in with the default gnome desktop, and make sure you're not using compiz, just plain old metacity.

(short version)
1. gconf-editor /apps/metacity    set F2 or something to run a command
2. get your machine swapping out hard
3. press that key a couple times

(long version)
1. Set up a command that can run quick, and show that it was called:
cd
mkfifo pipe
echo -e '#!/bin/sh\necho $$ > ~/pipe' > counter
chmod +x counter
tail -F pipe

2. use gconf-editor to map F2 to call ~/counter

3. Get your system to swap out:

I don't know the best way to get your machine swapping. I have 500MB of ram, and ran 5 copies of "convert" at once, something like this:

for x in 1 2 3 4 5; do bash -c "convert osm-heat.png heat$x.pnm&"; done

with this 4096x4096 image: http://jasonwoof.com/downloads/osm-heat.png

4. wait until your machine starts swapping badly. if your WM is still responsive, you may need to do something else to cripple it, maybe more copies of convert. Anyway, once it's good and crippled, press F2 a couple times. If you see output from the tail -F right away, you're system isn't swapping hard enough. If it is swapping hard enough, there should be a delay of at least a few seconds, then you'll see tail -F report many PIDs.


Actual results:

metacity runs my run_command_2 many times

Expected results:

metacity should run my run_command_2 only once per keypress no matter how swamped my system is

Additional info:

I marked this as high priority because it incapacitates my whole computer for many minutes when it tries to start 80 gnome-terminals at once.

Comment 1 Jason Woofenden 2009-06-19 06:01:22 UTC
this is killer! I've had to hard-reset my computer another few times because of this.

I'm becoming increasingly convinced that it's related to key auto-repeat. IMO metacity should never run commands more than once, even if the key is held. And if I'm correct, and the key repeat thing is what's causing this, even when I make just a normal tap of the F2 key, it really shouldn't.

I turned off auto-repeat completely in the gnome keyboard settings and that seemed to help. I had a little trouble, so I'm not completely convinced. Somehow autorepeat came on again at some point....

Anyway, now I've figured out how to disable auto-repeat just for the F-keys. Here's the code that does it for me for anybody interested:

xset -r 67
xset -r 68
xset -r 69
xset -r 70
xset -r 71
xset -r 72
xset -r 73
xset -r 74
xset -r 75
xset -r 76
xset -r 95
xset -r 96

I'll report back later, saying if this works around the bug for me.

Thank you,   - Jason

Comment 2 Jason Woofenden 2009-08-27 23:17:54 UTC
Oops, forgot to report back, but here it is:

I've been running the above xset commands to disable auto-repeat on all my f-keys as soon as I log in, and I've not had the problem since. This is pretty strong evidence that key-repeat is the culprit.

I hope this gets treated as a serious issue, because it turns a sticky key (a common software/hardware glitch) into effectively crashing the whole system.

Comment 3 Owen Taylor 2009-11-16 16:21:46 UTC
*** Bug 513728 has been marked as a duplicate of this bug. ***

Comment 4 Matthias Clasen 2009-11-25 02:42:08 UTC
Created attachment 373617 [details]
a patch

Here is a patch that ignores key repeat for selected key bindings. Currently, it only disables key repeat for the screenshot commands, but it may be a good idea to do the same for all run_command bindings.

Comment 5 Fedora Update System 2009-11-28 06:32:07 UTC
metacity-2.28.0-11.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/metacity-2.28.0-11.fc12

Comment 6 Fedora Update System 2009-12-01 04:28:39 UTC
metacity-2.28.0-11.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update metacity'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12392

Comment 7 Owen Taylor 2009-12-01 16:13:29 UTC
Moving back to NEW, since disabling repeat for printscreen only can't be seen as fixing the Subject of this bug.

Comment 8 Fedora Update System 2009-12-02 04:25:33 UTC
metacity-2.28.0-11.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Jason Woofenden 2009-12-02 10:40:22 UTC
I don't think this has been fixed. Reasons:

1) nobody has said that it was fixed

2) it doesn't work for me (details below)

3) if I understand what's going on correctly... this bug was closed by a bot.

Here's how I tested it:

I've updated to metacity-2.28.0-11.fc12, logged out, logged back in, held f2 for a couple seconds (which I have mapped to run_command_2 which executes gnome-terminal) and got probably 20 terminals.

Changing status back to ASSIGNED (the only option I have besides CLOSED).

Comment 10 Owen Taylor 2009-12-02 15:34:09 UTC
(In reply to comment #9)
> I don't think this has been fixed. Reasons:
> 
> 1) nobody has said that it was fixed
> 
> 2) it doesn't work for me (details below)
> 
> 3) if I understand what's going on correctly... this bug was closed by a bot.

Yes, thanks for reopening.

Comment 11 Bug Zapper 2010-04-27 14:59:58 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 12 Bug Zapper 2010-06-28 13:04:34 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.