Skip to content

Commit

Permalink
results: do not treat exit codes above 192 as fatal
Browse files Browse the repository at this point in the history
Real-time signals are in the range 32..64 and regular signals below
that range.  If an exit code is above `128 + 64 = 192`, it does not
denote a terminating signal.

When Snyk code crashes, it returns exit code 255, which should not
be handled as termination by a signal:
```
!!! 2023-10-20 13:12:09	fatal error: caught signal 127
```

Related: https://issues.redhat.com/browse/OSH-368
Closes: csutils#135
  • Loading branch information
kdudka committed Oct 20, 2023
1 parent 9bd612e commit 2e89ad7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/common/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def fatal_error(self, msg, ec=1):
raise FatalError(ec)

def handle_ec(self):
if not self.dying and (128 < self.ec):
if not self.dying and (128 < self.ec < (128 + 64)):
# caught terminating signal, handle synchronous shutdown
self.fatal_error("caught signal %d" % (self.ec - 128), self.ec)

Expand Down

0 comments on commit 2e89ad7

Please sign in to comment.