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

Tab completing re.search objects crashes IPython #320

Closed
aroscoe opened this Issue Mar 28, 2011 · 8 comments

Comments

Projects
None yet
4 participants
@aroscoe

aroscoe commented Mar 28, 2011

When tab completing a the result of a re.search it crashes my ipython session (example below).

Python verison: 2.6.1
IPython version: 0.10.1
OS: MacOS X 10.6.6

In [1]: url = '/tasks/drp/priority'

In [2]: import re

In [3]: m = re.search('^/tasks/(\w+)/(\w+)/?$', url)

In [4]: m.Python(63147) malloc: *** error for object 0x1010fa99d: pointer being freed was not    allocated 
*** set a breakpoint in malloc_error_break to debug
Abort trap
@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Mar 28, 2011

Member

I can't replicate this with any version of IPython (same Python and OSX).

Do you have readline installed, or does IPython give a 'leopard libedit detected' warning on startup?

If it is using libedit, it is highly recommended that you install readline with:

$ easy_install readline

Tab completion and history are much better behaved after you do that (the libedit warning will no longer appear if IPython finds proper readline).

Member

minrk commented Mar 28, 2011

I can't replicate this with any version of IPython (same Python and OSX).

Do you have readline installed, or does IPython give a 'leopard libedit detected' warning on startup?

If it is using libedit, it is highly recommended that you install readline with:

$ easy_install readline

Tab completion and history are much better behaved after you do that (the libedit warning will no longer appear if IPython finds proper readline).

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Mar 28, 2011

Member

Also can't replicate in Ubuntu, either with 0.10 or trunk.

Member

takluyver commented Mar 28, 2011

Also can't replicate in Ubuntu, either with 0.10 or trunk.

@aroscoe

This comment has been minimized.

Show comment
Hide comment
@aroscoe

aroscoe Mar 28, 2011

Looks like that was my issue. Thank you for the help!

aroscoe commented Mar 28, 2011

Looks like that was my issue. Thank you for the help!

@aroscoe aroscoe closed this Mar 28, 2011

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Mar 28, 2011

Member

It probably still warrants a brief investigation, if someone with OS X has the time. We'd like there to be nothing that causes IPython to crash.

Member

takluyver commented Mar 28, 2011

It probably still warrants a brief investigation, if someone with OS X has the time. We'd like there to be nothing that causes IPython to crash.

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Mar 28, 2011

Member

libedit causes enough problems, that we really want readline as a hard dependency on OSX. I just pushed a more verbose warning to master instead of the tiny print statement that most people just ignore, having no idea what libedit means.

Member

minrk commented Mar 28, 2011

libedit causes enough problems, that we really want readline as a hard dependency on OSX. I just pushed a more verbose warning to master instead of the tiny print statement that most people just ignore, having no idea what libedit means.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Mar 28, 2011

Member

By the way, Thomas: while it's true that we want to make ip as robust as possible, tab completion is one of those places where there's not much we can do. If readline/libedit segfaults in the middle of the completion code, ipython can't protect against that.

It seems in this case the problem is libedit, but in the past I've seen (and reported) similar crashes coming from Python's readline itself.

It's fine to leave this one closed as it's not within our power to fix, unfortunately.

Member

fperez commented Mar 28, 2011

By the way, Thomas: while it's true that we want to make ip as robust as possible, tab completion is one of those places where there's not much we can do. If readline/libedit segfaults in the middle of the completion code, ipython can't protect against that.

It seems in this case the problem is libedit, but in the past I've seen (and reported) similar crashes coming from Python's readline itself.

It's fine to leave this one closed as it's not within our power to fix, unfortunately.

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Mar 28, 2011

Member

Indeed, although if we can work out the conditions in which it segfaults, we might be able to avoid triggering it.

Member

takluyver commented Mar 28, 2011

Indeed, although if we can work out the conditions in which it segfaults, we might be able to avoid triggering it.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Mar 28, 2011

Member

On Mon, Mar 28, 2011 at 1:07 PM, takluyver
reply@reply.github.com
wrote:

Indeed, although if we can work out the conditions in which it segfaults, we might be able to avoid triggering it.

Not really: the code that segfaults is automatically called by libedit
when the tab key is hit.

Short of disabling tab completion altogether, there's no way for us to
protect against this crash, I'm afraid...

Cheers,

f

Member

fperez commented Mar 28, 2011

On Mon, Mar 28, 2011 at 1:07 PM, takluyver
reply@reply.github.com
wrote:

Indeed, although if we can work out the conditions in which it segfaults, we might be able to avoid triggering it.

Not really: the code that segfaults is automatically called by libedit
when the tab key is hit.

Short of disabling tab completion altogether, there's no way for us to
protect against this crash, I'm afraid...

Cheers,

f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment