public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508
@ 2020-06-15 18:42 gscfq@t-online.de
  2020-06-15 19:15 ` [Bug fortran/95687] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2020-06-15 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95687
           Summary: ICE in get_unique_hashed_string, at
                    fortran/class.c:508
           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: ---

Happens between name length 61 (ok) and 62 (ICE) :


$ cat z1_61.f90
module m234567890123456789012345678901234567890123456789012345678901
   interface
      module subroutine
s234567890123456789012345678901234567890123456789012345678901
      end
   end interface
end
submodule(m234567890123456789012345678901234567890123456789012345678901) &
   n234567890123456789012345678901234567890123456789012345678901
   type t234567890123456789012345678901234567890123456789012345678901 &
       (a234567890123456789012345678901234567890123456789012345678901)
      integer, kind ::
a234567890123456789012345678901234567890123456789012345678901 = 4
   end type
   class(t234567890123456789012345678901234567890123456789012345678901(3)),
pointer :: &
         x234567890123456789012345678901234567890123456789012345678901
end


$ cat z1_62.f90
module m2345678901234567890123456789012345678901234567890123456789012
   interface
      module subroutine
s2345678901234567890123456789012345678901234567890123456789012
      end
   end interface
end
submodule(m2345678901234567890123456789012345678901234567890123456789012) &
   n2345678901234567890123456789012345678901234567890123456789012
   type t2345678901234567890123456789012345678901234567890123456789012 &
       (a2345678901234567890123456789012345678901234567890123456789012)
      integer, kind ::
a2345678901234567890123456789012345678901234567890123456789012 = 4
   end type
   class(t2345678901234567890123456789012345678901234567890123456789012(3)),
pointer :: &
         x2345678901234567890123456789012345678901234567890123456789012
end


$ cat z1_63.f90
module m23456789012345678901234567890123456789012345678901234567890123
   interface
      module subroutine
s23456789012345678901234567890123456789012345678901234567890123
      end
   end interface
end
submodule(m23456789012345678901234567890123456789012345678901234567890123) &
   n23456789012345678901234567890123456789012345678901234567890123
   type t23456789012345678901234567890123456789012345678901234567890123 &
       (a23456789012345678901234567890123456789012345678901234567890123)
      integer, kind ::
a23456789012345678901234567890123456789012345678901234567890123 = 4
   end type
   class(t23456789012345678901234567890123456789012345678901234567890123(3)),
pointer :: &
         x23456789012345678901234567890123456789012345678901234567890123
end


$ gfortran-11-20200614 -c z1_61.f90
$
$ gfortran-11-20200614 -c z1_62.f90
f951: internal compiler error: in get_unique_hashed_string, at
fortran/class.c:508
0x634d96 get_unique_hashed_string
        ../../gcc/fortran/class.c:508
0x6381ae gfc_build_class_symbol(gfc_typespec*, symbol_attribute*,
gfc_array_spec**)
        ../../gcc/fortran/class.c:651
0x63ec2c build_sym
        ../../gcc/fortran/decl.c:1751
0x649519 variable_decl
        ../../gcc/fortran/decl.c:2793
0x649519 gfc_match_data_decl()
        ../../gcc/fortran/decl.c:6195
0x6acd23 match_word
        ../../gcc/fortran/parse.c:65
0x6acd23 decode_statement
        ../../gcc/fortran/parse.c:376
0x6ae76a next_free
        ../../gcc/fortran/parse.c:1279
0x6ae76a next_statement
        ../../gcc/fortran/parse.c:1511
0x6afdbb parse_spec
        ../../gcc/fortran/parse.c:3922
0x6b3d8e parse_module
        ../../gcc/fortran/parse.c:6115
0x6b40d7 gfc_parse_file()
        ../../gcc/fortran/parse.c:6428
0x70036f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
@ 2020-06-15 19:15 ` marxin at gcc dot gnu.org
  2020-06-15 20:59 ` anlauf at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-15
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r8-3056-g5bab4c9631c478b7, before the revision it was rejected.

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
  2020-06-15 19:15 ` [Bug fortran/95687] " marxin at gcc dot gnu.org
