-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
[3.13] Ensurepip fails when built with --enable-experimental-jit
and --with-pydebug
(Linux)
#120437
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
Thanks for the report! |
Here's the full trace: Assertion failed: (tstate->datastack_top < tstate->datastack_limit), function _PyFrame_PushUnchecked, file pycore_frame.h, line 281.
Traceback (most recent call last):
File "/Users/admin/Projects/cpython/Lib/runpy.py", line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
"__main__", mod_spec)
File "/Users/admin/Projects/cpython/Lib/runpy.py", line 88, in _run_code
exec(code, run_globals)
~~~~^^^^^^^^^^^^^^^^^^^
File "/Users/admin/Projects/cpython/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
~~~~~~~~~~~~~~~^^
File "/Users/admin/Projects/cpython/Lib/ensurepip/__init__.py", line 257, in _main
return _bootstrap(
root=args.root,
...<4 lines>...
default_pip=args.default_pip,
)
File "/Users/admin/Projects/cpython/Lib/ensurepip/__init__.py", line 172, in _bootstrap
return _run_pip([*args, "pip"], [os.fsdecode(tmp_wheel_path)])
File "/Users/admin/Projects/cpython/Lib/ensurepip/__init__.py", line 87, in _run_pip
return subprocess.run(cmd, check=True).returncode
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/Users/admin/Projects/cpython/Lib/subprocess.py", line 577, in run
raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/Users/admin/Projects/cpython/python.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/02/ps_0fn7s0sx9kkngq6ykymdh0000gn/T/tmphjt45j3u/pip-24.0-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/02/ps_0fn7s0sx9kkngq6ykymdh0000gn/T/tmphjt45j3u\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' died with <Signals.SIGABRT: 6>. I guess the main problem at the beginning of trace: Assertion failed: (tstate->datastack_top < tstate->datastack_limit), function _PyFrame_PushUnchecked, file pycore_frame.h, line 281. So it seems more related to JIT than to ensurepip. |
Bisecting, this looks like it broke in 1ab6356. |
This error does not appear to occur on Windows x64 builds on 3.13: .\PCBuild\build.bat -e -d -p x64 --experimental-jit
.\PCbuild\amd64\python_d.exe -m ensurepip # this succeeds
This makes sense - probably some JIT issue that ensurepip happens to be triggering. |
The bug confirm on 3.13 and has disappered in main branch Let me find out it |
@Eclips4 would you mind assigning this to me? I may need a bit of time to find out the root cause |
Sure! |
Playing around with this and bisecting For what its worth, this is what I ran with #!/bin/sh
make distclean -j8 || true
(./configure --enable-experimental-jit --with-pydebug && make -j8) || exit 125
! ./python -m venv venv # Negated, since the earlier commit is bad and the later one is good |
import runpy
import sys
sys.path = ['/tmp/tmp04bw2hi9/pip-23.3.2-py3-none-any.whl'] + sys.path
sys.argv[1:] = ['install', '--no-cache-dir', '--no-index', '--find-links', '/tmp/tmp04bw2hi9', 'pip']
runpy.run_module("pip", run_name="__main__", alter_sys=True) This bug is confirmed that is introduced into the codebase in I will dive more deeper, but I may need @markshannon help |
After more inspect, I think this is about Tier2, not JIT ./configure --with-pydebug --enable-pystats --enable-profiling --with-dtrace --enable-experimental-jit=interpreter Continue to dive deeper, but I may need @Fidget-Spinner help... BTW this issue should be labeled about Tier2 cc @Eclips4 |
Unfortunately, we don't have such label |
Got it |
Update, When I try to comment the following code, the issue fixed Lines 31 to 39 in 1ab6356
I have no idea about this issue now.. why it's happend and why it's fixed in 9b8611e cc @markshannon I may need your help sir( |
|
@Zheaoli we have a pass that eliminates redundant |
Thanks sir. The bug has been confirmed. It's not related with I made a PR to fix it. But I'm not sure we need extra test for this case. I have we don't have enough test in 1ab6356 |
…rrent stack Signed-off-by: Manjusaka <me@manjusaka.me>
The bug is indeed in the pass that combines _CHECK_STACK_SPACE. If you comment out https://github.com/python/cpython/blob/main/Python/optimizer_bytecodes.c#L702 this works. |
On second thought, for some reason it works for me even if I don't comment that out?? |
Co-Authored-By: Ken Jin <kenjin@python.org> Signed-off-by: Manjusaka <me@manjusaka.me>
Co-Authored-By: Ken Jin <kenjin@python.org> Signed-off-by: Manjusaka <me@manjusaka.me>
Co-Authored-By: Ken Jin <kenjin@python.org> Signed-off-by: Manjusaka <me@manjusaka.me>
… introduced in pythongh-118322 Co-Authored-By: Ken Jin <kenjin@python.org> Signed-off-by: Manjusaka <me@manjusaka.me>
… introduced in pythongh-118322 Co-Authored-By: Ken Jin <kenjin@python.org> Signed-off-by: Manjusaka <me@manjusaka.me>
…duced in pythongh-118322 (pythonGH-120712) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
…duced in pythongh-118322 (pythonGH-120712) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
…duced in pythongh-118322 (pythonGH-120712) Co-authored-by: Ken Jin <kenjin4096@gmail.com>
Bug report
Bug description:
When building for Linux/X64, the 3.13 branch will not run successfully run
python -m ensurepip
if built with both--enable-experimental-jit
and--with-pydebug
:This fails with an error message like:
Building with either config flag individually successfully builds.
Results of
./python -VV: Python 3.13.0b2+ (heads/3.13:ff358616ddb, Jun 12 2024, 21:17:57) [GCC 11.4.0]
Built on Ubuntu 22.04; same failure on two separate machines. These options build successfully on main (
030b452e
).CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
_CHECK_STACK_SPACE
optimization problems introduced in gh-118322 #120712_CHECK_STACK_SPACE
optimization problems introduced in gh-118322 (GH-120712) #120747The text was updated successfully, but these errors were encountered: