Tachyon: Permission error on subprocesses are not propagated back to the user
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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 (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.0
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Lib/profiling/sampling/_child_monitor.py at the subprocess attach path and Lib/profiling/sampling/main.py at the run command entry point. Reproduce the command on Linux without CAP_SYS_PTRACE, then verify that a child-process PermissionError is visible to the user rather than only appearing as missing sampling data. PR gh-155032 is already linked to this issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100