GNOME Bugzilla – Bug 508070
gstreamer crashes whilst trying to read .so files in .debug directories
Last modified: 2008-11-16 07:22:27 UTC
If there is a .debug directory (containing debugging symbols for the plugins) within the plugin directory gstreamer will attempt to dlopen() the elf files inside it. Unfortunately dlopen()ing these files leads to a crash. This patch avoids this by ignoring .debug directories when building the registry. The patch is against CVS HEAD but was backported to 0.10.4 for testing and worked fine.
Created attachment 102395 [details] [review] Patch
Excuse me, but I have to ask: isn't the real problem rather that dlopen crashes?
I'm closing this bug now as we can't add workarounds for all known files that might crash dlopen()... and this looks really much more like a dlopen bug().
I agree that the root cause is a problem with dlopen(), but considering a large proportion of users will have .debug/ directories in their plugin directory and skipping it would result in a 50% drop in the time taken to scan, surely this is a good idea anyway?
Why would a large proportion of users have a .debug directory in their plugin directory? I mean, how are these .debug directories created? :) Are some distributions installing the debug symbols of packages there? It might make sense to skip all directories that start with a dot then maybe...
Well, all users who at some point in time install debug symbols at least.
Well, for Debian based system's they're placed in /usr/lib/debug/... Simply skipping all directories with a dot in the beginning would break uninstalled gstreamer (plugins are in .libs directories) and simply skipping only .debug directories sounds wrong too. Tomorrow someone will come who wants .dbg directories skipped, etc...
I'd prefer not recursing into subdirectories altogether. Other implementations of PATH environment variables don't recurse. However, not recursing breaks uninstalled operation. Dare I suggest a separate GST_PLUGIN_PATH_RECURSE environment variable?
Agreed, for 0.11 we should not recurse into directories anymore. Problem is that we need something for 0.10 it seems, the environment variable won't be very useful IMHO as what is needed is something that works by default. Maybe we should just skip .debug directories for now, add whatever other people want later and don't recurse at all in 0.11 ;) What do you think?
Ok, I've committed your patch and added a FIXME for 0.11 to not recurse into directories. 2008-05-30 Sebastian Dröge <slomo@circular-chaos.org> Patch by: Rob Bradford <rob at robster dot org dot uk> * gst/gstregistry.c: (gst_registry_scan_path_level): Don't recurse into .debug directories as some distros install the debugging symbols next to the plugins in .debug directories and dlopen() crashes on them sometimes. Fixes bug #508070. Add FIXME for 0.11 to not recurse into directories at all because it's very inconsistent to the behaviour of other PATH environment variables.
Perfect solution, thanks!
Thanks!
*** Bug 560993 has been marked as a duplicate of this bug. ***