public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/108109] [ICE] gfortran compilation fails calling 'free()' with 'malloc(): mismatching next->prev_size (unsorted)'
Date: Wed, 14 Dec 2022 20:51:22 +0000	[thread overview]
Message-ID: <bug-108109-4-ij3CVpZHSi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108109-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Created attachment 54096
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54096&action=edit
valgrind output.

(In reply to anlauf from comment #1)
> Is this attached file to be preprocessed?  Or does it need special options?
> Can't reproduce here.

I attached the valgrind output (for mainline) and the message fits to what
glibc diagnoses. There is simply an invalid READ – and the free is for a bogus
address (in the middle of an allocation).

As it is for a code which completely fails to compile, I don't think it is of
any priority at all - but I did not want to leave it unreported. (Main issue:
Several macros not defined, especially those which should expand to a string
literal.)

 * * *

Special option: In principle not, but for the main test file, I see differences
with and without '-cpp' and not a clear pattern. In particular:

No - it isn't. I just run: 'gcc-7 test.f90' (works), gcc-8 ... (works), gcc-9
(glibc's fatal message), gcc-10 (likewise), gcc-10/11/12 (works), mainline
(glibc's message).

Here, gcc-7 to gcc-10 are the Ubuntu version, gcc-11 to mainline are self
compiled. I checked and I don't have _MALLOC_PERTURB set.

The big program (MM_GPU_Library_Module.f90), I currently get the message with
'gfortran-9' with and without '-cpp' – but with gfortran mainline, I only get
it with -cpp. – I think I got it in different variants also before.

That's with Ubuntu 20.04.5 LTS + glibc 2.31-0ubuntu9.9.

(Often using something like MALLOC_PERTURB_=... helps, but here it doesn't;
probably because calloc and free are involved.)

  parent reply	other threads:[~2022-12-14 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 18:37 [Bug fortran/108109] New: " burnus at gcc dot gnu.org
2022-12-14 19:34 ` [Bug fortran/108109] " anlauf at gcc dot gnu.org
2022-12-14 20:51 ` burnus at gcc dot gnu.org [this message]
2022-12-14 21:10 ` anlauf 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-108109-4-ij3CVpZHSi@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).