-
Notifications
You must be signed in to change notification settings - Fork 269
Handle or avoid nested syscalls in preload mode #1455
Copy link
Copy link
Closed
Labels
Type: BugError or flaw producing unexpected resultsError or flaw producing unexpected results
Milestone
Description
The reason our signal test currently doesn't pass for preload-mode is that:
- The virtual process calls kill(getpid(), SIGUSR1)
- Shadow sends a SHD_SHIM_EVENT_SYSCALL request, asking the managed process to call
killitself, with the native pid substituted for the virtual pid. - The shim handler does so, which causes the test's corresponding signal handler to run
- The signal handler makes another syscall (exit) which ends up causing a message to be sent to shadow.
- Shadow is expecting SHD_SHIM_EVENT_SYSCALL_COMPLETE, and panics.
The simplest solution I can think of is to just call kill ourselves from Shadow instead of asking the plugin to do it on our behalf.
If there's a reason to have the managed process do it instead, the next simplest solution I can think of is to add a new message type like SHD_SHIM_EVENT_CONTINUE_WITH_SYSCALL, for cases like this one where Shadow needs to change the syscall parameters but doesn't need to know the result.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: BugError or flaw producing unexpected resultsError or flaw producing unexpected results