You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tachyon fails to attach with _ctypes imported #144563
I think this is MacOS-specific -- reproduced it there.
I couldn't reproduce it on Linux:
Details
❯ uv run -p 3.15 --with polars python t.py
78672
^Z
[1]+ Stopped uv run -p 3.15 --with polars python t.py
✦ ❯ uv run -p 3.15 python -m profiling.sampling attach -d 1 78672
Captured 1 001 samples in 1,00 seconds
Sample rate: 1 000,99 samples/sec
Error rate: 0,00
Profile Stats:
nsamples sample% tottime (s) cumul% cumtime (s) filename:lineno(function)
1001/1001 100.0 1.001 100.0 1.001 t.py:6(<module>)
Legend:
nsamples: Direct/Cumulative samples (direct executing / on call stack)
sample%: Percentage of total samples this function was directly executing
tottime: Estimated total time spent directly in this function
cumul%: Percentage of total samples when this function was on the call stack
cumtime: Estimated cumulative time (including time in called functions)
filename:lineno(function): Function location and name
Summary of Interesting Functions:
Functions with Highest Direct/Cumulative Ratio (Hot Spots):
1.000 direct/cumulative ratio, 100.0% direct samples: t.py:(<module>)
Functions with Highest Call Frequency (Indirect Calls):
Functions with Highest Call Magnification (Cumulative/Direct):
if I change it to import polars as pl, attach fails with: Failed to read debug offsets structure from remote process
Sorry then does this means that you cannot reproduce anywhere?
No. I couldn't reproduce only the quoted part (if I change it to import polars as pl).
Importing polars does something to the runtime that Tachyon can no longer attach to it, and this happens only on MacOS, in this specific uv setup.
Before import polars is executed, Tachyon can attach. After it is executed, Tachyon no longer recognizes the Python version.
Also can you try with the current main without uv in the mix?
I'll try to find a uv-free repro, but until then uv is currently necessary with how it manages environments.
This won't reproduce for uv run -p ./python.exe but will reproduce for uv run -p 3.15. Something about different environments, but I couldn't figure out what yet.
Also can you try with the current main without uv in the mix?
This won't reproduce without uv in the mix, and even with uv but on main.
I'd still investigate to understand what exactly does import polars do that Tachyon can no longer attach, unless you recognize this as a fixed regression? Maybe I'll try to bisect if I can't find any sensible idea on what happens here.
❯ uv run -p 3.15 --with polars t.py
<_remote_debugging.RemoteUnwinder object at 0x7cdc00000>
Traceback (most recent call last):
File "/Users/.../Python/cpython/t.py", line 9, in <module>
print(_remote_debugging.RemoteUnwinder(os.getpid()))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
RuntimeError: Can't determine the Python version of the remote process
❯ uv run -p ./python.exe --with polars t.py
<_remote_debugging.RemoteUnwinder object at 0xaeb490020>
<_remote_debugging.RemoteUnwinder object at 0xaeb490020>
Also can you try with the current main without uv in the mix?
This won't reproduce without uv in the mix, and even with uv but on main.
I'd still investigate to understand what exactly does import polars do that Tachyon can no longer attach, unless you recognize this as a fixed regression? Maybe I'll try to bisect if I can't find any sensible idea on what happens here.
I do not recognise the problem from the top of my head but we have fixed a bunch of stuff around the area where we recognise the offsets and the memory map.
uv python also statically compiles everything so perhaps there is dome weird side effect to that
Just to make sure I'm understanding correctly, this only reproduces with 3.15 from uv (i.e., python-build-standalone)? We statically link libpython, but it's complicated astral-sh/python-build-standalone#592
Whatever you do in macOS makes ctypes dlopen the dylib and create multiple mappings without initialising it. Not sure exactly if this is something specific on how you build or is just something that can happen in a regular build but for some reason we don't catch it.
Activity
johnslavik commentedon Feb 7, 2026
I think this is MacOS-specific -- reproduced it there.
I couldn't reproduce it on Linux:
Details
Couldn't reproduce on MacOS.
pablogsal commentedon Feb 7, 2026
Sorry then does this means that you cannot reproduce anywhere?
pablogsal commentedon Feb 7, 2026
@mstarodub does it work if you don't import polars?
pablogsal commentedon Feb 7, 2026
Also can you try with the current main without uv in the mix?
johnslavik commentedon Feb 7, 2026
No. I couldn't reproduce only the quoted part (if I change it to
import polars as pl).Importing
polarsdoes something to the runtime that Tachyon can no longer attach to it, and this happens only on MacOS, in this specific uv setup.Before
import polarsis executed, Tachyon can attach. After it is executed, Tachyon no longer recognizes the Python version.I'll try to find a uv-free repro, but until then uv is currently necessary with how it manages environments.
This won't reproduce for
uv run -p ./python.exebut will reproduce foruv run -p 3.15. Something about different environments, but I couldn't figure out what yet.johnslavik commentedon Feb 7, 2026
This won't reproduce without uv in the mix, and even with uv but on main.
I'd still investigate to understand what exactly does
import polarsdo that Tachyon can no longer attach, unless you recognize this as a fixed regression? Maybe I'll try to bisect if I can't find any sensible idea on what happens here.pablogsal commentedon Feb 7, 2026
CC @zanieb
johnslavik commentedon Feb 7, 2026
Smaller repro:
pablogsal commentedon Feb 7, 2026
I do not recognise the problem from the top of my head but we have fixed a bunch of stuff around the area where we recognise the offsets and the memory map.
uv python also statically compiles everything so perhaps there is dome weird side effect to that
pablogsal commentedon Feb 7, 2026
@johnslavik can you try to repro by using the same commit uv is using for the 3.15 version?
8 remaining items
pythongh-144563: Fix remote debugging with duplicate libpython mappin…
pythongh-144563: Fix remote debugging with duplicate libpython mappin…
zanieb commentedon Feb 8, 2026
Just to make sure I'm understanding correctly, this only reproduces with 3.15 from uv (i.e.,
python-build-standalone)? We statically linklibpython, but it's complicated astral-sh/python-build-standalone#592cc @jjhelmus @geofft
pablogsal commentedon Feb 8, 2026
Whatever you do in macOS makes ctypes dlopen the dylib and create multiple mappings without initialising it. Not sure exactly if this is something specific on how you build or is just something that can happen in a regular build but for some reason we don't catch it.
johnslavik commentedon Feb 8, 2026
3.14 too IIRC. Need to verify and perhaps adjust labels, will do that in a second.
EDIT: Confirmed 3.14.
pythongh-144563: Fix remote debugging with duplicate libpython mappin…
jjhelmus commentedon Feb 9, 2026
On macOS,
python-build-standalonedynamically links libpython which likely explains the behavior. Only on Linux is statically linking done.gh-144563: Fix remote debugging with duplicate libpython mappings fro…
[3.14] pythongh-144563: Fix remote debugging with duplicate libpython…
pythongh-144563: Fix remote debugging with duplicate libpython mappin…
[3.14] gh-144563: Fix remote debugging with duplicate libpython mappi…
pythongh-144563: Fix remote debugging with duplicate libpython mappin…
pythongh-144563: Fix remote debugging with duplicate libpython mappin…