-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Parser stack overflow on WASI with --with-pydebug
#131770
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
Comments
I bisected this to 0142236, specifically, the following call, which uses the new cpython/Tools/peg_generator/pegen/c_generator.py Lines 382 to 386 in 4b3d5b6
cc @markshannon |
So what are our options at this point?
I just worry the longer we don't fix #131769 the more pain it will take to get debug builds working again. Plus I don't want to go too far into the betas w/ this not working. |
In my opinion, I think we should disable the stack protection until WASM provides a mechanism that allow us to implement it correctly. Due to WASM being sandboxed, stack overflows are not as big of a concern there compared to native runtimes, so I don't think we are losing a particularly large amount of value by disabling this functionality. That said, I do understand it might be frustrating for @markshannon, as the one who implemented it, so I'd appreciate his thoughts on this. |
@hugovk I made this a deferred blocker as I don't think it matters for a beta since it's a behind-the-scenes mechanism, but I don't want to reach final w/o a solution as not being able to a debug build in WASI doesn't seem great. |
I tried playing with various values to get a debug build to work to no avail. Lines 32 to 34 in 2b67db7
With a value of 29 I get: Exception ignored in the internal traceback machinery:
Traceback (most recent call last):
File "/Lib/traceback.py", line 7, in <module>
import textwrap
File "/Lib/textwrap.py", line 8, in <module>
import re
File "/Lib/re/__init__.py", line 127, in <module>
import functools
File "/Lib/functools.py", line 517, in <module>
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
File "/Lib/collections/__init__.py", line 447, in namedtuple
__new__ = eval(code, namespace)
MemoryError: Parser stack overflowed - Python source too complex to parse
Traceback (most recent call last):
File "/Lib/runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Lib/runpy.py", line 88, in _run_code
exec(code, run_globals)
File "/Lib/test/__main__.py", line 1, in <module>
from test.libregrtest.main import main
File "/Lib/test/libregrtest/main.py", line 3, in <module>
import re
File "/Lib/re/__init__.py", line 127, in <module>
import functools
File "/Lib/functools.py", line 517, in <module>
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
File "/Lib/collections/__init__.py", line 447, in namedtuple
__new__ = eval(code, namespace)
object address : 0x190ff20
object refcount : 6
object type : 0x12e7698
object type name: MemoryError
object repr : MemoryError('Parser stack overflowed - Python source too complex to parse')
lost sys.stderr And with a value of 30 I get (truncated):
You can use #133219 to get a pydebug of WASI again. |
A comment from Hood about the mechanism being a problem: #131855 (comment) |
Increasing |
Not really, I just want the test to pass without raising a |
FYI I marked this as a deferred blocker, but I would like to get it resolved before b2, so once b1 comes out I plan to make this a release blocker. |
From #130397, the following snippet fails: def test_format_layoutlist(self):
def sample(indent=0, indent_size=2):
return ttk._format_layoutlist(
[('a', {'other': [1, 2, 3], 'children':
[('b', {'children':
[('c', {'children':
[('d', {'nice': 'opt'})], 'something': (1, 2)
})]
})]
})], indent=indent, indent_size=indent_size)[0] with the error message of:
Also from the same issue, this sort of parsing failure shows up under |
Now that b1 is out I have made this a release blocker for b2. |
This looks like a WASI configuration problem. |
Bug report
Bug description:
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: