public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/113258] Pre-C++17 code that supplies operator new/delete crashes when mixed with post-C+17 code that uses the align_val_t variants of new/delete
Date: Mon, 08 Jan 2024 01:23:58 +0000	[thread overview]
Message-ID: <bug-113258-4-BfxI3IV1kd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113258-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113258

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Nicholas Miell from comment #8) 
> What appears to actually be happening is that the libstdc++ operator
> new(std::size_t size, std::align_val_t alignment) is calling glibc's
> aligned_alloc, and then the libstdc++ operator delete(void* ptr,
> std::align_val_t alignment) is calling std::free(), which is supplied by
> tcmalloc.


aligned_alloc is part of C11 and C++17 and is required to be free'd by
std::free (or free in the C11 case).

So this seems like a bug in tcmalloc not supplying an override of the C11
function aligned_alloc.

You would run into the same issue with a C11 application that does the same
too.

  parent reply	other threads:[~2024-01-08  1:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07 23:34 [Bug libstdc++/113258] New: " nmiell at gmail dot com
2024-01-07 23:37 ` [Bug libstdc++/113258] " pinskia at gcc dot gnu.org
2024-01-07 23:43 ` pinskia at gcc dot gnu.org
2024-01-07 23:44 ` nmiell at gmail dot com
2024-01-07 23:48 ` nmiell at gmail dot com
2024-01-07 23:49 ` pinskia at gcc dot gnu.org
2024-01-07 23:57 ` pinskia at gcc dot gnu.org
2024-01-08  0:08 ` redi at gcc dot gnu.org
2024-01-08  1:00 ` nmiell at gmail dot com
2024-01-08  1:23 ` pinskia at gcc dot gnu.org [this message]
2024-01-08  1:57 ` pinskia at gcc dot gnu.org
2024-01-08  1:59 ` pinskia at gcc dot gnu.org
2024-01-08  2:18 ` nmiell at gmail dot com
2024-01-08  2:36 ` pinskia at gcc dot gnu.org
2024-01-08  4:42 ` nmiell at gmail dot com
2024-01-08  4:50 ` pinskia at gcc dot gnu.org
2024-01-08  4:53 ` pinskia at gcc dot gnu.org
2024-01-08  9:43 ` redi at gcc dot gnu.org
2024-01-08 10:15 ` redi at gcc dot gnu.org
2024-01-09  6:48 ` nmiell at gmail dot com
2024-01-09  6:55 ` pinskia at gcc dot gnu.org
2024-01-09 10:13 ` redi at gcc dot gnu.org
2024-01-09 11:16 ` [Bug libstdc++/113258] Pre-C++17 code that replaces malloc/free crashes when mixed with post-C++17 " redi at gcc dot gnu.org
2024-01-09 22:33 ` redi at gcc dot gnu.org
2024-01-11 17:55 ` cvs-commit at gcc dot gnu.org
2024-01-12  0:24 ` redi at gcc dot gnu.org
2024-01-16  7:43 ` sjames at gcc dot gnu.org
2024-02-08 15:51 ` cvs-commit at gcc dot gnu.org
2024-02-08 21:28 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113258-4-BfxI3IV1kd@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).