Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /proc/self/task or /proc/self/status when /proc/self/stat returns 0 #15

Open
ptrcnull opened this issue Nov 12, 2023 · 1 comment
Open

Comments

@ptrcnull
Copy link

( follow-up to #3 )

in some weird cases, such as running qemu-user ( still debugging this issue ), /proc/self/stat returns mostly empty values, while /proc/self/task and /proc/self/status have the correct values:

$ cat /proc/self/stat
18477 (cat) R 16603 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21552080 0 0 0 0 0 70368752569616 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
$ cat /proc/self/status | grep Thread
Threads:	2
$ ls /proc/self/task
18505  18507
$ 

it would be nice to have a fallback to those, in case they have correct values and /proc/self/stat doesn't

@Freaky
Copy link
Collaborator

Freaky commented Nov 16, 2023

I'd like to have a better idea what's going on before arbitrarily falling back to a different kernel interface in the hope that it'll give the right answer where a previous one didn't.

Is there something particularly about /proc/self/stat that might render it less reliable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants