github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/vm/vmimpl/openbsd.go (about) 1 // Copyright 2018 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package vmimpl 5 6 import ( 7 "io" 8 "time" 9 ) 10 11 // DiagnoseOpenBSD sends the debug commands to the given writer which 12 // is expected to be connected to a paniced openbsd kernel. If kernel 13 // just hanged, we've lost connection or detected some non-panic error, 14 // console still shows normal login prompt. 15 func DiagnoseOpenBSD(w io.Writer) ([]byte, bool) { 16 commands := []string{ 17 "", 18 "set $lines = 0", // disable pagination 19 "set $maxwidth = 0", // disable line continuation 20 "show panic", 21 "trace", 22 "show registers", 23 "show proc", 24 "ps", 25 "show all locks", 26 "show malloc", 27 "show all pools", 28 "machine ddbcpu 0", // Traces a couple of first CPUs (enough on GCE farm). 29 "trace", 30 "machine ddbcpu 1", // One of these is likely a dup of the very first trace. 31 "trace", 32 } 33 for _, c := range commands { 34 w.Write([]byte(c + "\n")) 35 time.Sleep(1 * time.Second) 36 } 37 return nil, true 38 }