From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 30FD73857707; Thu, 7 Mar 2024 21:24:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 30FD73857707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709846647; bh=xErZJ2gDOaOwNQ7rahtpImn1QbaDTZ70rVEAEYtno/8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TpEgF3n5bxs11TS1MXRhTqmDCPh5Lm2ay0+kn3sAkH4Qcd3hfTyWWEsXJyWVfC+4S V5xRkIlXaOXkGe9khY8s1uq9qibyfFwWOr280CVVm0NKu7R5h15l0c2RkOIbtNfUe3 STjOAkSO+vSatmMrjPx/OVseoI97m+e2j//ZnvXs= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110730] STL internal allocation/deallocation might lead to core dump in the use of header units of the modules feature Date: Thu, 07 Mar 2024 21:24:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110730 --- Comment #3 from GCC Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:0552560f6d2eaa1ae6df5c80660b489de1d5c772 commit r14-9372-g0552560f6d2eaa1ae6df5c80660b489de1d5c772 Author: Patrick Palka Date: Thu Mar 7 16:23:22 2024 -0500 c++/modules: inline namespace abi_tag streaming [PR110730] The unreduced testcase from PR110730 crashes at runtime ultimately because we don't stream the abi_tag attribute on inline namespaces and so the filesystem::current_path() call resolves to the non-C++11 ABI version even though the C++11 ABI is active, leading to a crash when destroying the path temporary (which contains an std::string member). Similar story for the PR105512 testcase. While we do stream the DECL_ATTRIBUTES of all decls that go through the generic tree streaming routines, it seems namespaces are streamed separately from other decls and we don't use the generic routines for them. So this patch makes us stream the abi_tag manually for (inline) namespaces. PR c++/110730 PR c++/105512 gcc/cp/ChangeLog: * module.cc (module_state::write_namespaces): Stream the abi_tag attribute of an inline namespace. (module_state::read_namespaces): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/hello-2_a.C: New test. * g++.dg/modules/hello-2_b.C: New test. * g++.dg/modules/namespace-6_a.H: New test. * g++.dg/modules/namespace-6_b.C: New test. Reviewed-by: Jason Merrill =