From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36A763857C5E; Fri, 16 Oct 2020 15:09:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36A763857C5E From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/97461] allocate_gcov_kvp() deadlocks in firefox LTO+PGO build (overridden malloc() recursion) Date: Fri, 16 Oct 2020 15:09:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: gcov-profile X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2020 15:09:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97461 --- Comment #2 from Sergei Trofimovich --- Original firefox lockup is slightly more complicated: malloc() call happens= in a constructor of external library (at _gpg_err_init()). (gdb) bt #0 __lll_lock_wait (futex=3D0x5591defd9720 , private=3D0) at lowlevellock.c:52 #1 0x00007f6e72d23305 in __GI___pthread_mutex_lock (mutex=3D0x5591defd9720 ) at ../nptl/pthread_mutex_lock.c:135 #2 0x00005591deeb60a1 in malloc_init_hard() () #3 0x00005591deebf75e in calloc () #4 0x00005591defa70df in allocate_gcov_kvp () at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgc= c/libgcov.h:441 #5 gcov_topn_add_value (count=3D1, use_atomic=3D1, increment_total=3D1, va= lue=3D4096, counters=3D0x5591df011520 <__gcov3._ZL16malloc_init_hardv>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgc= c/libgcov.h:489 #6 __gcov_topn_values_profiler_body (use_atomic=3D1, value=3D4096, counters=3D0x5591df011520 <__gcov3._ZL16malloc_init_hardv>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgc= c/libgcov-profiler.c:103 #7 __gcov_topn_values_profiler_atomic (counters=3D0x5591df011520 <__gcov3._ZL16malloc_init_hardv>, value=3D4096) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgc= c/libgcov-profiler.c:128 #8 0x00005591deeb6121 in malloc_init_hard() () #9 0x00005591deec052e in malloc () #10 0x00007f6e5c5ecddf in set_binding_values (domainname=3D0x7f6e58451245 "libgpg-error", dirnamep=3D0x7fffd54f39c8, codesetp=3D0x0) at bindtextdom.c= :202 #11 0x00007f6e5c5ed071 in set_binding_values (codesetp=3D0x0, dirnamep=3D0x7fffd54f39c8, domainname=3D) at bindtextdom.c:82 #12 __bindtextdomain (domainname=3D, dirname=3D) at bindtextdom.c:320 #13 0x00007f6e5843cbc7 in _gpg_err_init () at /usr/lib64/libgpg-error.so.0 #14 0x00007f6e72d94cfe in call_init (l=3D, argc=3Dargc@entry= =3D3, argv=3Dargv@entry=3D0x7fffd54f3a68, env=3Denv@entry=3D0x7fffd54f3a88) at dl= -init.c:74 #15 0x00007f6e72d94de0 in call_init (env=3D0x7fffd54f3a88, argv=3D0x7fffd54= f3a68, argc=3D3, l=3D) at dl-init.c:37 #16 _dl_init (main_map=3D0x7f6e72db11a0, argc=3D3, argv=3D0x7fffd54f3a68, env=3D0x7fffd54f3a88) at dl-init.c:121 #17 0x00007f6e72d8608a in _dl_start_user () at /lib64/ld-linux-x86-64.so.2 #18 0x0000000000000003 in () #19 0x00007fffd54f4a83 in () #20 0x00007fffd54f4a9c in () #21 0x00007fffd54f4b15 in () #22 0x0000000000000000 in ()=