public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65089] FAIL: gfortran.dg/io_real_boz(2|_[45]).f90 when tested with -fsanitize=address
Date: Fri, 03 Apr 2015 20:11:00 -0000	[thread overview]
Message-ID: <bug-65089-4-sRP4FGDlYI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65089-4@http.gcc.gnu.org/bugzilla/>

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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

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

--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
With the following patch, the fsanitize error goes away in the io_real_boz2
case. With -std=f2003 the case yields an expected runtime error.  It is the
formatting of this error where the -fsanitize does not like referencing a
pointer for some reason.

Index: format.c
===================================================================
--- format.c    (revision 221842)
+++ format.c    (working copy)
@@ -1117,9 +1117,9 @@
 void
 format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
 {
-  int width, i, offset;
+  int width, i, offset, len;
 #define BUFLEN 300
-  char *p, buffer[BUFLEN];
+  char *p, *q, buffer[BUFLEN];
   format_data *fmt = dtp->u.p.fmt;

   if (f != NULL)
@@ -1132,9 +1132,12 @@
   else
     snprintf (buffer, BUFLEN, "%s\n", message);

+  /* Find the length of the format string.  */
+  for (q = p, len = 0; *q; len++, q++);
+
   /* Get the offset into the format string where the error occurred.  */
   offset = dtp->format_len - (fmt->reversion_ok ?
-                  (int) strlen(p) : fmt->format_string_len);
+                  len : fmt->format_string_len);

   width = dtp->format_len;


  parent reply	other threads:[~2015-04-03 20:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 10:07 [Bug fortran/65089] New: " dominiq at lps dot ens.fr
2015-04-03  0:03 ` [Bug fortran/65089] " hp at gcc dot gnu.org
2015-04-03  8:27 ` dominiq at lps dot ens.fr
2015-04-03 20:11 ` jvdelisle at gcc dot gnu.org [this message]
2015-04-03 22:25 ` jvdelisle at gcc dot gnu.org
2015-04-03 22:29 ` dominiq at lps dot ens.fr
2015-04-04  8:53 ` dominiq at lps dot ens.fr
2015-04-08 13:42 ` jakub at gcc dot gnu.org
2015-04-09  0:00 ` jvdelisle at gcc dot gnu.org
2015-04-09  6:39 ` jakub at gcc dot gnu.org
2015-04-09  8:48 ` dominiq at lps dot ens.fr
2015-04-09 12:08 ` jvdelisle at gcc dot gnu.org
2015-04-12  4:19 ` jvdelisle at gcc dot gnu.org
2015-04-12  7:47 ` dominiq at lps dot ens.fr
2015-04-15  1:27 ` jvdelisle at gcc dot gnu.org
2015-04-15  1:58 ` jvdelisle at gcc dot gnu.org
2015-09-07  9:57 ` dominiq at lps dot ens.fr

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-65089-4-sRP4FGDlYI@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).