Skip to content

Commit c1a8669

Browse files
authored
Merge pull request #31 from w0nsh/master
Fix caught signals check
2 parents 4f3d42b + bd971d8 commit c1a8669

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/tracer/TraceExecutor.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ std::tuple<TraceAction, int> TraceExecutor::handleTraceeSignal(
201201
else if (signal > 0) {
202202
// Since our child is pid 1 we have to kill on delivery on uncaught
203203
// signal in favour of kernel.
204+
// Mask is shifted by one because the lowest bit of SigCgt mask
205+
// corresponds to signal 1, not 0.
204206
uint64_t caughtSignals =
205-
procfs::readProcFS(tracee.getPid(), procfs::Field::SIG_CGT);
207+
procfs::readProcFS(tracee.getPid(), procfs::Field::SIG_CGT) << 1;
206208
caughtSignals |= IGNORED_SIGNALS;
207209
if ((caughtSignals & (1 << signal)) == 0U) {
208210
outputBuilder_->setKillSignal(signal);

0 commit comments

Comments
 (0)