GNOME Bugzilla – Bug 122855
Close Ghex crash
Last modified: 2005-09-05 12:11:21 UTC
Distribution: Slackware Slackware 9.0.0 Package: GHex Severity: critical Version: GNOME2.4.0 2.4.x Gnome-Distributor: GNOME.Org Synopsis: Close Ghex crash Bugzilla-Product: GHex Bugzilla-Component: general Bugzilla-Version: 2.4.x BugBuddy-GnomeVersion: 2.0 (2.4.0.1) Description: Description of the crash: Ghex crashes after closing the application (After opening a HEX file). In a terminal it shows: [tzicatl@tequelech:~$ ] ghex2 Bonobo accessibility support initialized GTK Accessibility Module initialized Atk Accessibilty bridge initialized (ghex2:11076): Gdk-CRITICAL **: file gdkwindow-x11.c: line 2163 (gdk_window_set_title): assertion `title != NULL' failed (ghex2:11076): Gdk-CRITICAL **: file gdkwindow-x11.c: line 2163 (gdk_window_set_title): assertion `title != NULL' failed (ghex2:11076): GnomePrint-CRITICAL **: file gnome-print-job.c: line 264 (gnome_print_job_get_pages): assertion `GNOME_PRINT_JOB_CLOSED (job)' failed Bonobo accessibility support initialized GTK Accessibility Module initialized Atk Accessibilty bridge initialized [tzicatl@tequelech:~$ ] ghex2 Bonobo accessibility support initialized GTK Accessibility Module initialized Atk Accessibilty bridge initialized (ghex2:11080): Gdk-CRITICAL **: file gdkwindow-x11.c: line 2163 (gdk_window_set_title): assertion `title != NULL' failed Bonobo accessibility support initialized GTK Accessibility Module initialized Atk Accessibilty bridge initialized [tzicatl@tequelech:~$ ] Steps to reproduce the crash: 1. Open ghex2 2. Open a HEX binary file 3. Close ghex2 4. ghex2 dies Expected Results: How often does this happen? Every time Additional Information: System is Slackware 9.0beta with latest dorpline packages. Debugging Information: Backtrace was generated from '/usr/bin/ghex2' [New Thread 16384 (LWP 10993)] 0x4117df29 in wait4 () from /lib/libc.so.6
+ Trace 40328
Thread 1 (Thread 16384 (LWP 10993))
------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-09-21 00:36 ------- The original reporter (tzicatl@cuetzalan.com) of this bug does not have an account here. Reassigning to the exporter, unknown@bugzilla.gnome.org. Reassigning to the default owner of the component, jaka@gnu.org.
this must be a problem with your local build/distro. ghex2 works perfectly at what you are describing!
It only happens if accessibility is enabled (/desktop/gnome/interface/accessibility). I think I've worked out what the problem is, though.
Please reopen. OK: problem is that the hack in accessiblegtkhex.c (to decide what AccessibleGtkHex inherits from at run-time) is broken. The AccessibleGtkHex struct is defined: struct _AccessibleGtkHex { GtkAccessible parent; GailTextUtil *textutil; }; However the initial member in an AccessibleGtkHex is not necessarily a GtkAccessible but possibly a larger object (generally, a GailContainer). This means that (ACCESSIBLE_GTK_HEX (obj))->textutil accesses memory meant for the parent class members, in this case (GAIL_CONTAINER (obj))->children. So: (ACCESSIBLE_GTK_HEX (obj))->textutil is set to a (GailTextUtil *), but the same memory is then read as a (GList *), which of cause causes a segfault. (The refcount of the GailTextUtil is read as the next of the GList). I think the way to fix this is to make AccessibleGtkHex an opaque struct and move the GailTextUtil to a private struct using g_type_class_add_private().
Oh: and if AccessibleGtkHex does inherit directly from GtkAccessible then memory for the GailTextUtil * is not allocated, so accessing the textutil member is accessing unallocated memory. Nice.
Created attachment 51826 [details] [review] ghex-2.8.1-segfault_on_exit.patch As suggested above.