public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538
@ 2020-05-12 16:45 gscfq@t-online.de
  2020-06-06 20:48 ` [Bug fortran/95091] " anlauf at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gscfq@t-online.de @ 2020-05-12 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95091
           Summary: ICE in gfc_hash_value, at fortran/class.c:538
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

A more complex example, switches between 44 (ok) and 45 (ICE) :
(backtrace varies with release and name length)


$ cat z1_44.f90
module m2345678901234567890123456789012345678901234
  type t2345678901234567890123456789012345678901234
  end type
  interface
    module subroutine s2345678901234567890123456789012345678901234 &
      (x2345678901234567890123456789012345678901234)
    end
  end interface
end
submodule(m2345678901234567890123456789012345678901234) &
  n2345678901234567890123456789012345678901234
  type, extends(t2345678901234567890123456789012345678901234) :: &
    u2345678901234567890123456789012345678901234
  end type
end


$ cat z1_45.f90
module m23456789012345678901234567890123456789012345
  type t23456789012345678901234567890123456789012345
  end type
  interface
    module subroutine s23456789012345678901234567890123456789012345 &
      (x23456789012345678901234567890123456789012345)
    end
  end interface
end
submodule(m23456789012345678901234567890123456789012345) &
  n23456789012345678901234567890123456789012345
  type, extends(t23456789012345678901234567890123456789012345) :: &
    u23456789012345678901234567890123456789012345
  end type
end


$ cat z1_63.f90
module m23456789012345678901234567890123456789012345678901234567890123
  type t23456789012345678901234567890123456789012345678901234567890123
  end type
  interface
    module subroutine
s23456789012345678901234567890123456789012345678901234567890123 &
      (x23456789012345678901234567890123456789012345678901234567890123)
    end
  end interface
end
submodule(m23456789012345678901234567890123456789012345678901234567890123) &
  n23456789012345678901234567890123456789012345678901234567890123
  type,
extends(t23456789012345678901234567890123456789012345678901234567890123) :: &
    u23456789012345678901234567890123456789012345678901234567890123
  end type
end


$ gfortran-11-20200510 -c z1_44.f90
$
$ gfortran-11-20200510 -c z1_45.f90
f951: internal compiler error: Segmentation fault
0xbb93cf crash_signal
        ../../gcc/toplev.c:328
0x64003a gfc_match_function_decl()
        ../../gcc/fortran/decl.c:7355
gfortran: internal compiler error: Segmentation fault signal terminated program
f951


$ gfortran-11-20200510 -c z1_63.f90
f951: internal compiler error: Segmentation fault
0xbb93cf crash_signal
        ../../gcc/toplev.c:328
0x62c64c gfc_hash_value(gfc_symbol*)
        ../../gcc/fortran/class.c:538
gfortran: internal compiler error: Segmentation fault signal terminated program
f951
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
@ 2020-06-06 20:48 ` anlauf at gcc dot gnu.org
  2020-06-06 21:13 ` anlauf at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-06 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #1 from anlauf at gcc dot gnu.org ---
Created attachment 48695
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48695&action=edit
Patch to adjust buffer sizes

Obvious fix for buffer overflows.

Will submit soon.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
  2020-06-06 20:48 ` [Bug fortran/95091] " anlauf at gcc dot gnu.org
@ 2020-06-06 21:13 ` anlauf at gcc dot gnu.org
  2020-06-07 12:47 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-06 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-06-06

--- Comment #2 from anlauf at gcc dot gnu.org ---
Slightly improved patch posted for review:

https://gcc.gnu.org/pipermail/fortran/2020-June/054475.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
  2020-06-06 20:48 ` [Bug fortran/95091] " anlauf at gcc dot gnu.org
  2020-06-06 21:13 ` anlauf at gcc dot gnu.org
@ 2020-06-07 12:47 ` cvs-commit at gcc dot gnu.org
  2020-06-07 14:43 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-07 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:b342cfd648e6658363c7c8fef83af8f59dba1795

commit r11-1022-gb342cfd648e6658363c7c8fef83af8f59dba1795
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 14:47:24 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    With submodules, name mangling results in long internal symbols.  This
    requires adjustment of the sizes of temporaries to avoid buffer overflows.

    2020-06-07  Harald Anlauf  <anlauf@gmx.de>

    gcc/fortran/
            PR fortran/95091
            * class.c (get_unique_type_string, gfc_hash_value): Enlarge
            buffers, and check whether the strings returned by
            get_unique_type_string() fit.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-07 12:47 ` cvs-commit at gcc dot gnu.org
@ 2020-06-07 14:43 ` cvs-commit at gcc dot gnu.org
  2020-06-08 19:01 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-07 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:5aaccde3db39fac7e7f6677ceccc1eadd9c6a424

commit r11-1024-g5aaccde3db39fac7e7f6677ceccc1eadd9c6a424
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 16:43:12 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    Add cast to fix bootstrap error with -Werror=sign-compare.

    gcc/fortran/
            PR fortran/95091
            * class.c (gfc_hash_value): Add cast.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-06-07 14:43 ` cvs-commit at gcc dot gnu.org
@ 2020-06-08 19:01 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-08 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:8cd239614e43c9dcc0838845aec504e5eb938dbd

commit r11-1068-g8cd239614e43c9dcc0838845aec504e5eb938dbd
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Mon Jun 8 21:00:11 2020 +0200

    PR fortran/95195 - Fortran testcase should clean up afterwards

    Change testcase to check error message (iomsg) at runtime, rather than to
crash.

    libgfortran/
            PR fortran/95091
            * io/transfer.c (finalize_transfer): Fix type in error message.

    gcc/testsuite/
            PR fortran/95195
            * gfortran.dg/namelist_97.f90: Adjust testcase.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-06-08 19:01 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:bf6199ecc9c2dc9f6b5eca3d18ff48b374a8feb9

commit r10-8272-gbf6199ecc9c2dc9f6b5eca3d18ff48b374a8feb9
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 14:47:24 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    With submodules, name mangling results in long internal symbols.  This
    requires adjustment of the sizes of temporaries to avoid buffer overflows.

    2020-06-07  Harald Anlauf  <anlauf@gmx.de>

    gcc/fortran/
            PR fortran/95091
            * class.c (get_unique_type_string, gfc_hash_value): Enlarge
            buffers, and check whether the strings returned by
            get_unique_type_string() fit.

    (cherry picked from commit b342cfd648e6658363c7c8fef83af8f59dba1795)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:605e9b1a9b3250537a7269eba7e9c316b0f00d29

commit r10-8273-g605e9b1a9b3250537a7269eba7e9c316b0f00d29
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 16:43:12 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    Add cast to fix bootstrap error with -Werror=sign-compare.

    gcc/fortran/
            PR fortran/95091
            * class.c (gfc_hash_value): Add cast.

    (cherry picked from commit 5aaccde3db39fac7e7f6677ceccc1eadd9c6a424)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:22 ` anlauf at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:abfe42c1fb66a534290bd0a808c2d90842ee848b

commit r9-8665-gabfe42c1fb66a534290bd0a808c2d90842ee848b
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 14:47:24 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    With submodules, name mangling results in long internal symbols.  This
    requires adjustment of the sizes of temporaries to avoid buffer overflows.

    2020-06-07  Harald Anlauf  <anlauf@gmx.de>

    gcc/fortran/
            PR fortran/95091
            * class.c (get_unique_type_string, gfc_hash_value): Enlarge
            buffers, and check whether the strings returned by
            get_unique_type_string() fit.

    (cherry picked from commit b342cfd648e6658363c7c8fef83af8f59dba1795)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (7 preceding siblings ...)
  2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
  2020-06-11 14:22 ` anlauf at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-11 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:77137fbd464b20e2422c887d1e46fa5f1c38dc9e

commit r9-8666-g77137fbd464b20e2422c887d1e46fa5f1c38dc9e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sun Jun 7 16:43:12 2020 +0200

    PR fortran/95091 - Buffer overflows with submodules and long symbols

    Add cast to fix bootstrap error with -Werror=sign-compare.

    gcc/fortran/
            PR fortran/95091
            * class.c (gfc_hash_value): Add cast.

    (cherry picked from commit 5aaccde3db39fac7e7f6677ceccc1eadd9c6a424)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/95091] ICE in gfc_hash_value, at fortran/class.c:538
  2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
                   ` (8 preceding siblings ...)
  2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
@ 2020-06-11 14:22 ` anlauf at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-11 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from anlauf at gcc dot gnu.org ---
Fixed on master for GCC-11, and backported to 10-branch and 9-branch.

Thanks for the report!

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-06-11 14:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 16:45 [Bug fortran/95091] New: ICE in gfc_hash_value, at fortran/class.c:538 gscfq@t-online.de
2020-06-06 20:48 ` [Bug fortran/95091] " anlauf at gcc dot gnu.org
2020-06-06 21:13 ` anlauf at gcc dot gnu.org
2020-06-07 12:47 ` cvs-commit at gcc dot gnu.org
2020-06-07 14:43 ` cvs-commit at gcc dot gnu.org
2020-06-08 19:01 ` cvs-commit at gcc dot gnu.org
2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
2020-06-11 14:03 ` cvs-commit at gcc dot gnu.org
2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
2020-06-11 14:20 ` cvs-commit at gcc dot gnu.org
2020-06-11 14:22 ` anlauf at gcc dot gnu.org

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).