Your message dated Tue, 29 Jan 2019 16:04:24 +0000
with message-id <e1govs8-0008yr...@fasolo.debian.org>
and subject line Bug#918742: fixed in fakechroot 2.19-3.2
has caused the Debian Bug report #918742,
regarding Initialization loop/deadlock when used with jemalloc
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
918742: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918742
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: src:fakechroot
Version: 2.19-3
Severity: serious

Hi again,

So jemalloc 5.1.0-2 was recently uploaded to unstable. The build
currently fails due to the explicit dependency on libjemalloc1 (cf.
#918741), but as soon as this gets fixed, another issue is uncovered:

While building this package, the jemalloc test deadlocks, and the build
hangs. This can be easily reproduced as follows:
  apt install libfakechroot libjemalloc2
  LD_PRELOAD="libjemalloc.so.2 libfakechroot.so" /bin/true
  <hangs>

The test isn't spurious but an actual issue. One could do:
  fakechroot <binary compiled with -ljemalloc>
...and still hit this bug.

The bug is effectively the same as #872669, which I had previously
resolved by disabling jemalloc's --enable-prof. This option was
re-enabled in 5.x (I forgot about that bug :/) and...  I'd like to keep
it that way, so I tried to troubleshoot this further.

It looks like there's a preloading loop between those libraries that
results in deadlocking. Effectively, during its initialization
(malloc_init) jemalloc tries to initialize libgcc's unwind code
(_Unwind_Backtrace), which in turn calls dl_iterate_phdr, which is
captured by libfakechroot, which calls dlsym()/dlerror(), which tries to
allocate memory back again, which deadlocks jemalloc.

The backtrace is (note how #6 and #20 are the same):
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:103
#1  0x00007fd764008704 in __GI___pthread_mutex_lock (mutex=0x7fd7647a0500 
<init_lock+64>) at ../nptl/pthread_mutex_lock.c:80
#2  0x00007fd76475f0dc in malloc_mutex_lock_final (mutex=0x7fd7647a04c0 
<init_lock>) at include/jemalloc/internal/mutex.h:141
#3  je_malloc_mutex_lock_slow (mutex=mutex@entry=0x7fd7647a04c0 <init_lock>) at 
src/mutex.c:84
#4  0x00007fd76470e244 in malloc_mutex_lock (mutex=0x7fd7647a04c0 <init_lock>, 
tsdn=0x0) at include/jemalloc/internal/mutex.h:205
#5  malloc_init_hard () at src/jemalloc.c:1506
#6  0x00007fd76471524d in malloc_init () at src/jemalloc.c:217
#7  imalloc (dopts=<synthetic pointer>, sopts=<synthetic pointer>) at 
src/jemalloc.c:1986
#8  calloc (num=num@entry=1, size=size@entry=32) at src/jemalloc.c:2138
#9  0x00007fd763ff8a25 in _dlerror_run (operate=operate@entry=0x7fd763ff8390 
<dlsym_doit>, args=args@entry=0x7ffdd14ddfa0) at dlerror.c:141
#10 0x00007fd763ff840f in __dlsym (handle=<optimized out>, name=<optimized 
out>) at dlsym.c:70
#11 0x00007fd7644f49b4 in ?? () from 
/usr/lib/x86_64-linux-gnu/fakechroot/libfakechroot.so
#12 0x00007fd7644edffc in dl_iterate_phdr () from 
/usr/lib/x86_64-linux-gnu/fakechroot/libfakechroot.so
#13 0x00007fd763ff02a1 in _Unwind_Find_FDE (pc=0x7fd763fee867 
<_Unwind_Backtrace+55>, bases=bases@entry=0x7ffdd14de368) at 
../../../src/libgcc/unwind-dw2-fde-dip.c:469
#14 0x00007fd763fec983 in uw_frame_state_for 
(context=context@entry=0x7ffdd14de2c0, fs=fs@entry=0x7ffdd14de110) at 
../../../src/libgcc/unwind-dw2.c:1257
#15 0x00007fd763fedb60 in uw_init_context_1 (context=0x7ffdd14de2c0, 
outer_cfa=0x7ffdd14de570, outer_ra=0x7fd76476a878 <je_prof_boot2+56>)
    at ../../../src/libgcc/unwind-dw2.c:1586
#16 0x00007fd763fee868 in _Unwind_Backtrace (trace=trace@entry=0x7fd76475fdb0 
<prof_unwind_init_callback>, trace_argument=trace_argument@entry=0x0)
    at ../../../src/libgcc/unwind.inc:295
