-
Notifications
You must be signed in to change notification settings - Fork 101
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
IPython shell segfault on tab completion #132
Comments
Interestingly, it's fine in the normal python3 shell. So maybe it's an IPython issue? |
IPython does tab completion differently than python3, but it's probably ultimately a pyjulia bug that is being triggered. |
On linux with ipython 5.1.0, I am able to do tab completion of methods of the Julia object, but when I try to complete filenames in a string, it segfaults, e.g.
|
As @takluyver guessed in ipython/ipython#10899 (comment), it looks like threading problem. Just in case if someone wants to reproduce the problem in a script, here it is: import threading
from IPython.testing.globalipapp import get_ipython
from julia import Julia
ip = get_ipython()
ip.user_ns['julia'] = Julia()
def ip_complete():
print(ip.complete('julia.sin.'))
print("ip_complete() in main thread:")
ip_complete()
print()
print("ip_complete() in different thread:")
th = threading.Thread(target=ip_complete)
th.start()
th.join() It prints
I wonder if PyCall/libjulia can support multi-thread usage. JuliaLang/julia#17573 |
Of course, producing segfault this way doesn't require IPython: import threading
from julia import Julia
j = Julia()
j_sin = j.sin
def access_julia():
j_sin.jl_value
th = threading.Thread(target=access_julia)
th.start()
th.join() |
When prompt_toolkit version 2 is ready, we (IPython) should be able to do completions in the main thread, which should avoid this kind of issue. A few things have come up that don't like their completions running from another thread. |
@takluyver Thanks. That would be awesome. |
I just found out that IPython master (to be released as 7.0) already was upgraded to use prompt_toolkit 2.0! ipython/ipython#11177 I have to try it soon... FYI, here is IPython's 7.0 milestone https://github.com/ipython/ipython/milestone/43 |
IPython 7.0 is already released and available in PyPI and Anaconda. Closing... |
In the ipython shell:
immediately segfaults.
On OS X:
The text was updated successfully, but these errors were encountered: