Replace shell execution with no-shell subprocess/execv#12
Merged
Conversation
The launcher built drrun/postprocess commands as shell strings via srutils.shell_system and interpolated user input (--so_name, paths) unquoted — a shell-injection and quoting hazard. The native client did the same with a bare system() pointing at a hardcoded, machine-specific preprocess.py path that does not exist in the OSS layout (so rich-mode boundary detection silently never ran). Python (main.py): build drrun and postprocess invocations as argument lists and run them with subprocess.run (no shell). boundary_detection.py: run FunSeeker via subprocess.run with an argv list, merging stderr into stdout to preserve the previous parsing/error behavior. Drop the srutils dependency entirely (pyproject/ci/dev.sh/build-bundle/docs). Native client (rtrace.cc): replace system() with a fork + execvp helper (no shell); take the interpreter and cache directory as --python and --cache_dir droptions passed by main.py instead of hardcoded paths; and unlock stats_mutex on the early return in event_module_load.
WS2 added <sys/wait.h> to rtrace.cc for waitpid(); it transitively includes <signal.h>, whose siginfo-consts.h defines an enum constant TRAP_BRANCH that collides with our types.h TRAP_BRANCH, breaking the bundle build. Namespace the trap constants as RTRACE_TRAP_*.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The launcher built drrun/postprocess commands as shell strings via srutils.shell_system and interpolated user input (--so_name, paths) unquoted — a shell-injection and quoting hazard. The native client did the same with a bare system() pointing at a hardcoded, machine-specific preprocess.py path that does not exist in the OSS layout (so rich-mode boundary detection silently never ran).
Python (main.py): build drrun and postprocess invocations as argument lists and run them with subprocess.run (no shell). boundary_detection.py: run FunSeeker via subprocess.run with an argv list, merging stderr into stdout to preserve the previous parsing/error behavior. Drop the srutils dependency entirely (pyproject/ci/dev.sh/build-bundle/docs).
Native client (rtrace.cc): replace system() with a fork + execvp helper (no shell); take the interpreter and cache directory as --python and --cache_dir droptions passed by main.py instead of hardcoded paths; and unlock stats_mutex on the early return in event_module_load.