-
Notifications
You must be signed in to change notification settings - Fork 654
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
Call to waitpid with pid of -1 can panic #776
Comments
I'm not too familiar with all the signal stuff in POSIX and the I'm wondering if we couldn't get a solid test to run that fails which would let us validate any possible fix for this in the future. |
@xd009642 What platform are you on, as the code is a little different from Android/Linux than other platforms? Additionally have you dug into debugging this anymore at all? It'd be really great to get a reduced test case into our test suite so we can be assured we've fixed the issue once we do. Part of the problem here is that there are 4 different types of calls to
So rather than use an int with ranges pertaining to those, we should use an enum type to clarify this. |
Sorry I forgot all about this issue! I'm on Linux running Fedora. I think I was probably misusing PIDs and continuing or stopping the parent PID instead of the one which issued the stop as I was working on ptrace stop/step on multi-threaded programs. So assuming I was misusing waitpid, I guess this raises the question of whether there should be unwraps in nix? Especially if they can cause panics, or whether this should be replaced with a Result type? |
Well glad you got it sorted out. Part of the problem is that you weren't on a recent version of I'm going to close this issue, but I'll open a new one about revising the API for |
When calling
waitpid(-1, SOME(__WALL))
the following line in src/sys/wait.rs can cause a panic.I'm aware I'm on an old version of nix, and it is on my task list to update. However, this code exists in the latest version as well. Can this panic still happen? And is it something that should be fixed or down to the application author to ensure that such a situation won't occur?
In my case I have a feeling I might be misusing a pid slightly, so it could be fully user error and may or may not be an actual issue. But it's best to flag these things in case it is actually an issue.
Below is my stack trace (the nix section), once again, it's an older version, but it may still have some use!
The text was updated successfully, but these errors were encountered: