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

Wrapper (Unix): use SIGSTOP instead of SIGTSTP to suspend subprocesses #5486

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

davidpanderson
Copy link
Contributor

The former can't be caught, the latter can.
The goal was to support wrapped program that are themselves wrappers of some sort.

Problem (as reported in #5840): contrary to documentation, SIGTSTP doesn't actually stop processes not connected to a TTY (at least on Linux - I checked).

This PR changes the default signal back to SIGSTOP, but provides the option (via a --use_tstp cmdline arg to wrapper) to use SIGTSTP instead.

Fixes #5840

The former can't be caught, the latter can.
The goal was to support wrapped program that are themselves wrappers of some sort.

The problem (as reported in #5840) is that, contrary to documentation,
SIGTSTP doesn't actually stop processes not connected to a TTY
(at least on Linux - I checked).

This PR changes the default signal back to SIGSTOP,
but provides the option (via a --use_tstp cmdline arg to wrapper)
to use SIGTSTP instead.
@AenBleidd
Copy link
Member

@davidpanderson,
mingw and windows builds are failing with the next errors (both are basically the same):

         D:\a\boinc\boinc\samples\wrapper\wrapper.cpp(1007,9): error C2660: 'suspend_or_resume_descendants': function does not take 2 arguments [D:\a\boinc\boinc\win_build\wrapper.vcxproj]
         D:\a\boinc\boinc\samples\wrapper\wrapper.cpp(1009,9): error C2660: 'suspend_or_resume_process': function does not take 3 arguments [D:\a\boinc\boinc\win_build\wrapper.vcxproj]
../samples/wrapper/wrapper.cpp:1007:54: error: too many arguments to function ‘void suspend_or_resume_descendants(bool)’
 1007 |         suspend_or_resume_descendants(false, use_tstp);
      |                                                      ^
In file included from ../samples/wrapper/wrapper.cpp:84:
../lib/proc_control.h:38:[13](https://github.com/BOINC/boinc/actions/runs/7453969303/job/20280387980?pr=5486#step:7:14): note: declared here
   38 | extern void suspend_or_resume_descendants(bool resume);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../samples/wrapper/wrapper.cpp:1009:55: error: too many arguments to function ‘void suspend_or_resume_process(int, bool)’
 1009 |         suspend_or_resume_process(pid, false, use_tstp);
      |                                                       ^
In file included from ../samples/wrapper/wrapper.cpp:84:
../lib/proc_control.h:39:13: note: declared here
   39 | extern void suspend_or_resume_process(int pid, bool resume);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~

@davidpanderson
Copy link
Contributor Author

Oops! Fixed now

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (95adf93) 10.84% compared to head (86f6f17) 10.84%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5486   +/-   ##
=========================================
  Coverage     10.84%   10.84%           
  Complexity     1068     1068           
=========================================
  Files           279      279           
  Lines         36158    36158           
  Branches       8356     8356           
=========================================
  Hits           3920     3920           
  Misses        31844    31844           
  Partials        394      394           
Files Coverage Δ
lib/proc_control.cpp 0.00% <0.00%> (ø)

@AenBleidd AenBleidd merged commit 60c6d6b into master Jan 9, 2024
85 of 86 checks passed
@AenBleidd AenBleidd deleted the dpa_sigstop branch January 9, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

BOINC wrapper does not suspend task processes
2 participants