https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115008
--- Comment #2 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
The backtrace seems to indicate failure happens in the memcpy here:
#if MAPPED_WRITING
/* HDR is always mapped. */
if (&buffer != &hdr)
{
bytes_out out (this);
grow (out, buffer.pos, true);
if (out.buffer)
memcpy (out.buffer, buffer.buffer, buffer.pos);
shrink (out);
}
else
/* We should have been aligned during the first allocation. */
gcc_checking_assert (!(pos & (SECTION_ALIGN - 1)));
#else
My guess is that the memcpy is writing out of bounds. So I wonder if there's a
difference in the behaviour of mmap (or other APIs being used here) between
FreeBSD and Linux?