Bug 1109946 - readline in Fedora is very slow when rl_event_hook is used
Summary: readline in Fedora is very slow when rl_event_hook is used
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: readline
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Chaloupka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-16 17:26 UTC by Jirka Klimes
Modified: 2016-01-04 06:04 UTC (History)
4 users (show)

Fixed In Version: readline-6.2-10.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-23 02:59:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
[PATCH] patch for Fedora 20 to fix the problem described (3.61 KB, patch)
2014-06-16 17:34 UTC, Jirka Klimes
no flags Details | Diff

Description Jirka Klimes 2014-06-16 17:26:40 UTC
When a program uses rl_event_hook to install a callback called by readline, the processing is very slow. It is best viewed by pasting a text as an input. The characters appears one by one, very slowly. See [1] for details.
A fix was pushed upstream on 2012-07-10, as "patch 3" for 6.2 release [2]. Fedora packages should include the patch to fix the issue.

You can easily reproduce the problem using any Fedora readline (6.2) package with this program:

cat << EOF > /tmp/rl-event-test.c
#include <stdio.h>
#include <stdlib.h>
#include <readline/readline.h>

int my_event_hook(void)
{
    return 0;
}

int main(void)
{
    char *str;
    rl_event_hook = &my_event_hook;
    str = readline("> ");
    printf("got '%s'\n", str);
    free(str);
    return 0;
}
EOF

$ gcc -g -lreadline /tmp/rl-event-test.c -o /tmp/rl-event-test
$ /tmp/rl-event-test
>
... and paste a text with mouse at the prompt. You will see the characters slowly appear one by one.
I suggest you pasted this text: "Jumping Jack is quick and bold. With skill his story will unfold.". It will remind you the old good Jumping Jack ZX Spectrum game [3] :-)

[1] https://lists.gnu.org/archive/html/bug-readline/2012-06/msg00008.html
[2] http://git.savannah.gnu.org/cgit/readline.git/commit/?id=e8b937f06bb4a88d68e96c81f63ead20892ea9b8
[3] http://www.youtube.com/watch?v=Ai-ocyGR_LQ&t=0m41s

Comment 1 Jirka Klimes 2014-06-16 17:34:20 UTC
Created attachment 909200 [details]
[PATCH] patch for Fedora 20 to fix the problem described

Fedora 20 scratch build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=7048484

Comment 2 Fedora Admin XMLRPC Client 2014-06-17 06:30:59 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Jirka Klimes 2014-06-18 08:18:18 UTC
The slowness can be somewhat mitigated by lowering keyboard input timeout
rl_set_keyboard_input_timeout (10000);
But this makes the event hook to be called more often, causing higher CPU usage.

So please include the patch (comment #1) to Fedora (all releases) and also to RHEL.
Or maybe better, rebase to readline 6.3 with all upstream patches - bug 1071336.

Comment 5 Fedora Update System 2014-06-19 11:32:08 UTC
readline-6.2-8.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/readline-6.2-8.fc19

Comment 6 Fedora Update System 2014-06-19 11:34:11 UTC
readline-6.2-10.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/readline-6.2-10.fc20

Comment 7 Fedora Update System 2014-06-19 22:59:17 UTC
Package readline-6.2-10.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing readline-6.2-10.fc20'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7523/readline-6.2-10.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-07-23 02:59:09 UTC
readline-6.2-10.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2014-12-07 04:32:15 UTC
readline-6.2-8.fc19 has been pushed to the Fedora 19 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.