public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70
@ 2020-06-22 20:20 gscfq@t-online.de
  2020-06-22 21:08 ` [Bug fortran/95827] " anlauf at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2020-06-22 20:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95827
           Summary: ICE in gfc_get_string, at fortran/iresolve.c:70
           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 59 (ok) and 60 (ICE) :


$ cat z1_59.f90
module m2345678901234567890123456789012345678901234567890123456789
   interface
      module subroutine
s2345678901234567890123456789012345678901234567890123456789
      end
   end interface
end
submodule(m2345678901234567890123456789012345678901234567890123456789) &
   n2345678901234567890123456789012345678901234567890123456789
   integer :: x2345678901234567890123456789012345678901234567890123456789[*]
end


$ cat z1_60.f90
module m23456789012345678901234567890123456789012345678901234567890
   interface
      module subroutine
s23456789012345678901234567890123456789012345678901234567890
      end
   end interface
end
submodule(m23456789012345678901234567890123456789012345678901234567890) &
   n23456789012345678901234567890123456789012345678901234567890
   integer :: x23456789012345678901234567890123456789012345678901234567890[*]
end


$ cat z1_63.f90
module m23456789012345678901234567890123456789012345678901234567890123
   interface
      module subroutine
s23456789012345678901234567890123456789012345678901234567890123
      end
   end interface
end
submodule(m23456789012345678901234567890123456789012345678901234567890123) &
   n23456789012345678901234567890123456789012345678901234567890123
   integer ::
x23456789012345678901234567890123456789012345678901234567890123[*]
end


$ gfortran-11-20200621 -c z1_59.f90 -fcoarray=lib
$
$ gfortran-11-20200621 -c z1_60.f90 -fcoarray=lib
f951: internal compiler error: identifier overflow: 200
0x695169 gfc_report_diagnostic
        ../../gcc/fortran/error.c:782
0x69688a gfc_internal_error(char const*, ...)
        ../../gcc/fortran/error.c:1402
0x6be1d7 gfc_get_string(char const*, ...)
        ../../gcc/fortran/iresolve.c:70
0x773c16 gfc_build_qualified_array
        ../../gcc/fortran/trans-decl.c:994
0x7761bc gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1795
0x77a340 gfc_create_module_variable
        ../../gcc/fortran/trans-decl.c:5302
0x72ab12 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4162
0x77ae1b gfc_generate_module_vars(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:5801
0x748fc1 gfc_generate_module_code(gfc_namespace*)
        ../../gcc/fortran/trans.c:2238
0x6f3831 translate_all_program_units
        ../../gcc/fortran/parse.c:6294
0x6f3831 gfc_parse_file()
        ../../gcc/fortran/parse.c:6546
0x74021f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95827] ICE in gfc_get_string, at fortran/iresolve.c:70
  2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
@ 2020-06-22 21:08 ` anlauf at gcc dot gnu.org
  2020-06-23 21:11 ` anlauf at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-22 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #1 from anlauf at gcc dot gnu.org ---
Patch:

diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index aa9bb328a0f..73769615c20 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -47,8 +47,8 @@ along with GCC; see the file COPYING3.  If not see
 const char *
 gfc_get_string (const char *format, ...)
 {
-  /* Provide sufficient space to hold "_F.symbol.symbol_MOD_symbol".  */
-  char temp_name[4 + 2*GFC_MAX_SYMBOL_LEN + 5 + GFC_MAX_SYMBOL_LEN + 1];
+  /* Provide sufficient space for "_F.caf_token__symbol.symbol_MOD_symbol". 
*/
+  char temp_name[15 + 2*GFC_MAX_SYMBOL_LEN + 5 + GFC_MAX_SYMBOL_LEN + 1];
   const char *str;
   va_list ap;
   tree ident;

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

* [Bug fortran/95827] ICE in gfc_get_string, at fortran/iresolve.c:70
  2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
  2020-06-22 21:08 ` [Bug fortran/95827] " anlauf at gcc dot gnu.org
@ 2020-06-23 21:11 ` anlauf at gcc dot gnu.org
  2020-06-24 19:04 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-23 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/95827] ICE in gfc_get_string, at fortran/iresolve.c:70
  2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
  2020-06-22 21:08 ` [Bug fortran/95827] " anlauf at gcc dot gnu.org
  2020-06-23 21:11 ` anlauf at gcc dot gnu.org
@ 2020-06-24 19:04 ` cvs-commit at gcc dot gnu.org
  2020-06-25 19:34 ` cvs-commit at gcc dot gnu.org
  2020-06-26 19:12 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

commit r11-1634-ga16d0924f18046704ef9a4b6d9593718594677f1
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 24 21:03:47 2020 +0200

    PR fortran/95827 - Buffer overflows with submodules and coarrays

    With submodules and coarrays, name mangling results in long internal
    symbols.  Enlarge internal buffer.

    gcc/fortran/
            PR fortran/95827
            * iresolve.c (gfc_get_string): Enlarge internal buffer used in
            generating the mangled name.

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

* [Bug fortran/95827] ICE in gfc_get_string, at fortran/iresolve.c:70
  2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-24 19:04 ` cvs-commit at gcc dot gnu.org
@ 2020-06-25 19:34 ` cvs-commit at gcc dot gnu.org
  2020-06-26 19:12 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-25 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:69240fb9428513687d451af19fb762687fe65786

commit r10-8370-g69240fb9428513687d451af19fb762687fe65786
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jun 24 21:03:47 2020 +0200

    PR fortran/95827 - Buffer overflows with submodules and coarrays

    With submodules and coarrays, name mangling results in long internal
    symbols.  Enlarge internal buffer.

    gcc/fortran/
            PR fortran/95827
            * iresolve.c (gfc_get_string): Enlarge internal buffer used in
            generating the mangled name.

    (cherry picked from commit a16d0924f18046704ef9a4b6d9593718594677f1)

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

* [Bug fortran/95827] ICE in gfc_get_string, at fortran/iresolve.c:70
  2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-06-25 19:34 ` cvs-commit at gcc dot gnu.org
@ 2020-06-26 19:12 ` anlauf at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-26 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
FIXED on master for gcc-11, and on 10-branch.

Thanks for the report!

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

end of thread, other threads:[~2020-06-26 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 20:20 [Bug fortran/95827] New: ICE in gfc_get_string, at fortran/iresolve.c:70 gscfq@t-online.de
2020-06-22 21:08 ` [Bug fortran/95827] " anlauf at gcc dot gnu.org
2020-06-23 21:11 ` anlauf at gcc dot gnu.org
2020-06-24 19:04 ` cvs-commit at gcc dot gnu.org
2020-06-25 19:34 ` cvs-commit at gcc dot gnu.org
2020-06-26 19:12 ` 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).