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

            Bug ID: 106915
           Summary: ICE/segfault during parsing with modules and invalid
                    code in malloc
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Created attachment 53564
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53564&action=edit
Testcase

the following code ICEs either in variant (A) with:

corrupted size vs. prev_size
...
0x7f18078ba08f ???
       
/build/glibc-SzIz7B/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f180790ca63 malloc_consolidate
        /build/glibc-SzIz7B/glibc-2.31/malloc/malloc.c:4492
0x7f180790ec82 _int_malloc



Or in Variant (B) with:

Error: Expecting END MODULE statement at (1)
malloc(): mismatching next->prev_size (unsorted)
malloc(): mismatching next->prev_size (unsorted)
gfortran: internal compiler error: Aborted signal terminated program f951


The second variant seems to work also without -fopenmp, even though it has
'USE omp_lib'.

Reply via email to