pyodide: Low level stack overflows using Jedi in Chrome

If I type into the pyodide console here: https://pyodide-cdn2.iodide.io/v0.15.0/full/console.html import jedi; import numpy; jedi.Interpreter("numpy.split().", [globals()]).completions() the result is “Range Error: Maximum Call Stack Exceeded”. The pyodide instance is not completely borked by this but it is pretty screwed up. For instance, there is an error left in sys.exc_info():

>>> import sys; sys.exc_info()
<class 'KeyError'>,KeyError(((), frozenset())),<traceback object at 0x4976ab0>

Trying to set a very small recursion limit will tell you that a 334 calls worth of glitched junk is left over on the Python stack:

>>> sys.setrecursionlimit(10)
<... many lines of stack trace omitted>
RecursionError: cannot set the recursion limit to 10 at the recursion depth 334: the limit is too low

In a fresh repl this would say cannot set the recursion limit to 10 at the recursion depth at the recursion depth 9.

If I start out with sys.setrecursionlimit(100) before doing the Jedi call, then it will return a proper Python RecursionError. The initial value of sys.getrecursionlimit() is 315.

I did all of this with Chrome v. 86.0.4240.198 under Windows 10.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

Interestingly this no longer reproduces on /dev/full/ but it was not fixed by #1102 it also fails on 0.17.0a2. No clue what the deal with that is, but probably the problem is still present we just need a slightly more complicated trigger.

@rth These tagged alphas are really great, we should make more of them in the future.