[gstreamer-bugs] [Bug 391278] g_thread_init() called too late, possibly causing memory corruptions
GStreamer (bugzilla.gnome.org)
bugzilla-daemon at bugzilla.gnome.org
Fri Jan 5 08:40:00 PST 2007
Do not reply to this via email (we are currently unable to handle email
responses and they get discarded). You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=391278
GStreamer | gstreamer (core) | Ver: HEAD CVS
Tim-Philipp Müller changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #79172|none |rejected
Flag| |
Status|UNCONFIRMED |RESOLVED
Component|don't know |gstreamer (core)
Resolution| |FIXED
Summary|gst programmes don't call |g_thread_init() called too
|g_thread_init early enough |late, possibly causing
| |memory corruptions
Target Milestone|HEAD |0.10.12
------- Comment #3 from Tim-Philipp Müller 2007-01-05 16:38 UTC -------
Related discussion on gtk-devel-list:
http://mail.gnome.org/archives/gtk-devel-list/2007-January/msg00005.html
Even if this gets resolved in GLib in future, it still affects all GStreamer
appplications using GLib-2.10.x and GLib-2.12.x.
Not using the constructor hack, for three reasons:
- it breaks applications which do g_thread_init (NULL) unconditionally
first thing in main(), such as totem
- it hides the problem on most systems, so applications are much less
likely to get fixed
- application authors and people deploying applications should be
aware the problem exists for current and previous versions of
GStreamer and GLib
Committed the following for now, I think it's the best we can do:
2007-01-05 Tim-Philipp Müller <tim at centricular dot net>
* gst/gst.c: (gst_init_get_option_group), (gst_init_check),
(init_pre):
Call g_thread_init() first thing in gst_init() / gst_check_init().
When initialisation is done via gst_init_get_option_group() and
GOption parsing, issue a warning if the GLib thread system has not
been initialised yet by the time gst_init_get_option_group() is
called, as it's quite likely other GLib functions such as
g_option_context_new() have been called already then, and
g_thread_init() must be called before any other GLib function. The
application in question must be fixed in that case, since memory
corruption might happen otherwise.
We issue the warning because even if the GLib folks decide to work
around the problem on their end in future, this is still an issue
with all GLib versions >= 2.10.0, so we should warn until we depend
on a GLib version we know to be safe.
Closes bug #391278.
--
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
More information about the Gstreamer-bugs
mailing list