@ 2020-06-15 20:59 ` anlauf at gcc dot gnu.org
  2020-06-15 21:35 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-15 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org
                 CC|                            |anlauf at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
           Priority|P3                          |P4

--- Comment #2 from anlauf at gcc dot gnu.org ---
Another buffer overflow which is now caught to get a meaningful traceback.

Working on a patch.

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
  2020-06-15 19:15 ` [Bug fortran/95687] " marxin at gcc dot gnu.org
  2020-06-15 20:59 ` anlauf at gcc dot gnu.org
@ 2020-06-15 21:35 ` anlauf at gcc dot gnu.org
  2020-06-17 19:29 ` anlauf at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-15 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from anlauf at gcc dot gnu.org ---
Patch posted for review:

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

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-15 21:35 ` anlauf at gcc dot gnu.org
@ 2020-06-17 19:29 ` anlauf at gcc dot gnu.org
  2020-06-20 14:12 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-17 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from anlauf at gcc dot gnu.org ---
Updated / corrected patch posted for review:

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

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-06-17 19:29 ` anlauf at gcc dot gnu.org
@ 2020-06-20 14:12 ` cvs-commit at gcc dot gnu.org
  2020-06-21 11:36 ` manfred99 at gmx dot ch
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-20 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:ac932bfcd21e9523fa2b880ae8138aef79da7f54

commit r11-1568-gac932bfcd21e9523fa2b880ae8138aef79da7f54
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Jun 20 16:11:48 2020 +0200

    PR fortran/95687 - ICE in get_unique_hashed_string, at fortran/class.c:508

    With submodules and PDTs, name mangling of interfaces may result in long
    internal symbols overflowing a previously static internal buffer.  We now
    set the buffer size dynamically.

    gcc/fortran/
            PR fortran/95687
            * class.c (get_unique_type_string): Return a string with dynamic
            length.
            (get_unique_hashed_string, gfc_hash_value): Use dynamic result
            from get_unique_type_string instead of static buffer.

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-06-20 14:12 ` cvs-commit at gcc dot gnu.org
@ 2020-06-21 11:36 ` manfred99 at gmx dot ch
  2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
  2020-06-23 20:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: manfred99 at gmx dot ch @ 2020-06-21 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

Manfred Schwarb <manfred99 at gmx dot ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manfred99 at gmx dot ch

--- Comment #6 from Manfred Schwarb <manfred99 at gmx dot ch> ---
This might have solved PR89661, at least I don't see it anymore
in today's build. As the crash of class_61.f90 is a bit difficult
to reproduce, additional confirmation might be needed.

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-06-21 11:36 ` manfred99 at gmx dot ch
@ 2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
  2020-06-23 20:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-22 19:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:f067cc55d382c256308f85575bca3e42fe215541

commit r10-8339-gf067cc55d382c256308f85575bca3e42fe215541
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Sat Jun 20 16:11:48 2020 +0200

    PR fortran/95687 - ICE in get_unique_hashed_string, at fortran/class.c:508

    With submodules and PDTs, name mangling of interfaces may result in long
    internal symbols overflowing a previously static internal buffer.  We now
    set the buffer size dynamically.

    gcc/fortran/
            PR fortran/95687
            * class.c (get_unique_type_string): Return a string with dynamic
            length.
            (get_unique_hashed_string, gfc_hash_value): Use dynamic result
            from get_unique_type_string instead of static buffer.

    (cherry picked from commit ac932bfcd21e9523fa2b880ae8138aef79da7f54)

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

* [Bug fortran/95687] ICE in get_unique_hashed_string, at fortran/class.c:508
  2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:45 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-23 20:45 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

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

Backporting further would involve backports from other PRs and is probably
not worth it.  Thus closing.

Thanks for the report!

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

end of thread, other threads:[~2020-06-23 20:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 18:42 [Bug fortran/95687] New: ICE in get_unique_hashed_string, at fortran/class.c:508 gscfq@t-online.de
2020-06-15 19:15 ` [Bug fortran/95687] " marxin at gcc dot gnu.org
2020-06-15 20:59 ` anlauf at gcc dot gnu.org
2020-06-15 21:35 ` anlauf at gcc dot gnu.org
2020-06-17 19:29 ` anlauf at gcc dot gnu.org
2020-06-20 14:12 ` cvs-commit at gcc dot gnu.org
2020-06-21 11:36 ` manfred99 at gmx dot ch
2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:45 ` 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).