public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-21 14:01 ` dcb314 at hotmail dot com
  2021-01-04 22:46 ` anlauf at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2020-03-21 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #20 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Arseny Solokha from comment #17)
> Just in case, w/ gcc/testsuite/gfortran.dg/class_61.f90 (as of r268503):
> 
> ==20572== Invalid read of size 8
> ==20572==    at 0x8150A4: resolve_component(gfc_component*, gfc_symbol*)
> (resolve.c:13809)
> ==20572==    by 0x815BB2: resolve_fl_derived0(gfc_symbol*) [clone .part.54]
> (resolve.c:14258)
> ==20572==    by 0x8161FF: resolve_fl_derived0 (resolve.c:14357)
> ==20572==    by 0x8161FF: resolve_fl_derived(gfc_symbol*) (resolve.c:14387)

I can confirm that I am still seeing this one, over a year later.

Since the code is in error, probably not a high priority.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
  2020-03-21 14:01 ` [Bug fortran/78746] charlen_03, charlen_10 ICE dcb314 at hotmail dot com
@ 2021-01-04 22:46 ` anlauf at gcc dot gnu.org
  2021-01-05 20:42 ` anlauf at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-04 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #21 from anlauf at gcc dot gnu.org ---
Potential fix:

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index fa6f756d285..891db391907 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -14384,7 +14396,7 @@ resolve_component (gfc_component *c, gfc_symbol *sym)
   /* F2008, C448.  */
   if (c->ts.type == BT_CLASS)
     {
-      if (CLASS_DATA (c))
+      if (c->attr.class_ok && CLASS_DATA (c))
        {
          attr = &(CLASS_DATA (c)->attr);

At least valgrind is happy with that change.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
  2020-03-21 14:01 ` [Bug fortran/78746] charlen_03, charlen_10 ICE dcb314 at hotmail dot com
  2021-01-04 22:46 ` anlauf at gcc dot gnu.org
@ 2021-01-05 20:42 ` anlauf at gcc dot gnu.org
  2021-01-06 18:37 ` cvs-commit at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-05 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #22 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2021-January/055551.html

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-01-05 20:42 ` anlauf at gcc dot gnu.org
@ 2021-01-06 18:37 ` cvs-commit at gcc dot gnu.org
  2021-01-07 19:30 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-06 18:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 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:8b6f1e8f97fe0d435d334075821149dbd85c8266

commit r11-6505-g8b6f1e8f97fe0d435d334075821149dbd85c8266
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jan 6 19:37:11 2021 +0100

    PR fortran/78746 - invalid access after error recovery

    The error recovery after an invalid reference to an undefined CLASS
    during a TYPE declaration lead to an invalid access.  Add a check.

    gcc/fortran/ChangeLog:

            * resolve.c (resolve_component): Add check for valid CLASS
            reference before trying to access CLASS data.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-01-06 18:37 ` cvs-commit at gcc dot gnu.org
@ 2021-01-07 19:30 ` cvs-commit at gcc dot gnu.org
  2021-01-07 19:33 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-07 19:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 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:19eb1973321375190485bc49e68992863b1972bf

commit r10-9234-g19eb1973321375190485bc49e68992863b1972bf
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jan 6 19:37:11 2021 +0100

    PR fortran/78746 - invalid access after error recovery

    The error recovery after an invalid reference to an undefined CLASS
    during a TYPE declaration lead to an invalid access.  Add a check.

    gcc/fortran/ChangeLog:

            * resolve.c (resolve_component): Add check for valid CLASS
            reference before trying to access CLASS data.

    (cherry picked from commit 8b6f1e8f97fe0d435d334075821149dbd85c8266)

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-01-07 19:30 ` cvs-commit at gcc dot gnu.org
@ 2021-01-07 19:33 ` cvs-commit at gcc dot gnu.org
  2021-01-07 19:41 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-07 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 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:ef7d053ea33cc9abc7fc413213705a16478fefc4

commit r9-9162-gef7d053ea33cc9abc7fc413213705a16478fefc4
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Wed Jan 6 19:37:11 2021 +0100

    PR fortran/78746 - invalid access after error recovery

    The error recovery after an invalid reference to an undefined CLASS
    during a TYPE declaration lead to an invalid access.  Add a check.

    gcc/fortran/ChangeLog:

            * resolve.c (resolve_component): Add check for valid CLASS
            reference before trying to access CLASS data.

    (cherry picked from commit 8b6f1e8f97fe0d435d334075821149dbd85c8266)

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-01-07 19:33 ` cvs-commit at gcc dot gnu.org
@ 2021-01-07 19:41 ` anlauf at gcc dot gnu.org
  2021-01-13 11:35 ` dominiq at lps dot ens.fr
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-07 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #26 from anlauf at gcc dot gnu.org ---
Should be fixed on master for gcc-11, and on 10- and 9-branch.
Validated with valgrind that class_61.f90 no longer shows the issue.

Closing.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-01-07 19:41 ` anlauf at gcc dot gnu.org
@ 2021-01-13 11:35 ` dominiq at lps dot ens.fr
  2021-01-13 15:42 ` anlauf at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-01-13 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

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

--- Comment #27 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
At revision r11-6550 my instrumented compiler gives:

pr78746.f90:5:40:

    5 |       character(:), allocatable :: x(n) ! { dg-error "must have a
deferred shape" }
      |                                        1
Error: Allocatable component of structure at (1) must have a deferred shape
=================================================================
==33829==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000000ee8
at pc 0x000100423feb bp 0x7ffeefbfe3b0 sp 0x7ffeefbfe3a8
READ of size 8 at 0x604000000ee8 thread T0
...

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-01-13 11:35 ` dominiq at lps dot ens.fr
@ 2021-01-13 15:42 ` anlauf at gcc dot gnu.org
  2021-01-13 16:12 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-13 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |WAITING

--- Comment #28 from anlauf at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #27)
> At revision r11-6550 my instrumented compiler gives:
> 
> pr78746.f90:5:40:
> 
>     5 |       character(:), allocatable :: x(n) ! { dg-error "must have a
> deferred shape" }
>       |                                        1
> Error: Allocatable component of structure at (1) must have a deferred shape
> =================================================================
> ==33829==ERROR: AddressSanitizer: heap-use-after-free on address
> 0x604000000ee8 at pc 0x000100423feb bp 0x7ffeefbfe3b0 sp 0x7ffeefbfe3a8
> READ of size 8 at 0x604000000ee8 thread T0
> ...

There's no testcase named "pr78746.f90" in the testsuite.

Would you please open a new PR with enough information?

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2021-01-13 15:42 ` anlauf at gcc dot gnu.org
@ 2021-01-13 16:12 ` dominiq at lps dot ens.fr
  2021-01-13 16:34 ` anlauf at gcc dot gnu.org
  2021-01-13 20:06 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-01-13 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #29 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> There's no testcase named "pr78746.f90" in the testsuite.

Ideed! My prxxxxx.f90 are in the test suite only when they are fixed.

Now my "pr78746.f90" is exactly charlen_03.f90.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2021-01-13 16:12 ` dominiq at lps dot ens.fr
@ 2021-01-13 16:34 ` anlauf at gcc dot gnu.org
  2021-01-13 20:06 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-13 16:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #30 from anlauf at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #29)
> > There's no testcase named "pr78746.f90" in the testsuite.
> 
> Ideed! My prxxxxx.f90 are in the test suite only when they are fixed.
> 
> Now my "pr78746.f90" is exactly charlen_03.f90.

... which was removed by Steve.

We're running in circles, so please open a new pr.

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

* [Bug fortran/78746] charlen_03, charlen_10 ICE
       [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2021-01-13 16:34 ` anlauf at gcc dot gnu.org
@ 2021-01-13 20:06 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-13 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #31 from anlauf at gcc dot gnu.org ---
The valgrind issues with error-recovery with charlen_03 has been moved to
PR98661, and there is no longer an ICE as reported here.

To avoid further cluttering of the present PR, please add further comments
there.

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

end of thread, other threads:[~2021-01-13 20:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-78746-4@http.gcc.gnu.org/bugzilla/>
2020-03-21 14:01 ` [Bug fortran/78746] charlen_03, charlen_10 ICE dcb314 at hotmail dot com
2021-01-04 22:46 ` anlauf at gcc dot gnu.org
2021-01-05 20:42 ` anlauf at gcc dot gnu.org
2021-01-06 18:37 ` cvs-commit at gcc dot gnu.org
2021-01-07 19:30 ` cvs-commit at gcc dot gnu.org
2021-01-07 19:33 ` cvs-commit at gcc dot gnu.org
2021-01-07 19:41 ` anlauf at gcc dot gnu.org
2021-01-13 11:35 ` dominiq at lps dot ens.fr
2021-01-13 15:42 ` anlauf at gcc dot gnu.org
2021-01-13 16:12 ` dominiq at lps dot ens.fr
2021-01-13 16:34 ` anlauf at gcc dot gnu.org
2021-01-13 20:06 ` 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).