Bug 1089695 - autokey hangs keyboard when using clipboard set_text() or request_text() takes exactly 3 arguments (2 given)
Summary: autokey hangs keyboard when using clipboard set_text() or request_text() take...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: autokey
Version: 27
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Raghu Udiyar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1229371 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-21 17:07 UTC by Larry O'Leary
Modified: 2018-05-24 09:38 UTC (History)
2 users (show)

Fixed In Version: autokey-0.94.0-1.fc28 autokey-0.94.0-1.fc27
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-11 01:23:59 UTC
Type: Bug
Embargoed:
raghusiddarth: needinfo-
raghusiddarth: needinfo-


Attachments (Terms of Use)
Patch to fix crash. (520 bytes, patch)
2015-06-08 15:15 UTC, Christopher Wawak
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1075429 0 None None None Never

Description Larry O'Leary 2014-04-21 17:07:59 UTC
Description of problem:
If autokey phrase is set to use paste using clipboard, it will hang. If the same phrase is attempted a second time, it seems that the input device becomes non-responsive and can only be resolved by switching to a virtual terminal (outside of GNOME) to kill the misbehaving autokey-gtk process.

Version-Release number of selected component (if applicable):
Name        : autokey-gtk
Arch        : noarch
Version     : 0.90.4
Release     : 4.fc20
Size        : 438 k
Repo        : installed
From repo   : fedora

How reproducible:
Always

Steps to Reproduce:
1. Create a autokey phrase that uses Paste using Clipboard (Ctrl+V)
2. Type the phrase's abbreviation

Actual results:
Abbreviation is erased by no output appears.

Expected results:
Abbreviation is erased and phrase appears.

Additional info:
If multiple attempts are performed, the keyboard stops responding to key input and you are left with no keyboard input device. To resolve this, you must switch to a virtual terminal (Ctrl+Alt+F2) and perform a killall autokey-gtk as the user who started the autokey process.

This was also reported for Ubuntu in Launchpad - https://bugs.launchpad.net/ubuntu/+source/autokey/+bug/1075429

The root cause of this issue is identified by the following stack:

2014-04-21 11:47:09,832 DEBUG - interface - Sending string: u'some text that should be pasted\n'
ERROR:interface:Error in X event loop thread
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 500, in __sendStringClipboard
    self.__fillClipboard(string)
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 537, in __fillClipboard
    self.clipBoard.set_text(string.encode("utf-8"))
TypeError: set_text() takes exactly 3 arguments (2 given)




After this issue occurred, I had to terminate autokey which resulted in the following abrt report: https://retrace.fedoraproject.org/faf/reports/415062/

It is important to note that the abrt report wasn't actually triggered by the hang but instead by killing the process because it became unresponsive.

Comment 1 Fedora End Of Life 2015-05-29 11:38:11 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 EOL if it remains open with a Fedora  'version'
of '20'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 2 Christopher Wawak 2015-06-08 15:10:39 UTC
*** Bug 1229371 has been marked as a duplicate of this bug. ***

Comment 3 Christopher Wawak 2015-06-08 15:14:46 UTC
This is still an issue in F22. The upstream issue hasn't been fixed for years. It would be great if this can be fixed in the Fedora RPM since the app itself works ok with the following patch:

$ cat autokey-gtk-rhbz1089695.patch 
--- autokey-0.90.4/src/lib/interface.py	2012-05-15 07:27:57.000000000 -0400
+++ autokey-0.90.4/src/lib/interface-b.py	2015-06-08 10:49:04.269038660 -0400
@@ -534,7 +534,7 @@
             text = self.clipBoard.wait_for_text()
             self.__savedClipboard = ''
             if text is not None: self.__savedClipboard = text
-            self.clipBoard.set_text(string.encode("utf-8"))
+            self.clipBoard.set_text(string.encode("utf-8"), len=-1)
             Gdk.threads_leave()
 
     def begin_send(self):

There's probably other areas where this should be fixed, but this patch fixed my immediate issue in BZ# 1229371.

I'm building a COPR with the package that includes the patch here:
https://copr.fedoraproject.org/coprs/cwawak/autokey

Comment 4 Christopher Wawak 2015-06-08 15:15:35 UTC
Created attachment 1036421 [details]
Patch to fix crash.

Comment 5 Christopher Wawak 2015-12-21 20:56:53 UTC
Bug still seems there in F23. What's needed to get this fixed?

Comment 6 Fedora End Of Life 2016-11-24 11:09:18 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 EOL if it remains open with a Fedora  'version'
of '23'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 7 Fedora End Of Life 2016-12-20 12:47:25 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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

Comment 8 Larry O'Leary 2017-01-04 21:58:33 UTC
This issue still affects Fedora 25.

----
2017-01-04 14:34:04,683 DEBUG - interface - Sending string: u'/*\n * Copyright (C) 2005-2014 Red Hat, Inc.\n * All rights reserved.\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation version 2 of the License.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software Foundation, Inc.,\n * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\n */\n\n'
2017-01-04 14:34:04,685 ERROR - interface - Error in X event loop thread
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 116, in __eventLoop
    method(*args)
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 500, in __sendStringClipboard
    self.__fillClipboard(string)
  File "/usr/lib/python2.7/site-packages/autokey/interface.py", line 537, in __fillClipboard
    self.clipBoard.set_text(string.encode("utf-8"))
TypeError: Gtk.Clipboard.set_text() takes exactly 3 arguments (2 given)
----


This puts AutoKey into a bad state and upon next attempt to auto complete, the keyboard hangs.

The apparent fix was provided in attachment 1036421 [details] and seems reasonable to me. Is this package no longer maintained? It looks like the upstream has not seen a release since 2012.

Additionally, someone has ported to Python 3. 0.93.7 contains this fix as well. Seems like it was introduced as part of the Python 3 port in https://github.com/autokey-py3/autokey/commit/7bbb17c634b65cbc417b1d56e862ea3f94a27b83. Problem is that the port appears to be missing the GTK specific launcher autokey-gtk.

If we can not get this fixed, I suggest that the package be removed as it can break GNOME if installed and clipboard feature is used.

Comment 9 Fedora Update System 2018-05-01 14:08:12 UTC
autokey-0.94.0-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-ff5a888f5a

Comment 10 Fedora Update System 2018-05-01 14:11:08 UTC
autokey-0.94.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-0eec817e5f

Comment 11 Fedora Update System 2018-05-02 10:12:14 UTC
autokey-0.94.0-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-ff5a888f5a

Comment 12 Fedora Update System 2018-05-02 13:13:31 UTC
autokey-0.94.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-0eec817e5f

Comment 13 Fedora End Of Life 2018-05-03 08:32:55 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 EOL if it remains open with a Fedora  'version'
of '26'.

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.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 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, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

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.

Comment 14 Fedora Update System 2018-05-11 01:23:59 UTC
autokey-0.94.0-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2018-05-11 01:49:55 UTC
autokey-0.94.0-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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