Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault when pressing up arrow with no history #5260

Closed
gsingh93 opened this issue Mar 3, 2014 · 9 comments
Closed

Segfault when pressing up arrow with no history #5260

gsingh93 opened this issue Mar 3, 2014 · 9 comments
Milestone

Comments

@gsingh93
Copy link

gsingh93 commented Mar 3, 2014

I'm running ipython 1.2.1 in Arch Linux. When I press the up key and there is no more available history, ipython segfaults. Here is how to duplicate it:

  1. Run ipython
  2. Type a letter that is not the first letter of any previously used command. For example, I have not run any commands that start with v, so I will type v.
  3. Press up. There will be no completions, and ipython will not do anything, but the program has not crashed yet.
  4. Press any key. This can be up, space, another letter key, etc. The program will crash.
@takluyver
Copy link
Member

Segfaults are very unlikely to be bugs in IPython, because it is pure Python code. In this case, I would look for a bug in readline.

@minrk minrk added this to the no action milestone Mar 3, 2014
@gsingh93
Copy link
Author

gsingh93 commented Mar 3, 2014

Thanks for the response. It looks like readline was updated to version 6.3-1 yesterday. I downgraded to 6.2 and everything is working. I'll report this bug to the readline developers.

@gsingh93 gsingh93 closed this as completed Mar 3, 2014
@takluyver
Copy link
Member

@minrk has just guessed that it might be an ABI version mismatch between readline and its Python bindings - if that is the case, then recompiling Python should fix it.

@anatol
Copy link

anatol commented Mar 8, 2014

I tried recompile python 3.3.4 and 3.4.5rc2 against readline 6.3 and the crash still exists.

Here is Linux Arch bug report https://bugs.archlinux.org/task/39144
And active discussion in readline maillist http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html

@takluyver you are experienced in python bindings so any help from you is welcome.

@anatol
Copy link

anatol commented Mar 8, 2014

Note that python interactive shell that also uses readline does not reproduce this crash. I can repro it only with ipython shell.

@takluyver
Copy link
Member

I don't really know much about the Python readline bindings - I know that readline is what handles the history when you press up/down, and I know Python code can't cause segfaults except in very unusual circumstances. Given that @gsingh93 upgraded readline recently, it's an easy guess that that's responsible. But I have no experience of debugging C code.

@anatol
Copy link

anatol commented Mar 8, 2014

There is a discussion in readline maillist. The readline developer says that he cannot reproduce the problem and most likely Python does weird thing with initialization or with signal handler.

There is no clear answer yet but we keep investigating.

@takluyver
Copy link
Member

A patch (to readline) appears to be in the pipes for this: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741555

@brouberol
Copy link

I can confirm that switching from libreadline6=6.3.1 to libreadline6=6.2+dfsg-0.1 fixes the issue on a Debian "jessie" system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants