-
Notifications
You must be signed in to change notification settings - Fork 24
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
Panic when tracee calls execve outside of main thread #15
Comments
Great find! This should be possible to fix. Looking into it... |
I got some time to look into this. Since I'm going on a long vacation soon, I'll summarize the problem here for the benefit of my future self (or anyone else who wants to fix this). First,
The core problem is that the non-main thread is getting the Now, complications arise because we handle the The post-exit exec event should really be handled inside of the run loop, not outside of it because there's a chance that it's "recoverable". However, this code was very carefully crafted originally, so this could be a little tricky. |
I hope you don't mind me breaking your program :)
I found that if the tracee calls execve within a thread reverie-ptrace panics.
According to the
clone
man page (man 2 clone
)The panic happens due to this
From my limited understanding the proper way to handle this situation is discarding all threads of this process and resuming the main thread of the process as the only (new) process. I'm not quite sure if that's even possible in your current architecture.
Also, I realize this is an edge case, you might happily ignore it after all.
For reference, my tracee
Compile with
-lpthread
The text was updated successfully, but these errors were encountered: