Bug#793641: glibc: too few static TLS slots

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun Jul 26 19:35:16 UTC 2015


Control: severity 793641 important
Control: reassign 793689 libc6 2.19-19
Control: reassign 793641 libc6 2.19-19
Control: forcemerge 793641 793689
Control: retitle 793641 glibc: too few static TLS slots
Control: tags 793641 patch

Hi,

On 26.07.2015 17:42, Tom Rauchenwald wrote:
> I can't play mp4 files using totem anymore, only a black screen is displayed.

This looks similar to bug #793641 for vlc thus I'm merging the two.
The link [1] provided there is quite helpful.
The problem is that ffmpeg links against more libraries than libav and some
of those use static TLS.
Using the method from the redhat bug to determine which libraries use TLS reveals:
$ for lib in $(ldd /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so | grep "=>" | sed 's/.*=> \([/a-z0-9\._+-]*\) .*/\1/g' | sort); do echo "readelf -d -W $lib"; readelf -d -W "$lib"; done | egrep 'readelf|STATIC_TLS' | grep -B1 TLS
readelf -d -W /lib/x86_64-linux-gnu/libc.so.6
 0x000000000000001e (FLAGS)              STATIC_TLS
--
readelf -d -W /lib/x86_64-linux-gnu/libm.so.6
 0x000000000000001e (FLAGS)              STATIC_TLS
--
readelf -d -W /lib/x86_64-linux-gnu/libpthread.so.0
 0x000000000000001e (FLAGS)              STATIC_TLS
readelf -d -W /lib/x86_64-linux-gnu/libresolv.so.2
 0x000000000000001e (FLAGS)              STATIC_TLS
readelf -d -W /lib/x86_64-linux-gnu/librt.so.1
 0x000000000000001e (FLAGS)              STATIC_TLS
--
readelf -d -W /usr/lib/x86_64-linux-gnu/libgomp.so.1
 0x000000000000001e (FLAGS)              STATIC_TLS


Previously that was only:
readelf -d -W /lib/x86_64-linux-gnu/libc.so.6
 0x000000000000001e (FLAGS)              STATIC_TLS
--
readelf -d -W /lib/x86_64-linux-gnu/libm.so.6
 0x000000000000001e (FLAGS)              STATIC_TLS
--
readelf -d -W /lib/x86_64-linux-gnu/libpthread.so.0
 0x000000000000001e (FLAGS)              STATIC_TLS
readelf -d -W /lib/x86_64-linux-gnu/librt.so.1
 0x000000000000001e (FLAGS)              STATIC_TLS

Thus it can happen that when totem/vlc tries to load the plugin not enough free
static TLS slots remain.

> I was told on #debian-multimedia to report the bug against ffmpeg.

The only thing ffmpeg could do is not to link against some libraries, losing
some features. I think this would be wrong.

Thus I think the only solution is to increase the DTV_SURPLUS limit in glibc.
Therefore I'm reassigning this bug there.

> I get the following message on the console:
> 
> (totem:7753): GStreamer-WARNING **: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so': dlopen: cannot load any more object with static TLS
> ** Message: Missing plugin: gstreamer|1.0|totem|H.264 decoder|decoder-video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3.1, profile=(string)high, parsed=(boolean)true (H.264 decoder)
> ** Message: Automatic missing codec installation not supported (helper
> script missing)
> 
> The file is present on my system:
> -rw-r--r-- 1 root root 236016 Jul 20 20:29
> /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstlibav.so
> 
> Any help would be appreciated!

This works again for me, after installing a libc6 from glibc rebuilt with
the following patch:
---8<---
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -393,7 +393,7 @@ struct rtld_global
 #define TLS_SLOTINFO_SURPLUS (62)
 
 /* Number of additional slots in the dtv allocated.  */
-#define DTV_SURPLUS    (14)
+#define DTV_SURPLUS    (64)
 
   /* Initial dtv of the main thread, not allocated with normal malloc.  */
   EXTERN void *_dl_initial_dtv;
---8<---

Best regards,
Andreas


1: https://bugzilla.redhat.com/show_bug.cgi?id=1124987



More information about the pkg-multimedia-maintainers mailing list