Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 941160 - sys-apps/portage+dev-lang/python:3.13[jit]: emerge freezes
Summary: sys-apps/portage+dev-lang/python:3.13[jit]: emerge freezes
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-08 12:09 UTC by Aliaksei Urbanski
Modified: 2024-10-29 20:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge sys-apps/portage dev-lang/python:3.13 --info (emerge-portage+python-info.txt,11.59 KB, text/plain)
2024-10-08 12:14 UTC, Aliaksei Urbanski
Details
backtrace (backtrace.log,11.18 KB, text/plain)
2024-10-08 13:48 UTC, Aliaksei Urbanski
Details
thread apply all bt full (backtrace-full.log,56.61 KB, text/plain)
2024-10-08 13:50 UTC, Aliaksei Urbanski
Details
Python stack (python-stack.txt,3.70 KB, text/plain)
2024-10-08 17:23 UTC, Aliaksei Urbanski
Details
pdb where (pdb-where.txt,2.49 KB, text/plain)
2024-10-08 17:25 UTC, Aliaksei Urbanski
Details
pdb where (another attempt) (pdb-where-2.txt,3.81 KB, text/plain)
2024-10-08 17:37 UTC, Aliaksei Urbanski
Details
pdb where (3rd attempt) (pdb-where-3.txt,2.52 KB, text/plain)
2024-10-08 17:49 UTC, Aliaksei Urbanski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aliaksei Urbanski 2024-10-08 12:09:45 UTC
Hello everyone,

I've found that when I try to run emerge using Python 3.13 that is built with experimental JIT, emerge gets stuck while calculating dependencies.

I suppose this may be a quite painful issue for those who tried to migrate to Python 3.13 with JIT and for some reason disabled previous Python versions support for portage.

Best regards!

Reproducible: Always

Steps to Reproduce:
1. USE="jit python_targets_python3_13" emerge dev-lang/python:3.13 sys-apps/portage -1av
2. Add/move python3.13 to the top of the list at /etc/python-exec/python-exec.conf
3. emerge world -DNuav
Actual Results:  
emerge freezes when calculating dependencies

Expected Results:  
emerge calculates dependencies and shows the results
Comment 1 Aliaksei Urbanski 2024-10-08 12:14:19 UTC
Created attachment 905107 [details]
emerge sys-apps/portage dev-lang/python:3.13 --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-08 12:21:39 UTC
I've not yet played with the JIT at all, so limited ideas to start with.

If you attach gdb & pdb, can you get both backtraces?
Comment 3 Aliaksei Urbanski 2024-10-08 13:48:11 UTC
Created attachment 905108 [details]
backtrace
Comment 4 Aliaksei Urbanski 2024-10-08 13:50:37 UTC
Created attachment 905109 [details]
thread apply all bt full
Comment 5 Aliaksei Urbanski 2024-10-08 17:21:07 UTC
By the way, emerge world -uav doesn't freeze without -DN.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-08 17:22:41 UTC
How about pdb?
Comment 7 Aliaksei Urbanski 2024-10-08 17:23:32 UTC
Created attachment 905111 [details]
Python stack
Comment 8 Aliaksei Urbanski 2024-10-08 17:25:12 UTC
Created attachment 905112 [details]
pdb where
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-08 17:36:52 UTC
USE=jit is masked so not critical.
Comment 10 Aliaksei Urbanski 2024-10-08 17:37:59 UTC
Created attachment 905113 [details]
pdb where (another attempt)
Comment 11 Aliaksei Urbanski 2024-10-08 17:49:10 UTC
Created attachment 905114 [details]
pdb where (3rd attempt)

While it's frozen, python3.13 consumes 100% time of a single CPU core.

As you can see, first and third traces are similar while the second one is quite different from them.
Comment 12 Zac Medico gentoo-dev 2024-10-08 22:28:25 UTC
If you export PYTHON_JIT=0 does it suppress the problem in emerge? It seems pretty obvious that it should, but I'm just looking for confirmation.
Comment 13 Aliaksei Urbanski 2024-10-08 23:22:27 UTC
> If you export PYTHON_JIT=0 does it suppress the problem in emerge?
I confirm that it suppresses the problem.
With PYTHON_JIT=0 emerge doesn't freeze.
Comment 14 Zac Medico gentoo-dev 2024-10-09 23:05:57 UTC
Sounds like is maybe more of a python issue than a portage issue, and it might correct itself over time.
Comment 15 Aliaksei Urbanski 2024-10-09 23:33:57 UTC
> Sounds like is maybe more of a python issue than a portage issue, and it might correct itself over time.
That's true. I believe I should report this issue to the Python upstream.
Actually, it's not the only one that I found so far.
Python 3.13 with JIT gets stuck in a few more cases.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-10 14:01:05 UTC
Please do report those upstream (and link them here), ideally for simpler applications first, thank you!
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-29 20:18:42 UTC
I see https://github.com/python/cpython/issues/126127 at least...