After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 397139 - glib-2.12.8 breaks ABI
glib-2.12.8 breaks ABI
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.12.x
Other FreeBSD
: Normal blocker
: ---
Assigned To: gtkdev
gtkdev
: 397117 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-16 05:51 UTC by Joe Marcus Clarke
Modified: 2011-02-18 15:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
a patch (5.22 KB, patch)
2007-01-16 14:02 UTC, Matthias Clasen
none Details | Review

Description Joe Marcus Clarke 2007-01-16 05:51:02 UTC
The addition of the gettime member to the _GThreadFunctions struct breaks the GLib ABI.  The result is that some programs that make use of GTimer need to be rebuilt against the new GLib.  One such program is evince.  If you start evince after upgrading to glib-2.12.8, you will get the following crash:

% gdb evince


(gdb) r
Starting program: /usr/local/bin/evince 
warning: Unable to get location for thread creation breakpoint: generic error
[New LWP 100138]
[New Thread 0x80b5000 (LWP 100138)]

Program received signal SIGSEGV, Segmentation fault.

Thread 134959104 (LWP 100138)

  • #0 ??
  • #1 IA__g_timer_elapsed
    at gtimer.c line 148
  • #2 gtk_toolbar_size_allocate
    at gtktoolbar.c line 1738
  • #3 IA__g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #4 g_type_class_meta_marshal
    at gclosure.c line 567
  • #5 IA__g_closure_invoke
    at gclosure.c line 490
  • #6 signal_emit_unlocked_R
    at gsignal.c line 2370
  • #7 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #8 IA__g_signal_emit
    at gsignal.c line 2243
  • #9 IA__gtk_widget_size_allocate
    at gtkwidget.c line 3063

If evince is simply rebuilt, this crash goes away.  Reverting the gtimer.c and gthread-related diffs between 2.12.7 and 2.12.8 also resolve the problem.

Evolution also refuses to start after upgrading to 2.12.8.  The error seen is:

GLib-ERROR **: gmem.c:154: failed to allocate 1365219474 bytes
aborting...
Abort (core dumped)
Comment 1 Tor Lillqvist 2007-01-16 10:07:33 UTC
Does evince register its own GThreadFunctions in the call to g_thread_init() or g_thread_init_with_errorcheck_mutexes()?
Comment 2 Jeremy Messenger 2007-01-16 12:29:53 UTC
*** Bug 397117 has been marked as a duplicate of this bug. ***
Comment 3 Christian Persch 2007-01-16 12:46:21 UTC
No, evince uses g_thread_init (NULL).
Comment 4 Matthias Clasen 2007-01-16 13:03:40 UTC
Hmm, too bad. I wouldn't have expected this to break.
In that case, we'll have to move gettext out of the struct
Comment 5 Matthias Clasen 2007-01-16 14:02:28 UTC
Created attachment 80399 [details] [review]
a patch

Here is a patch that moves the gettime function out of the GThreadFunctions struct
and into its own variable. That should fix the abi breakage.

Does this work for you ?
Comment 6 Loïc Minier 2007-01-16 15:47:35 UTC
Matthias, will you also re-add a clock_gettime symbol to glib.so?

I also wonder whether not linking against gthread anymore isn't an ABI breakage in itself: if people have been linking their gthread + glib using programs since glib 2.12.2 with only -lglib, it worked but broke in 2.12.8.

Perhaps you would like to continue linking to gthread until the end of the 2.12.x series now, and re-introduce the clock_gettime in glib.so?
Comment 7 Matthias Clasen 2007-01-16 16:00:59 UTC
no, this is a total misunderstanding. 

clock_gettime was never exported from glib. It is in librt, and due to an oversight, glib got linked against librt for a short time. That does not mean we have an obligation to continue that mistake. 

clock_gettime is not in any glib headers. People who use clock_gettime need to 
include sys/time.h and link against librt.
Comment 8 Joe Marcus Clarke 2007-01-16 18:18:24 UTC
This patch does fix the crashes.
Comment 9 Matthias Clasen 2007-01-16 23:19:41 UTC
2007-01-16  Matthias Clasen  <mclasen@redhat.com>

        * glib/gthread.h:
        * glib/gthread.c:
        * glib/glib.symbols: Revert an accidental ABI break by
        moving gettime out of the GThreadFunctions struct and making
        it a separate variable.  (#397139, Joe Marcus Clarke)

        * gthread/*.c: Adapt.

Comment 10 younker 2007-01-18 01:00:24 UTC
I upgrade to glib 2.12.9 and gtk+ 2.10.8, now gnome-panel refuse to start,
It seems the memory allocation failed. 

Is this caused by this problem?
Comment 11 Matthias Clasen 2007-01-18 01:09:09 UTC
No, thats an unrelated double-free bug in gtk+ 2.10.8 that has been fixed
already in svn, but not in a release yet.