summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-02-28 11:23:00 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-28 11:24:11 -0800
commit322dbfe06bfc3949b7b3a7e7add695c41213ddec (patch)
tree369dddb077fb2c17f15b9ea3b4a3c31e6b7a34b4 /runsc/boot
parent6b4d36e3253238dd72d0861ac1220d147e1de8dd (diff)
Allow to specify a separate log for GO's runtime messages
GO's runtime calls the write system call twice to print "panic:" and "the reason of this panic", so here is a race window when other threads can print something to the log and we will see something like this: panic: log messages from another thread The reason of the panic. This confuses the syzkaller blacklist and dedup detection. It also makes the logs generally difficult to read. e.g., data races often have one side of the race, followed by a large "diagnosis" dump, finally followed by the other side of the race. PiperOrigin-RevId: 297887895
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/config.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/runsc/boot/config.go b/runsc/boot/config.go
index 35391030f..7ea5bfade 100644
--- a/runsc/boot/config.go
+++ b/runsc/boot/config.go
@@ -158,6 +158,9 @@ type Config struct {
// DebugLog is the path to log debug information to, if not empty.
DebugLog string
+ // PanicLog is the path to log GO's runtime messages, if not empty.
+ PanicLog string
+
// DebugLogFormat is the log format for debug.
DebugLogFormat string
@@ -269,6 +272,7 @@ func (c *Config) ToFlags() []string {
"--log=" + c.LogFilename,
"--log-format=" + c.LogFormat,
"--debug-log=" + c.DebugLog,
+ "--panic-log=" + c.PanicLog,
"--debug-log-format=" + c.DebugLogFormat,
"--file-access=" + c.FileAccess.String(),
"--overlay=" + strconv.FormatBool(c.Overlay),