Package: fakeroot
Version: 1.21-2
Severity: normal

Hello,

While investigating a hang with fakeroot on hurd-i386, I got the
following backtrace which is a concern for Linux too:

#2  0x0125a241 in __gsync_wait (task=1, addr=19101080, val1=2, val2=0, msec=0, 
flags=0)
    at /usr/src/glibc-2.24/build-tree/hurd-i386-libc/mach/RPC_gsync_wait.c:175
#3  0x010b0743 in __dcigettext (domainname=0x8050740 
<_libc_intl_domainname@@GLIBC_2.2.6> "libc",
    msgid1=0x8051d88 "undefined symbol: acl_get_fd", msgid2=0x0, plural=0, n=0, 
category=5) at dcigettext.c:527
#4  0x010af776 in __dcgettext (domainname=0x8050740 
<_libc_intl_domainname@@GLIBC_2.2.6> "libc",
    msgid=0x8051d88 "undefined symbol: acl_get_fd", category=5) at 
dcgettext.c:47
#5  0x0124e427 in __dlerror () at dlerror.c:94
#6  0x01035ae3 in load_library_symbols () from 
/usr/lib/i386-gnu/libfakeroot/libfakeroot-tcp.so
#7  0x01035cc3 in tmp___fxstat64 () from 
/usr/lib/i386-gnu/libfakeroot/libfakeroot-tcp.so
#8  0x01036cd6 in __fxstat64 () from 
/usr/lib/i386-gnu/libfakeroot/libfakeroot-tcp.so
#9  0x010ad831 in _nl_load_locale_from_archive (category=category@entry=0, 
namep=namep@entry=0x200399c) at loadarchive.c:211
#10 0x010ac45b in _nl_find_locale (locale_path=0x0, locale_path_len=0, 
category=category@entry=0, name=0x200399c) at findlocale.c:154
#11 0x010abde7 in setlocale (category=0, locale=0x804c2e4 "") at setlocale.c:417
#12 0x0804947f in main (argc=2, argv=0x2003ad4) at programs/locale.c:191

What happens is that the fakeroot initialization gets triggered from an
__fxtstat64 call made by _nl_load_locale_from_archive.  The issue is
that setlocale has locked __libc_setlocale_lock, and __dcigettext tries
to lock it again. On Linux, that just returns EDEADLK which is then
ignored. When __dcigettext unlocks __libc_setlocale_lock, it does get
unlocked, and execution can continue with _nl_load_locale_from_archive
doing its work with __libc_setlocale_lock unlocked, which is unsafe!

libfakeroot should not assume that the redirect calls it gets are made
in a context where anything can be done, and notably
load_library_symbols can't necessarily be done there, it should rather
be done from a library constructor or something like that.

Samuel

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), 
(500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages fakeroot depends on:
ii  libc6        2.24-5
ii  libfakeroot  1.21-2

fakeroot recommends no packages.

fakeroot suggests no packages.

-- no debconf information

-- 
Samuel
 Cliquez sur le lien qui suit dans ce mail...vous n'avez plus qu'a vous
 inscrire pour gagner de l'argent en restant connecte....et puis faites
 passer le message et vous gagnerez encore plus d'argent ...
 -+- AC in NPC : Neuneu a rencontré le Pere Noël -+-

Reply via email to