Commit e45fdd33 authored by Kenneth Graunke's avatar Kenneth Graunke

run: Make crash handler more robust against late crashes.

We might crash in the final eglTerminate and gbm_device_destroy
functions, or atexit() handlers, at which point we've freed the
current_shader_names array.  We shouldn't access it.
Reviewed-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
parent e637f183
......@@ -274,13 +274,17 @@ int max_threads;
static void
abort_handler(int signo)
{
sigputs("\n => CRASHED <= while processing these shaders:\n\n");
for (int i = 0; i < max_threads; i++) {
if (current_shader_names[i]) {
sigputs(" ");
sigputs(current_shader_names[i]);
sigputs("\n");
if (current_shader_names) {
sigputs("\n => CRASHED <= while processing these shaders:\n\n");
for (int i = 0; i < max_threads; i++) {
if (current_shader_names[i]) {
sigputs(" ");
sigputs(current_shader_names[i]);
sigputs("\n");
}
}
} else {
sigputs("\n => CRASHED <= during final teardown.\n");
}
sigputs("\n");
_exit(-1);
......@@ -746,6 +750,7 @@ main(int argc, char **argv)
free(current_shader_names);
free(shader_test);
free(core.extension_string);
current_shader_names = NULL;
egl_terminate:
eglTerminate(egl_dpy);
......
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