Unverified Commit 9fe63bdc authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Dump server logs when corrupt fuzzer reports crash (#12612)

Recently we found some signal crashes, but unable to reproduce them.
It is a good idea to dump the server logs when a failure happens.
parent 8cdeddc8
...@@ -169,6 +169,11 @@ foreach sanitize_dump {no yes} { ...@@ -169,6 +169,11 @@ foreach sanitize_dump {no yes} {
incr stat_terminated_by_signal $by_signal incr stat_terminated_by_signal $by_signal
if {$by_signal != 0 || $sanitize_dump == yes} { if {$by_signal != 0 || $sanitize_dump == yes} {
if {$::dump_logs} {
set srv [get_srv 0]
dump_server_log $srv
}
puts "Server crashed (by signal: $by_signal), with payload: $printable_dump" puts "Server crashed (by signal: $by_signal), with payload: $printable_dump"
set print_commands true set print_commands true
} }
......
...@@ -197,6 +197,12 @@ proc srv {args} { ...@@ -197,6 +197,12 @@ proc srv {args} {
dict get $srv $property dict get $srv $property
} }
# Take an index to get a srv.
proc get_srv {level} {
set srv [lindex $::servers end+$level]
return $srv
}
# Provide easy access to the client for the inner server. It's possible to # Provide easy access to the client for the inner server. It's possible to
# prepend the argument list with a negative level to access clients for # prepend the argument list with a negative level to access clients for
# servers running in outer blocks. # servers running in outer blocks.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment