From: RĂ©mi Denis-Courmont Date: Sat, 27 Mar 2010 14:20:28 +0000 (+0200) Subject: Work around cleanup handler bug in kfile plugin X-Git-Tag: 1.1.0-pre1~297 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=9cca111d2805ecab4ddcb646703c1852f9717a7b Work around cleanup handler bug in kfile plugin Parental advisory: explicit hack. If kfilemodule is loaded, bypass run cleanup handlers. Library really should not use this C feature in any case (IMHO). And I find it outright idiotic for a (Qt4) plugin to use cleanup handlers. This is causing so many crash reports that it's not funny anymore: https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/408719 --- diff --git a/bin/Makefile.am b/bin/Makefile.am index 2bb42944ff..69e3773a65 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -46,6 +46,8 @@ vlc_static_LDFLAGS = $(vlc_LDFLAGS) -no-install -static if HAVE_WIN32 vlc_LDADD += -lwininet vlc_win32_rc.$(OBJEXT) vlc_DEPENDENCIES += vlc_win32_rc.$(OBJEXT) +else +vlc_LDADD += -ldl endif .rc.in.rc: $(top_builddir)/config.status diff --git a/bin/vlc.c b/bin/vlc.c index 182a7edc6c..1c64656a23 100644 --- a/bin/vlc.c +++ b/bin/vlc.c @@ -47,6 +47,7 @@ extern char *FromLocale (const char *); #include #include #include +#include /***************************************************************************** * main: parse command line, start interface and spawn threads. @@ -172,5 +173,14 @@ int main( int i_argc, const char *ppsz_argv[] ) for (int i = 1; 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; }