[vlc-devel] [PATCH 1/1] Prevent loading KDE plugins for Qt4

Rémi Denis-Courmont remi at remlab.net
Sun Jul 18 00:26:48 CEST 2010


The KDE I/O library has some static C++ objects. Their destructor hook
into the atexit() procedures, and crashes VLC all the time. This is
filed as KDE bug #234484. But somewhat expectedly, nobody seems to care
on the KDE side (VLC not being a KDE application, I guess). This patch
simply makes dlopen() fail to load KDE plugins. Unfortunately, VLC then
looks rather ugly inside KDE.

This patch is already in the 1.1-bugfix branch.
Fixes: LP#408719, Debian #580396.

---
 bin/override.c |   11 +++++++++++
 bin/vlc.c      |    9 ---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/bin/override.c b/bin/override.c
index 02402d5..e19ed2b 100644
--- a/bin/override.c
+++ b/bin/override.c
@@ -280,6 +280,17 @@ int (*XSetIOErrorHandler (int (*handler) (Display *))) (Display *)
     return CALL(XSetIOErrorHandler, handler);
 }
 #endif
+
+/*** Buggy shared objects ***/
+#include <string.h>
+
+void *dlopen (const char *path, int flag)
+{
+    if (strstr (path, "/gui_platform/libkde.so"))
+        return NULL; /* Oh no, not that one! */
+    return CALL(dlopen, path, flag);
+}
+
 #else
 void vlc_enable_override (void)
 {
diff --git a/bin/vlc.c b/bin/vlc.c
index ab421f0..5b2259d 100644
--- a/bin/vlc.c
+++ b/bin/vlc.c
@@ -199,14 +199,5 @@ int main( int i_argc, const char *ppsz_argv[] )
     for (int i = 2; i < argc; i++)
         LocaleFree (argv[i]);
 
-#ifdef RTLD_NOLOAD
-    /* Avoid crash in KIO scheduler cleanup. */
-    /* This is ugly, but we get way too many crash reports due to this. */
-    if (dlopen ("libkfilemodule.so", RTLD_LAZY|RTLD_LOCAL|RTLD_NOLOAD) != NULL)
-    {
-        fprintf (stderr, "KFile plugin present. Unclean shutdown!\n");
-        _exit (0);
-    }
-#endif
     return 0;
 }
-- 
1.7.1




More information about the vlc-devel mailing list