* [Bug fortran/95689] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
@ 2020-06-15 19:10 ` marxin at gcc dot gnu.org
2020-06-15 20:21 ` [Bug fortran/95689] [8/9/10/11 Regression] " anlauf at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-15 19:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldot at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Last reconfirmed| |2020-6-15
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r8-3955-g439d2350251a050f.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
2020-06-15 19:10 ` [Bug fortran/95689] " marxin at gcc dot gnu.org
@ 2020-06-15 20:21 ` anlauf at gcc dot gnu.org
2020-06-15 20:48 ` anlauf at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-15 20:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
CC| |anlauf at gcc dot gnu.org
Ever confirmed|0 |1
Priority|P3 |P4
Summary|ICE in |[8/9/10/11 Regression] ICE
|check_sym_interfaces, at |in check_sym_interfaces, at
|fortran/interface.c:2015 |fortran/interface.c:2015
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
--- Comment #2 from anlauf at gcc dot gnu.org ---
Technically an 8/9/10/11 regression.
The following patch fixes the ICE for me:
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index f33c6632b45..b1a75a37b0e 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1981,7 +1981,8 @@ check_interface1 (gfc_interface *p, gfc_interface *q0,
static void
check_sym_interfaces (gfc_symbol *sym)
{
- char interface_name[GFC_MAX_SYMBOL_LEN + sizeof("generic interface ''")];
+ /* Provide sufficient space to hold "generic interface 'symbol.symbol'". */
+ char interface_name[2*GFC_MAX_SYMBOL_LEN+2 + sizeof("generic interface
''")];
gfc_interface *p;
if (sym->ns != gfc_current_ns)
@@ -1989,6 +1990,8 @@ check_sym_interfaces (gfc_symbol *sym)
if (sym->generic != NULL)
{
+ size_t len = strlen (sym->name) + sizeof("generic interface ''");
+ gcc_assert (len < sizeof (interface_name));
sprintf (interface_name, "generic interface '%s'", sym->name);
if (check_interface0 (sym->generic, interface_name))
return;
Not regtested yet. The testcase may show subsequent fallout elsewhere
(i.e. for builds with special protection against buffer overflows).
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
2020-06-15 19:10 ` [Bug fortran/95689] " marxin at gcc dot gnu.org
2020-06-15 20:21 ` [Bug fortran/95689] [8/9/10/11 Regression] " anlauf at gcc dot gnu.org
@ 2020-06-15 20:48 ` anlauf at gcc dot gnu.org
2020-06-16 6:40 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-15 20:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #3 from anlauf at gcc dot gnu.org ---
Patch submitted for review:
https://gcc.gnu.org/pipermail/fortran/2020-June/054525.html
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (2 preceding siblings ...)
2020-06-15 20:48 ` anlauf at gcc dot gnu.org
@ 2020-06-16 6:40 ` rguenth at gcc dot gnu.org
2020-06-20 14:10 ` cvs-commit at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-16 6:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |8.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (3 preceding siblings ...)
2020-06-16 6:40 ` rguenth at gcc dot gnu.org
@ 2020-06-20 14:10 ` cvs-commit at gcc dot gnu.org
2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-20 14:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- 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:62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6
commit r11-1567-g62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sat Jun 20 16:09:45 2020 +0200
PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (4 preceding siblings ...)
2020-06-20 14:10 ` cvs-commit at gcc dot gnu.org
@ 2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:21 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ 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=95689
--- Comment #5 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:ece7b4d5f0cef0811ee1a0ebbf00ba41c5cf080c
commit r10-8338-gece7b4d5f0cef0811ee1a0ebbf00ba41c5cf080c
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sat Jun 20 16:09:45 2020 +0200
PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
(cherry picked from commit 62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (5 preceding siblings ...)
2020-06-22 19:30 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:21 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:40 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-23 20:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #6 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:84323d9fa7526496d844f167f6353e0ec12279e8
commit r9-8693-g84323d9fa7526496d844f167f6353e0ec12279e8
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sat Jun 20 16:09:45 2020 +0200
PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
(cherry picked from commit 62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (6 preceding siblings ...)
2020-06-23 20:21 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:40 ` cvs-commit at gcc dot gnu.org
2020-06-23 20:42 ` anlauf at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-23 20:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:4cfdae8e4a96912871865d289a5a817cec68eaa0
commit r8-10325-g4cfdae8e4a96912871865d289a5a817cec68eaa0
Author: Harald Anlauf <anlauf@gmx.de>
Date: Sat Jun 20 16:09:45 2020 +0200
PR fortran/95689 - ICE in check_sym_interfaces, at fortran/interface.c:2015
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
(cherry picked from commit 62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (7 preceding siblings ...)
2020-06-23 20:40 ` cvs-commit at gcc dot gnu.org
@ 2020-06-23 20:42 ` anlauf at gcc dot gnu.org
2020-06-24 20:41 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-23 20:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
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 all open branches.
Thanks for the report!
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (8 preceding siblings ...)
2020-06-23 20:42 ` anlauf at gcc dot gnu.org
@ 2020-06-24 20:41 ` cvs-commit at gcc dot gnu.org
2020-06-24 20:45 ` cvs-commit at gcc dot gnu.org
2020-06-25 18:51 ` anlauf at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 20:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:e1edfe597d9157b8b9b61c4677b38730a9a59936
commit r8-10327-ge1edfe597d9157b8b9b61c4677b38730a9a59936
Author: Harald Anlauf <anlauf@gmx.de>
Date: Wed Jun 24 22:33:11 2020 +0200
Revert "PR fortran/95689 - ICE in check_sym_interfaces, at
fortran/interface.c:2015"
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
gcc/testsuite/
PR fortran/95689
* gfortran.dg/pr95689.f90: New test.
(reverts the cherry-pick from commit
62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (9 preceding siblings ...)
2020-06-24 20:41 ` cvs-commit at gcc dot gnu.org
@ 2020-06-24 20:45 ` cvs-commit at gcc dot gnu.org
2020-06-25 18:51 ` anlauf at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 20:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #10 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:e3d976ae009b873596b47961869b7cdfc41d7e67
commit r9-8696-ge3d976ae009b873596b47961869b7cdfc41d7e67
Author: Harald Anlauf <anlauf@gmx.de>
Date: Wed Jun 24 22:44:11 2020 +0200
Revert "PR fortran/95689 - ICE in check_sym_interfaces, at
fortran/interface.c:2015"
With submodules, name mangling of interfaces may result in long internal
symbols overflowing an internal buffer. We now check that we do not
exceed the enlarged buffer size.
gcc/fortran/
PR fortran/95689
* interface.c (check_sym_interfaces): Enlarge temporary buffer,
and add check on length on mangled name to prevent overflow.
gcc/testsuite/
PR fortran/95689
* gfortran.dg/pr95689.f90: New test.
(reverts the cherry-pick from commit
62c0c0ea7bfb6f8f6b8d767b05120cafb6823da6)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug fortran/95689] [8/9/10/11 Regression] ICE in check_sym_interfaces, at fortran/interface.c:2015
2020-06-15 18:45 [Bug fortran/95689] New: ICE in check_sym_interfaces, at fortran/interface.c:2015 gscfq@t-online.de
` (10 preceding siblings ...)
2020-06-24 20:45 ` cvs-commit at gcc dot gnu.org
@ 2020-06-25 18:51 ` anlauf at gcc dot gnu.org
11 siblings, 0 replies; 13+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-06-25 18:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95689
--- Comment #11 from anlauf at gcc dot gnu.org ---
Reverted on 8- and 9-branch, since not a critical regression, and a clean
backport would need a manual backport of a series of other fixes.
^ permalink raw reply [flat|nested] 13+ messages in thread