Resolve native symbols for containerized Python processes using the target process root (via /proc/<pid>/root)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Ambito
- devtools, operating-systems
Direzione di ricerca
Inizia dal percorso di risoluzione dei simboli nativi usato da pystack remote --native, in particolare nel punto in cui vengono aperti i percorsi ELF da /proc/<pid>/maps. Verifica il fallimento della ricerca diretta e il fallback a /proc/<pid>/root/<mapped-path> con un processo containerizzato; il lavoro è completo quando i simboli nativi vengono risolti senza modificare il normale comportamento dei percorsi dell’host.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing proposal for this?
- I have searched the existing proposals
Is your feature request related to a problem?
Yes.
When pystack remote --native <pid> attaches to a Python process running inside a container runtime such as
Enroot, Python frames can still be visible, but native C/C++ symbol resolution fail for shared
libraries whose mapped paths only exist inside the container filesystem.
A simplified example:
Python process:
loads libnative_hello.so with ctypes
Inside container:
/tmp/pystack-native-symbols-current/libnative_hello.so => exists
Host running PyStack:
/tmp/pystack-native-symbols-current/libnative_hello.so => does not exist
The host can still see the target process mappings:
grep libnative_hello.so /proc/<pid>/maps
Example mapping:
... /tmp/pystack-native-symbols-current/libnative_hello.so
But resolving that path directly from the host fails:
test -r /tmp/pystack-native-symbols-current/libnative_hello.so => not readable from host
The same file is reachable through the target process root:
test -r /proc/<pid>/root/tmp/pystack-native-symbols-current/libnative_hello.so => readable
Describe the solution you'd like
When PyStack resolves native symbols for a live process, if opening a mapped ELF path from /proc/<pid>/maps fails, retry the lookup through the target process root /proc/<pid>/root/<mapped-path>.
For example, if /proc/<pid>/maps contains:
/tmp/pystack-native-symbols-current/libnative_hello.so
and the host cannot open that path directly, PyStack should try:
/proc/<pid>/root/tmp/pystack-native-symbols-current/libnative_hello.so
This would allow PyStack to resolve native symbols for libraries that are visible to the target process but not directly visible in the host filesystem namespace.
The fallback should only be used when direct path lookup fails, so normal host behavior remains unchanged.
Alternatives you considered
- Require users to bind-mount container paths at the same location on the host.
This works in some controlled cases, but not feasible with the large container stack used today.
- Ask users to run PyStack inside the same container.
This can work for simple cases, but it is not always compatible with attach workflows where the debugger/profiler
runs on the host or from a scheduler/tooling process outside the container
- Lingua principale
- C++
- Stelle
- 1.2k
- Fork
- 72
- Merge medio
- 1g 20h
- PR unite (30g)
- 11
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bloomberg/pystack
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di bloomberg/pystack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google/libultrahdr#485 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
godotengine/godot#123776 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ros2/common_interfaces#344 ·