Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 504440 - sys-libs/readline-6.3 segfaults with ipython
Summary: sys-libs/readline-6.3 segfaults with ipython
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-03-13 03:21 UTC by Seemant Kulleen
Modified: 2014-03-28 23:26 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Makes the segfault with ipython go away. (readline-6.3-multikey.patch,460 bytes, patch)
2014-03-13 03:21 UTC, Seemant Kulleen
Details | Diff
emerge --info (file_504440.txt,4.60 KB, text/plain)
2014-03-26 01:34 UTC, Bernardo Costa
Details
Better fix (readline-dispatch-multikey.patch,541 bytes, patch)
2014-03-28 17:12 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Seemant Kulleen 2014-03-13 03:21:35 UTC
Created attachment 372540 [details, diff]
Makes the segfault with ipython go away.

I ran into this bug today (and chutzpah confirmed he is experiencing it as well), where traversing through history causes a segfault (pressing up arrow twice in my case).

The GNU/readline mailing list has a similar report, with a patch attached.  The mailing list thread is here:

http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html

The patch that came from a readline dev will be attached to this bug.  I can confirm that the patch works for me
Comment 1 SpanKY gentoo-dev 2014-03-13 09:21:37 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add fix from upstream for some crashes
http://sources.gentoo.org/sys-libs/readline/files/readline-6.3-dispatch-multikey.patch?rev=1.1
http://sources.gentoo.org/sys-libs/readline/readline-6.3-r2.ebuild?rev=1.1
Comment 2 Joseph Booker 2014-03-24 17:03:34 UTC
Not sure if this should be reported upstream, but I'm still having this problem with sys-libs/readline-6.3-r2 and dev-python/ipython-1.2.1 (I've rebuilt both multiple times)

Hell, I did an 'emerge -vaDeN ipython' with no change in this bug. Is there something I'm missing?
Comment 3 SpanKY gentoo-dev 2014-03-25 20:24:37 UTC
attach your full build log for readline, emerge info, and any customizations you've made to readline (like ~/.inputrc)
Comment 4 Bernardo Costa 2014-03-26 01:33:13 UTC
Also hit by this one, readline-6.3-r2 still bugs me.

I have compiled, in order:

sys-libs/readline-6.3-r2 (USE="-static-libs" ABI_MIPS="-n32 -n64 -o32" ABI_X86="64 -32 -x32")

dev-lang/python-3.3.4 (USE="gdbm ipv6 ncurses readline sqlite ssl threads xml -build -doc -examples -hardened -tk -wininst")

dev-python/ipython-1.2.1 (USE="matplotlib notebook smp -doc -emacs -examples -mongodb -nbconvert -octave -qt4 {-test} -wxwidgets" PYTHON_TARGETS="python2_7 python3_3 -python2_6 -python3_2")

I'm not aware of any modifications I could have made to readline, certainly I have no ~/.inputrc.

I have a pretty straightforward way to reproduce this bug:

1. launch ipython
2. Arrow up
3. Backspace
4. Arrow down two times
5. Segfault

The same does NOT happen to the underlying python. (I have inserted a dummy command "1.5. x = 0<CR>" before the "arrow-backspace-arrow" so that backspace effectively does something, with this extra one, ipython still segfaults)

Replacing "backspace" by "arrow-left" or "arrow-right" also produces segfault in ipython.
Comment 5 Bernardo Costa 2014-03-26 01:34:01 UTC
Created attachment 373536 [details]
emerge --info
Comment 6 SpanKY gentoo-dev 2014-03-26 02:23:56 UTC
if you can reproduce, please post the steps.  if you can't, then run it through gdb so you can get backtraces when it does crash.

gdb --args python `which ipython`
Comment 7 Martin von Gagern 2014-03-28 17:10:21 UTC
I still encounter segfaults from ipython and others. I found a different patch upstream: http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00034.html has one where that one condition reads r >= 0 instead of r == 0. Which is relevant, because in the case of search-history-backward failing, the return value is 1. With PgUp bound to history-search-backward in /etc/inputrc, I could run "rlfe cat", type some stuff and then press PgUp twice to reproduce the segfault. With the mentioned patch instead of the one in portage, things work.
Comment 8 Martin von Gagern 2014-03-28 17:12:08 UTC
Created attachment 373754 [details, diff]
Better fix

This is the patch from
http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00034.html
but converted to unified diff and with a URL in the comment up front.
It handles the r == 1 case correctly.
Comment 10 Joseph Booker 2014-03-28 23:26:29 UTC
Sorry for not responding, didn't realize I wasn't on the CC list. Just wanted to say that the fix in -r4 worked for me.