From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFB1B3858C5F; Mon, 15 Jan 2024 16:54:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFB1B3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705337676; bh=h20SlR0eAhEUY1CqAWhH8M1aKvDP9GFebTk1vfLl0OY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HRytN3/TiEqFCUqQJLaO3EO4fipmWKyyV9R4XkBU9xcYAxL+n5w5biXsG4JOgG9a7 nhFBowe6K5iOEXYPZLFMg44eU4OgHH5P3F+oaPS9NqM1OsJeKbA4cJzeY7yHoXO3nX mDFFzSnLZAXmupz7f3V/4AhQaiheBZdXnbhAmw+8= From: "fw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/113401] Memory (resource) leak in -ftrampoline-impl=heap Date: Mon, 15 Jan 2024 16:54:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fw 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113401 --- Comment #2 from Florian Weimer --- (In reply to Iain Sandoe from comment #1) > (In reply to Florian Weimer from comment #0) >=20 > > The fix is to register a TLS destructor to > > deallocate that page, too. On glibc, that also fixes another memory lea= k for > > -fno-exceptions compilations (the default for C) if pthread_exit is cal= led > > with an active trampoline. >=20 > Does this mean you have a proposed patch already? (before I start > investigation) No, this was a reference to __cxa_thread_atexit, which is unfortunately in libstdc++ (but is a thin shim around __cxa_thread_atexit_impl for current glibc). The pthread_key_create fallback probably needs to be duplicated into libgcc_s.=