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

Crash when trying to autocomplete #29428

Closed
mmasdeu opened this issue Mar 30, 2020 · 11 comments
Closed

Crash when trying to autocomplete #29428

mmasdeu opened this issue Mar 30, 2020 · 11 comments

Comments

@mmasdeu
Copy link

mmasdeu commented Mar 30, 2020

Working with some custom modules that use cython, Sage crashes. Tracking it down, it appears that the source of the problem lies in the changes introduced in #24681.

The Jedi code tries to call get_source() and fails terribly because of that. I understand that #24681 tried to solve a problem, but the one it causes is much worse.

This is running Arch Linux with package sagemath 9.0-12, currently (2020/03/30) up to date.

CC: @videlec @jdemeyer @embray @antonio-rojas

Component: cython

Keywords: autocompletion, jedi

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/29428

@mmasdeu mmasdeu added this to the sage-9.1 milestone Mar 30, 2020
@mwageringel
Copy link

comment:1

@mmasdeu: Please provide a small example that leads to the problem. The main branch of Sage does not use jedi yet, so you could install Sage from source as a workaround.

@mmasdeu
Copy link
Author

mmasdeu commented Apr 7, 2020

comment:2

Attachment: Sage_crash_report.txt

I uninstalled my extensions and it seems that the problem persists. Here is a MNWE:

sage: E = EllipticCurve('11a1')
sage: Et = E.tate_curve(11)
sage: Et.<TAB>

After this, nothing shows up. After a couple of seconds, Sage crashes. I attached the crash report.

@antonio-rojas
Copy link
Contributor

comment:3

I have reverted #24681 in the Arch package. This will eventually hit sage-the-distro when ipython is upgraded, so a different solution needs to be found for the problem in #24681

@jhpalmieri
Copy link
Member

comment:4

I just installed IPython 7.13 and Jedi 0.17.0, and I don't see this problem. I'm still working out the kinks with the IPython installation, and in particular, the preparser seems to be broken: I get

sage: E = EllipticCurve('11a1')                                                           
sage: Et = E.tate_curve(11)                                                               
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-375b7dd9888b> in <module>
----> 1 Et = E.tate_curve(11)

...

AttributeError: 'int' object has no attribute 'is_prime'

But this works:

sage: E = EllipticCurve('11a1')
sage: Et = E.tate_curve(Integer(11))
sage: Et.<tab>

@jhpalmieri
Copy link
Member

comment:5

I actually do see a problem, but not a crash. I'm attaching a screenshot after hitting Et.<tab>. (I'm trying this combined with #28197, not on its own.)

@jhpalmieri
Copy link
Member

screen shot after Et.

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 25, 2020

comment:6

Attachment: Screen Shot 2020-04-25 at 11.39.23 AM.png

We had a similar problem with polymake/jupymake. Tab completion in IPython runs in a separate thread. This can break packages that are not prepared for threaded operation.

@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 25, 2020

comment:7

Replying to @mkoeppe:

We had a similar problem with polymake/jupymake. Tab completion in IPython runs in a separate thread. This can break packages that are not prepared for threaded operation.

For reference: This happened in #22704, sagemath/sagetrac-mirror@bcc7c6b

@antonio-rojas
Copy link
Contributor

comment:8

Replying to @jhpalmieri:

I just installed IPython 7.13 and Jedi 0.17.0, and I don't see this problem.

I can confirm that this is fixed with jedi 0.17, specifically davidhalter/jedi@e1425de

So I guess this can be closed, since 0.16 will never be used in Sage.

@antonio-rojas antonio-rojas removed this from the sage-9.1 milestone May 6, 2020
@jhpalmieri
Copy link
Member

comment:10

I don't really think we need reviewer names for tickets to be closed, but I'll enter my name anyway.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

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

No branches or pull requests

6 participants