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.
This commit is contained in:
Binbin 2023-09-27 01:08:18 -05:00 committed by GitHub
parent 8cdeddc81c
commit 9fe63bdc80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -169,6 +169,11 @@ foreach sanitize_dump {no yes} {
incr stat_terminated_by_signal $by_signal
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"
set print_commands true
}

View File

@ -197,6 +197,12 @@ proc srv {args} {
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
# prepend the argument list with a negative level to access clients for
# servers running in outer blocks.