Bug 1472421 - Busy loop (on syntax highlight?) after pasting a python script content
Summary: Busy loop (on syntax highlight?) after pasting a python script content
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nano
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-18 16:50 UTC by Milan Crha
Modified: 2017-07-25 21:28 UTC (History)
3 users (show)

Fixed In Version: nano-2.6.1-2.fc25
Clone Of:
Environment:
Last Closed: 2017-07-25 21:28:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Savannah 50121 0 None None None 2017-07-19 13:58:03 UTC

Description Milan Crha 2017-07-18 16:50:03 UTC
When I paste into nano this [1] script content from a web browser (firefox), then it begins with a busy loop. It recovers after ~5 seconds of a freeze, but I guess it would be good to let the upstream know and eventually fix that issue, because reopening the file after save is lightning fast, thus it has something to do with the paste/writing "input method".

Steps:
a) run gnome-terminal, then in it
b) nano /tmp/a.py
c) open [1] in firefox/web browser, then press Ctrl+A, Ctrl+Ins
d) switch back to gnome-terminal/nano (Alt+Tab), then press Shift+Ins

Observe high CPU usage for several seconds.

e) Ctrl+X, Y, Enter
f) nano /tmp/a.py

Observe no high CPU usage, the nano is lightning-fast opened instead.

This is with nano-2.6.1-1.fc25.x86_64.

The backtrace of nano in that particular state:


#0  0x00007fb5db258f10 in _dl_mcount_wrapper_check () from /lib64/libc.so.6
#1  0x00007fb5db1c04dc in mbrtowc () from /lib64/libc.so.6
#2  0x00007fb5db1ea1eb in build_wcs_buffer () from /lib64/libc.so.6
#3  0x00007fb5db1eb512 in re_string_reconstruct () from /lib64/libc.so.6
#4  0x00007fb5db1f67bb in re_search_internal () from /lib64/libc.so.6
#5  0x00007fb5db1fcc0d in regexec@@GLIBC_2.3.4 () from /lib64/libc.so.6
#6  0x00005588bf2fe1b5 in edit_draw (fileptr=fileptr@entry=0x5588bfc837d0, converted=converted@entry=0x5588bfc85780 "        if (val.errno == errno.ENOENT or # either kernel thread or process gone", line=line@entry=4, 
    start=start@entry=0) at winio.c:2400
#7  0x00005588bf2feb12 in update_line (fileptr=fileptr@entry=0x5588bfc837d0, index=0) at winio.c:2695
#8  0x00005588bf2ff2c8 in edit_refresh () at winio.c:2951
#9  0x00005588bf2ef075 in do_input (allow_funcs=<optimized out>) at nano.c:1703
#10 0x00005588bf2dd75a in main (argc=2, argv=0x7ffcbd90cc68) at nano.c:2653

[1] https://raw.githubusercontent.com/pixelb/ps_mem/master/ps_mem.py

Comment 1 Kamil Dudka 2017-07-19 13:58:03 UTC
Thank you for reporting the bug!  It seems to be fixed by the following commit:

http://git.savannah.gnu.org/cgit/nano.git/commit/?id=v2.7.5~28

Comment 2 Fedora Update System 2017-07-19 14:29:22 UTC
nano-2.6.1-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6a46f7bc9b

Comment 3 Milan Crha 2017-07-19 15:02:59 UTC
(In reply to Kamil Dudka from comment #1)
>It seems to be fixed by the following commit:

Thanks. I can confirm that that change really fixes the behaviour described in comment #0.

Comment 4 Fedora Update System 2017-07-20 06:53:47 UTC
nano-2.6.1-2.fc25 has been pushed to the Fedora 25 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-2017-6a46f7bc9b

Comment 5 Fedora Update System 2017-07-25 21:28:20 UTC
nano-2.6.1-2.fc25 has been pushed to the Fedora 25 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.