After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 508070 - gstreamer crashes whilst trying to read .so files in .debug directories
gstreamer crashes whilst trying to read .so files in .debug directories
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 560993 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-01-08 15:00 UTC by Rob Bradford
Modified: 2008-11-16 07:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.54 KB, patch)
2008-01-08 15:02 UTC, Rob Bradford
committed Details | Review

Description Rob Bradford 2008-01-08 15:00:45 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.
Comment 1 Rob Bradford 2008-01-08 15:02:50 UTC
Created attachment 102395 [details] [review]
Patch
Comment 2 Tim-Philipp Müller 2008-01-08 17:38:44 UTC
Excuse me, but I have to ask: isn't the real problem rather that dlopen crashes?
Comment 3 Sebastian Dröge (slomo) 2008-05-29 08:25:03 UTC
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().
Comment 4 Ross Burton 2008-05-29 09:41:05 UTC
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?
Comment 5 Sebastian Dröge (slomo) 2008-05-29 09:53:11 UTC
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...
Comment 6 Ross Burton 2008-05-29 10:02:56 UTC
Well, all users who at some point in time install debug symbols at least.
Comment 7 Sebastian Dröge (slomo) 2008-05-29 10:16:33 UTC
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...
Comment 8 David Schleef 2008-05-29 17:50:28 UTC
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?
Comment 9 Sebastian Dröge (slomo) 2008-05-29 19:07:09 UTC
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?
Comment 10 Sebastian Dröge (slomo) 2008-05-30 07:35:51 UTC
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.
Comment 11 Ross Burton 2008-05-30 08:25:20 UTC
Perfect solution, thanks!
Comment 12 Rob Bradford 2008-05-30 14:02:15 UTC
Thanks!
Comment 13 Sebastian Dröge (slomo) 2008-11-16 07:22:27 UTC
*** Bug 560993 has been marked as a duplicate of this bug. ***