I ran into a timeout in test-case gdb.debuginfod/solib-with-dwz.exp.
GDB times out like this:
...
Download failed: Timer expired. \
Continuing without source file solib-with-dwz-bar.c.
...
My theory is that the download fails because debuginfod becomes unresponsive,
because it's stuck trying to write output into some buffer that is already
full.
Fix this by regularly draining debuginfod output in the test-case, using a new
proc drain_debuginfod.
Debuginfod is run with "-vvvv", which makes it rather verbose, and dropping
that also fixes the timeouts, but it might be useful for debugging, so I went
with the output draining method, and left the "-vvvv" as is.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33901
unresolved "start debuginfod server"
return
}
+ drain_debuginfod
# Point the client to the server.
setenv DEBUGINFOD_URLS $url
# Now GDB is configured, load the executable.
gdb_load $::binfile
+ drain_debuginfod
if { ![runto_main] } {
return
}
+ drain_debuginfod
# This test relies on reading address zero triggering a SIGSEGV.
# If address zero is readable then give up now.
gdb_test "continue" \
"\r\n$crash_line_num\\s+[string_to_regexp {*ptr = 0; /* Crash here. */}]"
+ drain_debuginfod
set call_line_num [gdb_get_line_number "Call line" $::srcfile3]
gdb_test "list" \
"\r\n$call_line_num\\s+[string_to_regexp {cb (); /* Call line. */}]\r\n.*" \
"list default location in $::srcfile3"
+ drain_debuginfod
set list_line_num [gdb_get_line_number "Second line to list" $::srcfile3]
exp_continue
}
}
+ drain_debuginfod
# Use 'maint info symtabs' to list all symtabs and find the
# symtabs that are associated with libbar.so (actually with the
return $url
}
+# Drain output from debuginfod.
+
+proc drain_debuginfod {} {
+ verbose -log "drain debuginfod output --- start"
+ expect {
+ -i $::debuginfod_spawn_id ".*" {
+ }
+ }
+ verbose -log "drain debuginfod output --- end"
+}
+
# If the global debuginfod_spawn_id exists, then kill that process and unset
# the debuginfod_spawn_id global. This can be used to shutdown the
# debuginfod server.