#17 0x00007fd76476a878 in je_prof_boot2 (tsd=tsd@entry=0x7fd763fd7740) at 
src/prof.c:2392
#18 0x00007fd76470e308 in malloc_init_hard () at src/jemalloc.c:1538
#19 malloc_init_hard () at src/jemalloc.c:1500
#20 0x00007fd764710a85 in malloc_init () at src/jemalloc.c:217

I don't think it's a bug on either library per se. I was wondering if
you had any insight on how we could address this in fakechroot somehow
rather than in jemalloc, as that doesn't look to be easy without
disabling the profiling feature.

Regards,
Faidon

--- End Message ---
--- Begin Message ---
Source: fakechroot
Source-Version: 2.19-3.2

We believe that the bug you reported is fixed in the latest version of
fakechroot, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 918...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Johannes 'josch' Schauer <jo...@debian.org> (supplier of updated fakechroot 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 27 Jan 2019 16:34:19 +0100
Source: fakechroot
Architecture: source
Version: 2.19-3.2
Distribution: unstable
Urgency: medium
Maintainer: Piotr Roszatycki <dex...@debian.org>
Changed-By: Johannes 'josch' Schauer <jo...@debian.org>
Closes: 918741 918742
Changes:
 fakechroot (2.19-3.2) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Build-Depends on libjemalloc-dev instead of libjemalloc1 (closes: #918741)
   * Disable jemalloc test because since libjemalloc2, fakechroot is
     incompatible with jemalloc. They must not be preloaded at the same time.
     (closes: #918742)
Checksums-Sha1:
 03052cac09e1f5ac4e32f5d1c5a690915d395884 2010 fakechroot_2.19-3.2.dsc
 237d21e9a9c0d2da0d89917922fde7e0f6df9de8 10384 
fakechroot_2.19-3.2.debian.tar.xz
 a2168043afc2b5cd21ce4e255ee1010475e4d13f 5647 
fakechroot_2.19-3.2_amd64.buildinfo
Checksums-Sha256:
 9ac5d4cb6d4c2b105531bf3095cc4477e9d46d77ba734b16454cf2bf39c48134 2010 
fakechroot_2.19-3.2.dsc
 4db2790de6a191d5475faa81d5b1b1b0b8157abd7249b9906ee4c27a0567bd83 10384 
fakechroot_2.19-3.2.debian.tar.xz
 77393f62e512e531cb293e751a5d9089047c648dbda7e96a7a1a581b5487b851 5647 
fakechroot_2.19-3.2_amd64.buildinfo
Files:
 8a7dc01da0134176fbe50e1002cc8f04 2010 utils optional fakechroot_2.19-3.2.dsc
 ff6cb95db74140ef959f91744473df53 10384 utils optional 
fakechroot_2.19-3.2.debian.tar.xz
 87574c9608aa5a4936a99d9c7b6b6b36 5647 utils optional 
fakechroot_2.19-3.2_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAlxN0HgACgkQ8sulx4+9
g+ESjg//Univ20tp7tePl3DcTbqmdX4Zn4+l3NQ2kOlPckVCZDrJekI+hZGtv4SZ
Hq3+GeUmLAmc1NZwPu41qcKylkamA2jEff8fc2ZjTR1fWqQUQljWTUfvUG7/fDrQ
SwuoAv4wZhCUmlG/M1bxRGMlYz9Am+6YSWFeb7pTR+Sl5qv0rHGN/LRjFMFPoD9e
XJcQA+a2GSNA1QX5fMm9CMYnqj922uGGEYrpLgvnNghnGpRMupHtdjfTWrv8cLlb
EWY5r43SNLMn6lDG++zIpeKCNmL1lNaVVwANXKXgqAjYa2q6FIj4EsE9m98ejDmM
XlkeGLczIp9PrDV5VpTrnE7vLpIsSoOEjHhHH9OyoOW4aPROyRAToYxV4M3sMwAK
6wyJW2uBk0uKqAm0ghv4IbsgLjCouC9aOT+BgXI3i5eLL26HvyyS4q3Hail9DcKE
5KUBZr3q9AXGjzYQVmoOtp7J0rJyOvrQNRNnBtF4WrpCgaldKNBl8hy0VaAdvXbS
d6i7DJUQSMolsuhejbnTPOvGhzPTwcOCgTcfJgfD2JCOIVM0kkG6F7PcSy8AA14z
yYOxyThBxVSISp0a8o0pmZHC0jh8Nm0WrDqgKyqGRdFGxwB5DI9hOGsBZXH5wxaQ
zzQ32vBIt1YnRB55YKKfd4Ucx8rkF13nIz+d/z0v/Sn26EcDlxo=
=s+TC
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to