And in referencing this NULL pointer, we get our crash.
So gnome-panel is making the assumption that gdk_display_get_screen () does not return 0 ever, which it appears in fact to be doing now when using -vesa. I imagine other gtk apps have similar logic in them, that doesn't check this return code and are also crashing on null pointers.
The attached patch peppers in some null pointer checks that probably should be there if 0 is a valid gdk_display_get_screen() return value. It won't fix the problem but will make it crash earlier on, where the bug actually occurs. I'll look at gdk_display_get_screen() next...
I'm able to reproduce the crash in gnome-panel. In panel_multiscre en_init( ), it calls:
screens = gdk_display_ get_n_screens (display);
which appears to work correctly:
(gdb) print screens
$33 = 1
(gdb) print display
$34 = (GdkDisplay *) 0xa2b000
but then the gdk_screen_ get_n_monitors( ) call seems to be returning a 0:
this then causes a NULL pointer to be set here:
which then propagates down to this point:
int en_width (GdkScreen *screen,
int monitor)
panel_multiscre
{
int n_screen;
n_screen = gdk_screen_ get_number (screen);
g_return_
return geometries [n_screen] [monitor] .width;
}
Breakpoint 1, panel_multiscre en_width (screen=<value optimized out>, monitor=0) at panel-multiscre en.c:180
180 in panel-multiscreen.c
(gdb) print n_screen
$9 = 0
(gdb) print monitor
$10 = 0
(gdb) print geometries[0][0]
Cannot access memory at address 0x0
And in referencing this NULL pointer, we get our crash.
So gnome-panel is making the assumption that gdk_display_ get_screen () does not return 0 ever, which it appears in fact to be doing now when using -vesa. I imagine other gtk apps have similar logic in them, that doesn't check this return code and are also crashing on null pointers.
The attached patch peppers in some null pointer checks that probably should be there if 0 is a valid gdk_display_ get_screen( ) return value. It won't fix the problem but will make it crash earlier on, where the bug actually occurs. I'll look at gdk_display_ get_screen( ) next...