summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-08-27 20:35:00 -0700
committerShentubot <shentubot@google.com>2018-08-27 20:36:10 -0700
commitae648bafda2d82a6641e4a28bed34dae40d426ec (patch)
tree5dc17ed7030585e6b140e1e743474e78e501a2d9 /pkg/sentry
parenta4529c1b5b485f6283367bfdc0e4228bbbd3e51f (diff)
Add command-line parameter to trigger panic on signal
This is to troubleshoot problems with a hung process that is not responding to 'runsc debug --stack' command. PiperOrigin-RevId: 210483513 Change-Id: I4377b210b4e51bc8a281ad34fd94f3df13d9187d
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/sighandling/sighandling.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/sentry/sighandling/sighandling.go b/pkg/sentry/sighandling/sighandling.go
index 25295440c..5bac3a4e1 100644
--- a/pkg/sentry/sighandling/sighandling.go
+++ b/pkg/sentry/sighandling/sighandling.go
@@ -103,7 +103,7 @@ func forwardSignals(k *kernel.Kernel, sigchans []chan os.Signal, start, stop cha
// PrepareForwarding ensures that synchronous signals are forwarded to k and
// returns a callback that starts signal delivery, which itself returns a
// callback that stops signal forwarding.
-func PrepareForwarding(k *kernel.Kernel, enablePanicSignal bool) func() func() {
+func PrepareForwarding(k *kernel.Kernel, skipSignal syscall.Signal) func() func() {
start := make(chan struct{})
stop := make(chan struct{})
@@ -119,8 +119,7 @@ func PrepareForwarding(k *kernel.Kernel, enablePanicSignal bool) func() func() {
sigchan := make(chan os.Signal, 1)
sigchans = append(sigchans, sigchan)
- // SignalPanic is handled by Run.
- if enablePanicSignal && linux.Signal(sig) == kernel.SignalPanic {
+ if syscall.Signal(sig) == skipSignal {
continue
}