From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01F22382FC93; Wed, 14 Dec 2022 11:56:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01F22382FC93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671019019; bh=ofvpaQUxYoEBU8KAP4rzPgbdQFRaiXZCV0HVwsD39Ts=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TMcyw8Dul6t90RqbiZnl8lIt+70Ayo2IgQYpwCzk/mG34fW/tH8t86+toeHN7d6Qm 4it8wHDD1o01PUMA/8sAqt7oeuz421gsx7qGCImi5TaLDr91UzLJViqmk8eV9Hic+J QM8CAJ943hdSFcDcSILUrRxNA60jlo6RqNrKnZQY= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108097] std::stacktrace AddressSanitizer: new-delete-type-mismatch on 0x615000000080 in thread T0 Date: Wed, 14 Dec 2022 11:56:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D108097 --- Comment #9 from Jonathan Wakely --- --- a/libstdc++-v3/include/std/stacktrace +++ b/libstdc++-v3/include/std/stacktrace @@ -608,8 +608,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if constexpr (is_same_v= >) { - __n *=3D sizeof(value_type); - void* const __p =3D _GLIBCXX_OPERATOR_NEW (__n, nothrow_t= {}); + size_t __n2 =3D __n * sizeof(value_type); + void* const __p =3D _GLIBCXX_OPERATOR_NEW (__n2, nothrow_= t{}); if (__p =3D=3D nullptr) [[unlikely]] return nullptr; _M_frames =3D static_cast(__p);=