GNOME Bugzilla – Bug 314452
Latest GTK+ locks up gnome-terminal
Last modified: 2011-02-04 16:19:18 UTC
Please describe the problem: The patch to gdkscreen.c that initializes the screen resolution to -1 is causing gnome-terminal to lock up when it starts if the locale is not set or set to "C". If I change gdk_screen_init() to set the resolution to 0, the problem goes away: static void gdk_screen_init (GdkScreen *screen) { screen->resolution = 0; } I'm fairly certain this isn't the correct fix, and I think something is confusing either pango or cairo when the resolution is -1, but I haven't been able to figure out what that is yet. Steps to reproduce: 1. Install GTK+ 2.8.1 or 2.8.2 2. Start gnome-terminal without setting LANG 3. The terminal window appears but no toolbars, scrollbars, or terminal text is drawn. Actual results: See above. Expected results: The terminal should function normally. Does this happen every time? Yes. Other information: I also captured a stack trace while it's hung. I don't think it's very useful. I have done numerous tests, and that resolution initialization seems to be the problem. Here is the stack trace: (gdb) bt
+ Trace 62614
Created attachment 51324 [details] [review] correctly initiatialize gdkscreen The attached patch fixes the crash by correctly initializing gdk screen instance. I've also used double value for initialising resolution.
There's really nothing wrong about using gdk_screen_init (GdkScreen *screen). Passing GTypeInstance and the class pointer is of course more correct, but a rather uncommon thing to do.
sorry, I'm not a gobject expert, so I wrote my patch by the book.. My first version was usin gdk_screen_init (GdkScreen *screen) :)
The looks like one more instance where you need to use a double in gdk_screen_get_resolution_libgtk_only().
Fixed by 2005-08-25 Owen Taylor <otaylor@redhat.com> * gdk/gdkscreen.c (gdk_screen_get_type): Use gdk_screen_init as instance_init, not base_init! (#314452, Fix from Frederic Crozat, reported by Joe Marcus Clarke). Trivial cleanup: use -1. rather than 1 for a negative flag value.
*** Bug 314597 has been marked as a duplicate of this bug. ***
*** Bug 314677 has been marked as a duplicate of this bug. ***
*** Bug 315167 has been marked as a duplicate of this bug. ***