ProcMountNs() fails in multithreaded application
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
I RTFM'ed setns and it seems that calling it from a multi threaded application results in EINVAL(kernel doesn't allow switching of mount namespace in a multi threaded application). I was writing a multi threaded application where each BPF code runs in a different thread and USDT fails to find the probes because of the mentioned reason. Should bcc additionally look for files under the prefix /proc/xxx/root/ when setns fails ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the ProcMountNs() entry point and trace the setns failure path used during USDT probe lookup. Reproduce the multithreaded case described in the issue, then determine whether lookup through /proc/xxx/root is appropriate when setns returns EINVAL; done means probes are found without breaking existing namespace handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100