python / python/cpython

Tachyon: Permission error on subprocesses are not propagated back to the user

Aperta
#155,031 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

stdlib topic-profiling type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Bug report

Bug description:

Running python -m profiling.sampling run --subprocesses <...> on some code that spawns subprocesses will ignore any PermissionError thrown in the child processes when doing a attach to the process, since stderr is forwarded to /dev/null, and the process exits with error code 0 (my mistake, it does exit with exit code 1, just the call is in the helper function). This causes confusion as the only user-visible effect is that the subprocesses sampling data files are not created.

This can happen when the user / python executable / kernel doesn't have the CAP_SYS_PTRACE capability, so the run subcommand works fine, but any attach will fail, which is what happens with the child processes.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-155032

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Iniziate da Lib/profiling/sampling/_child_monitor.py nel percorso di attach del sottoprocesso e da Lib/profiling/sampling/main.py nel punto di ingresso del comando run. Riproducete il comando su Linux senza CAP_SYS_PTRACE, quindi verificate che un PermissionError del processo figlio sia visibile all’utente invece di apparire soltanto come dati di sampling mancanti. La PR gh-155032 è già collegata a questo issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.