-
Notifications
You must be signed in to change notification settings - Fork 10
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
Pyodide stack overflows #7
Comments
Is it okay to close this issue now? |
Yes this is resolved upstream in Pyodide v0.19. |
I also figured out how to build Rust packages for Pyodide: So if we get the sseq Python package working again we could very likely build it to run in Pyodide. I haven't worked out what exactly is required to do an out of tree build for Pyodide though -- I think in principle only the Python includes should be necessary, but we need
In particular, we don't need to compile/link anything but our own stuff. |
In Chrome with Jedi completions there are reasonably frequent
RangeError
s which result from Python overflowing the C / wasm stack. In Firefox I guess the wasm stack is much larger and so this is rarer (note that other UI stuff doesn't work in firefox though).This seems to trigger in the Jedi "cache to file system" when Jedi is pickling parse trees -- the parse trees are pretty deep and pickle presumably recurses for each level of the tree. I wonder if there is a way to disable this feature: of course it's not very useful in pyodide because the cache gets thrown away when we refresh (unless we decided to persist the EmscriptenFS to IndexedDB or something dumb like that).
Pyodide is supposed to use
sys.setrecursionlimit
to prevent these C stack overflows from happening, but when I usesys.getrecursionlimit
I see3000
which is way too big. On my chrome, it seems like 154 is the max value that avoids triggering a low level stack overflow.Weirdly enough, the Python runtime seems to get screwed up FASTER when I set the lower recursion limit. The low level stack overflow has as it's most obvious symptom that
sys.exc_info()
sometimes has an exception permanently left on it even when no exception has occurred. Currently I notice this inExecution
and leave those stack frames off of error messages. Sometimes eventually the CPython VM segfaults or throws an assertion error.See this issue:
pyodide/pyodide#373
The text was updated successfully, but these errors were encountered: