rpms/gstreamer/F-13 0001-plugins-Do-not-ever-unload-a-plugin-after-calling-in.patch, NONE, 1.1 gstreamer.spec, 1.119, 1.120

Benjamin Otte company at fedoraproject.org
Mon Mar 15 12:10:07 UTC 2010


Author: company

Update of /cvs/pkgs/rpms/gstreamer/F-13
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29965

Modified Files:
	gstreamer.spec 
Added Files:
	0001-plugins-Do-not-ever-unload-a-plugin-after-calling-in.patch 
Log Message:
* Mon Mar 15 2010 Benjamin Otte <otte at redhat.com> 0.10.28-2
- Fix crashes when plugin init fails (#572800)


0001-plugins-Do-not-ever-unload-a-plugin-after-calling-in.patch:
 gstplugin.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- NEW FILE 0001-plugins-Do-not-ever-unload-a-plugin-after-calling-in.patch ---
>From 8fe63000de31bb2bcf346d59230dea06117997cd Mon Sep 17 00:00:00 2001
From: Benjamin Otte <otte at redhat.com>
Date: Fri, 12 Mar 2010 16:42:47 +0100
Subject: [PATCH] plugins: Do not ever unload a plugin after calling into it

This is what can happen in a plugin_init function:
- An element based on GstBaseSink is registered
- Other elements fail to register
- The plugin_init function returns FALSE

Now if this the plugin is the first plugin to link against
libgstbase.so, it will have caused libgstbase.so to be loaded and static
strings from that library will have been added to gobject while
registering GstBaseSink.

So unloading the plugin will cause those strings to go stale and the
next plugin using GstBaseSink will crash. So we must not unload modules
after calling into them ever.

https://bugzilla.redhat.com/show_bug.cgi?id=572800
---
 gst/gstplugin.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/gst/gstplugin.c b/gst/gstplugin.c
index 0f146ae..af62434 100644
--- a/gst/gstplugin.c
+++ b/gst/gstplugin.c
@@ -412,18 +412,22 @@ gst_plugin_register_func (GstPlugin * plugin, const GstPluginDesc * desc,
 
   gst_plugin_desc_copy (&plugin->desc, desc);
 
+  /* make resident so we're really sure it never gets unloaded again.
+   * Theoretically this is not needed, but practically it doesn't hurt.
+   * And we're rather safe than sorry. */
+  if (plugin->module)
+    g_module_make_resident (plugin->module);
+
   if (user_data) {
     if (!(((GstPluginInitFullFunc) (desc->plugin_init)) (plugin, user_data))) {
       if (GST_CAT_DEFAULT)
         GST_WARNING ("plugin \"%s\" failed to initialise", plugin->filename);
-      plugin->module = NULL;
       return NULL;
     }
   } else {
     if (!((desc->plugin_init) (plugin))) {
       if (GST_CAT_DEFAULT)
         GST_WARNING ("plugin \"%s\" failed to initialise", plugin->filename);
-      plugin->module = NULL;
       return NULL;
     }
   }
@@ -646,7 +650,6 @@ gst_plugin_load_file (const gchar * filename, GError ** error)
         GST_PLUGIN_ERROR_MODULE,
         "File \"%s\" appears to be a GStreamer plugin, but it failed to initialize",
         filename);
-    g_module_close (module);
     goto return_error;
   }
 
-- 
1.6.6.1



Index: gstreamer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gstreamer/F-13/gstreamer.spec,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -p -r1.119 -r1.120
--- gstreamer.spec	9 Mar 2010 08:07:18 -0000	1.119
+++ gstreamer.spec	15 Mar 2010 12:10:07 -0000	1.120
@@ -8,7 +8,7 @@
 
 Name: 		%{gstreamer}
 Version: 	0.10.28
-Release: 	1%{?dist}
+Release: 	2%{?dist}
 Summary: 	GStreamer streaming media framework runtime
 
 Group: 		Applications/Multimedia
@@ -39,6 +39,7 @@ BuildRequires:	gcc-c++
 
 # For the GStreamer RPM provides
 Patch1:		gstreamer-inspect-rpm-format.patch
+Patch2:         0001-plugins-Do-not-ever-unload-a-plugin-after-calling-in.patch
 Source1:	gstreamer.prov
 Source2:	macros.gstreamer
 
@@ -107,6 +108,7 @@ with different major/minor versions of G
 %setup -q -n gstreamer-%{version}
 
 %patch1 -p1 -b .rpm-provides
+%patch2 -p1 -b .no-unload
 
 %build
 # 0.10.0: manuals do not build due to an openjade error; disable for now
@@ -229,6 +231,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/rpm/macros.gstreamer
 
 %changelog
+* Mon Mar 15 2010 Benjamin Otte <otte at redhat.com> 0.10.28-2
+- Fix crashes when plugin init fails (#572800)
+
 * Tue Mar 09 2010 Benjamin Otte <otte at redhat.com> 0.10.28-1
 - Update to 0.10.28
 



More information about the scm-commits mailing list