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

OSX readline detection fails in the debugger #473

Closed
fperez opened this issue May 25, 2011 · 1 comment
Closed

OSX readline detection fails in the debugger #473

fperez opened this issue May 25, 2011 · 1 comment
Labels
Milestone

Comments

@fperez
Copy link
Member

fperez commented May 25, 2011

This is a continuation of an old bug:

https://bugs.launchpad.net/ipython/+bug/411599

Darrel Schiebel reports:

I find that the fixed loop duration is insufficient. I needed to set it to 150 (see below). At 50 or less repetitions, ipython startup consistently dies within gdb.

--- /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/IPython/rlineimpl.py.orig 2011-05-09 18:52:30.000000000 -0400
+++ /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/IPython/rlineimpl.py 2011-05-09 18:42:42.000000000 -0400
@@ -37,7 +37,7 @@
     # infinite loops with such code, so for now I'm taking a more conservative
     # approach. See https://bugs.launchpad.net/ipython/+bug/411599.
     #while True:
-    for i in range(10):
+    for i in range(150):
         try:
             (status, result) = commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ )
             break

I tried to find a way to either re-open this defect or submit a new defect from launch pad, but it claims that it no longer knows how to submit ipython defects.

End Darrell's report

I'm wondering if the right approach shouldn't be to have an exponential backoff of the retries... It strikes me as ugly to rapid-fire 150 subcommands...

minrk added a commit to minrk/ipython that referenced this issue May 27, 2011
getstatusoutput uses os.popen, and is vulnerable to EINTR weirdness
in environments such as gdb or PyQt.

Exponential falloff is also used, to prevent waiting forever or firing requests too fast, though I haven't had it fire more than once
after moving to Popen.

closes ipythongh-473
@minrk
Copy link
Member

minrk commented May 27, 2011

#475 should close this issue. I replicated the error in gdb, and after the change I can't get it to happen anymore, whether using readline or libedit.

If it does somehow fail (e.g. otool is somehow missing), the action is now just to warn that libedit detection failed, not raise an error.

@minrk minrk closed this as completed in cf26ce8 May 27, 2011
@minrk minrk mentioned this issue May 27, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
getstatusoutput uses os.popen, and is vulnerable to EINTR weirdness
in environments such as gdb or PyQt.

Exponential falloff is also used, to prevent waiting forever or firing requests too fast, though I haven't had it fire more than once
after moving to Popen.

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

No branches or pull requests

2 participants