public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/96025] [9/10/11 Regression] ICE in expr_check_typed_help, at fortran/expr.c:5437
Date: Wed, 01 Jul 2020 20:19:17 +0000	[thread overview]
Message-ID: <bug-96025-4-ocMeZum82m@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96025-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-07-01

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
GCC11 and GCC7 give

pr96025.f90:4:13:

    4 |    character(char(1)) function f()
      |             1
Error: Expression at (1) must be of INTEGER type, found CHARACTER

but the instrumented compiler gives

==71986==ERROR: AddressSanitizer: heap-use-after-free on address 0x604000000f90
at pc 0x00010015d5e6 bp 0x7ffeefbfe490 sp 0x7ffeefbfe488
READ of size 8 at 0x604000000f90 thread T0
    #0 0x10015d5e5 in gfc_traverse_expr(gfc_expr*, gfc_symbol*, bool
(*)(gfc_expr*, gfc_symbol*, int*), int) expr.c:5217
    #1 0x1001709cb in gfc_expr_check_typed(gfc_expr*, gfc_namespace*, bool)
expr.c:5475
    #2 0x1003575e0 in check_function_result_typed() parse.c:3720
    #3 0x10036b22d in parse_spec(gfc_statement) parse.c:3827
    #4 0x100371f06 in parse_progunit(gfc_statement) parse.c:5852
    #5 0x100372910 in parse_contained(int) parse.c:5753
    #6 0x1003724c5 in parse_progunit(gfc_statement) parse.c:5924
    #7 0x10037465f in gfc_parse_file() parse.c:6393
    #8 0x10055a224 in gfc_be_parse_file() f95-lang.c:212
    #9 0x106b46254 in compile_file() toplev.c:458
    #10 0x106b552e3 in do_compile() toplev.c:2307
    #11 0x10a42f19e in toplev::main(int, char**) toplev.c:2446
    #12 0x10a933d44 in main main.c:39
    #13 0x7fff6bb23cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8)

0x604000000f90 is located 0 bytes inside of 48-byte region
[0x604000000f90,0x604000000fc0)
freed by thread T0 here:
    #0 0x15b8378f7 in wrap_free.part.0+0x97 (libasan.6.dylib:x86_64+0x4a8f7)
    #1 0x10050d6db in gfc_free_charlen(gfc_charlen*, gfc_charlen*)
symbol.c:3990
    #2 0x10050da95 in gfc_free_namespace(gfc_namespace*) symbol.c:4041
    #3 0x1000d5a47 in gfc_match_char_spec(gfc_typespec*) decl.c:3506
    #4 0x1000f171d in gfc_match_decl_type_spec(gfc_typespec*, int) decl.c:4166
    #5 0x1000f59ce in gfc_match_prefix(gfc_typespec*) decl.c:6317
    #6 0x100364d2d in match_deferred_characteristics(gfc_typespec*)
parse.c:3666
    #7 0x10036ba1e in parse_spec(gfc_statement) parse.c:3936
    #8 0x100371f06 in parse_progunit(gfc_statement) parse.c:5852
    #9 0x100372910 in parse_contained(int) parse.c:5753
    #10 0x1003724c5 in parse_progunit(gfc_statement) parse.c:5924
    #11 0x10037465f in gfc_parse_file() parse.c:6393
    #12 0x10055a224 in gfc_be_parse_file() f95-lang.c:212
    #13 0x106b46254 in compile_file() toplev.c:458
    #14 0x106b552e3 in do_compile() toplev.c:2307
    #15 0x10a42f19e in toplev::main(int, char**) toplev.c:2446
    #16 0x10a933d44 in main main.c:39
    #17 0x7fff6bb23cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8)

previously allocated by thread T0 here:
    #0 0x15b837fff in wrap_calloc+0xbf (libasan.6.dylib:x86_64+0x4afff)
    #1 0x109833754 in xcalloc xmalloc.c:162
    #2 0x10050b457 in gfc_new_charlen(gfc_namespace*, gfc_charlen*)
symbol.c:3954
    #3 0x10044a874 in fixup_charlen(gfc_expr*) resolve.c:6078
    #4 0x10041538e in gfc_resolve_expr(gfc_expr*) resolve.c:7108
    #5 0x1001650df in gfc_reduce_init_expr(gfc_expr*) expr.c:3085
    #6 0x1000d59b5 in gfc_match_char_spec(gfc_typespec*) decl.c:3496
    #7 0x1000f171d in gfc_match_decl_type_spec(gfc_typespec*, int) decl.c:4166
    #8 0x1000f59ce in gfc_match_prefix(gfc_typespec*) decl.c:6317
    #9 0x100364d2d in match_deferred_characteristics(gfc_typespec*)
parse.c:3666
    #10 0x10036ba1e in parse_spec(gfc_statement) parse.c:3936
    #11 0x100371f06 in parse_progunit(gfc_statement) parse.c:5852
    #12 0x100372910 in parse_contained(int) parse.c:5753
    #13 0x1003724c5 in parse_progunit(gfc_statement) parse.c:5924
    #14 0x10037465f in gfc_parse_file() parse.c:6393
    #15 0x10055a224 in gfc_be_parse_file() f95-lang.c:212
    #16 0x106b46254 in compile_file() toplev.c:458
    #17 0x106b552e3 in do_compile() toplev.c:2307
    #18 0x10a42f19e in toplev::main(int, char**) toplev.c:2446
    #19 0x10a933d44 in main main.c:39
    #20 0x7fff6bb23cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8)


For GCC8 to GCC10 I get a

(null):0: confused by earlier errors, bailing out

(release builds)/

  parent reply	other threads:[~2020-07-01 20:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 19:31 [Bug fortran/96025] New: " gscfq@t-online.de
2020-07-01 19:32 ` [Bug fortran/96025] " gscfq@t-online.de
2020-07-01 20:19 ` dominiq at lps dot ens.fr [this message]
2020-07-01 21:21 ` kargl at gcc dot gnu.org
2020-07-01 21:21 ` kargl at gcc dot gnu.org
2020-07-02  6:43 ` rguenth at gcc dot gnu.org
2020-07-04  9:28 ` dominiq at lps dot ens.fr
2021-06-01  8:17 ` [Bug fortran/96025] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-05-27  9:43 ` [Bug fortran/96025] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-02-19 21:02 ` anlauf at gcc dot gnu.org
2023-02-20 20:43 ` anlauf at gcc dot gnu.org
2023-02-21 18:04 ` cvs-commit at gcc dot gnu.org
2023-03-04 19:51 ` cvs-commit at gcc dot gnu.org
2023-03-05 19:35 ` cvs-commit at gcc dot gnu.org
2023-03-05 19:36 ` cvs-commit at gcc dot gnu.org
2023-03-05 19:38 ` anlauf at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96025-4-ocMeZum82m@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).