public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "juergen.reuter at desy dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66927] [6 Regression] ICE in gfc_conf_procedure_call
Date: Mon, 26 Oct 2015 23:42:00 -0000	[thread overview]
Message-ID: <bug-66927-4-SeH6y9WLlY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66927-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #15 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Here it it:
{{{
module lexers
  implicit none
  private
  type :: template_t
     private
     character(256) :: charset1
     integer :: len1
  end type template_t

contains

  subroutine match_quoted (tt, s, n)
    type(template_t), intent(in) :: tt
    character(*), intent(in) :: s
    integer, intent(out) :: n
    character(tt%len1) :: ch1
    ch1 = tt%charset1
  end subroutine match_quoted

end module lexers
}}}
I believe this comes from your commit, so I don't open up a new ticket. Would
be cool if this can be solved quickly.
>From gcc-bugs-return-500629-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 26 23:51:39 2015
Return-Path: <gcc-bugs-return-500629-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12960 invoked by alias); 26 Oct 2015 23:51:39 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 12832 invoked by uid 48); 26 Oct 2015 23:51:35 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/68107] New: Non-VLA type whose size is half or more of the address space constructed via a pointer
Date: Mon, 26 Oct 2015 23:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-68107-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg02184.txt.bz2
Content-length: 1146

https://gcc.gnu.org/bugzilla/show_bug.cgi?idh107

            Bug ID: 68107
           Summary: Non-VLA type whose size is half or more of the address
                    space constructed via a pointer
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ch3root at openwall dot com
  Target Milestone: ---

Due to an overflow in size calculation the following (seemingly reasonable)
program compiles fine, allocates too small array and crashes in a loop:

#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

#define N (SIZE_MAX / sizeof(int) + 2)

int main(void)
{
  int (*p)[N];
  printf("%zu\n", sizeof *p);
  p = malloc(sizeof *p);
  if (!p)
    return 1;
  for (size_t i = 0; i < N; i++)
    (*p)[i] = 1;

  return 0;
}

According to https://gcc.gnu.org/bugzilla/show_bug.cgi?idh065#c4 : "Any
construction of a non-VLA type whose size is half or more of the address space
should receive a compile-time error, like you get if you don't use a pointer
here."


  parent reply	other threads:[~2015-10-26 23:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-18  9:40 [Bug fortran/66927] New: [6.0 regression] " juergen.reuter at desy dot de
2015-07-18  9:41 ` [Bug fortran/66927] " juergen.reuter at desy dot de
2015-07-18  9:55 ` dominiq at lps dot ens.fr
2015-07-18  9:58 ` vehre at gcc dot gnu.org
2015-07-18 10:01 ` juergen.reuter at desy dot de
2015-07-18 13:01 ` vehre at gcc dot gnu.org
2015-07-21  7:58 ` [Bug fortran/66927] [6 Regression] " rguenth at gcc dot gnu.org
2015-08-06 10:09 ` vehre at gcc dot gnu.org
2015-10-06  8:40 ` vehre at gcc dot gnu.org
2015-10-16  8:34 ` rguenth at gcc dot gnu.org
2015-10-25 12:29 ` vehre at gcc dot gnu.org
2015-10-25 13:03 ` vehre at gcc dot gnu.org
2015-10-25 16:47 ` hjl.tools at gmail dot com
2015-10-25 18:04 ` vehre at gcc dot gnu.org
2015-10-26 13:04 ` vehre at gcc dot gnu.org
2015-10-26 22:43 ` juergen.reuter at desy dot de
2015-10-26 23:42 ` juergen.reuter at desy dot de [this message]
2015-10-27  0:55 ` kargl at gcc dot gnu.org
2015-10-27  1:01 ` juergen.reuter at desy dot de

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-66927-4-SeH6y9WLlY@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).