From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 738CA3854806; Mon, 19 Oct 2020 07:15:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 738CA3854806 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug gcov-profile/97461] [11 Regression] allocate_gcov_kvp() deadlocks in firefox LTO+PGO build (overridden malloc() recursion) Date: Mon, 19 Oct 2020 07:15:27 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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: Mon, 19 Oct 2020 07:15:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97461 --- Comment #5 from Richard Biener --- Hmm, is the TOPN allocation strathegy configurable? I wonder whether we ha= ve to resort to an alternate allocation scheme (mmap/sbrk), avoiding libc? At least I don't see a good way to force the gcov allocation to call the libc malloc rather than a user replacement that is being instrumented. Of course the instrumentation code could do sth like if (is_allocated =3D=3D 0) { is_allocated =3D in_progress; ... =3D malloc (); is_allocated =3D 1; } else if (is_allocted =3D=3D in_progress) { topn_mem =3D &transitional_garbage_space; } but of course that's quite some overhead for a small benefit. Maybe it could be hidden in gcov_malloc.=