public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/25139] [4.1/4.2 regression] "Invalid argument" error on I/O
Date: Sat, 10 Dec 2005 16:39:00 -0000	[thread overview]
Message-ID: <20051210163926.16075.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25139-10129@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2005-12-10 16:39 -------
I found the problem in the second one, which is fixed by the one-line patch:

Index: io/file_pos.c
===================================================================
--- io/file_pos.c       (revision 108353)
+++ io/file_pos.c       (working copy)
@@ -109,13 +109,14 @@

   length = sizeof (gfc_offset);

-  p = salloc_r_at (u->s, &length,
-                  file_position (u->s) - length);
+  /* length is modified by this function call, and most probably
+     set to zero.  */
+  p = salloc_r_at (u->s, &length, file_position (u->s) - length);
   if (p == NULL)
     goto io_error;

   memcpy (&m, p, sizeof (gfc_offset));
-  new = file_position (u->s) - m - 2*length;
+  new = file_position (u->s) - m - sizeof (gfc_offset) - length;
   if (sseek (u->s, new) == FAILURE)
     goto io_error;


(well, more than one line since I added a comment so that we don't do this
mistake again). Since this does not fixed the other problem, I filed it
separately under PR 25340.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
           Keywords|                            |patch
   Last reconfirmed|2005-12-10 15:39:19         |2005-12-10 16:39:26
               date|                            |
   Target Milestone|---                         |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25139


  parent reply	other threads:[~2005-12-10 16:39 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-28 16:52 [Bug libfortran/25139] New: Fortran runtime error: Invalid argument dir at lanl dot gov
2005-11-29  2:16 ` [Bug libfortran/25139] " jvdelisle at gcc dot gnu dot org
2005-11-29 12:12 ` [Bug libfortran/25139] "Invalid argument" error on I/O fxcoudert at gcc dot gnu dot org
2005-11-29 12:29 ` fxcoudert at gcc dot gnu dot org
2005-11-29 18:37 ` jb at gcc dot gnu dot org
2005-12-10 15:39 ` [Bug libfortran/25139] [4.1/4.2 regression] " fxcoudert at gcc dot gnu dot org
2005-12-10 16:39 ` fxcoudert at gcc dot gnu dot org [this message]
2005-12-12 16:38 ` dir at lanl dot gov
2005-12-12 16:50 ` dir at lanl dot gov
2005-12-13 14:39 ` dir at lanl dot gov
2005-12-13 15:21 ` dir at lanl dot gov
2005-12-16 20:35 ` dir at lanl dot gov
2005-12-19  8:12 ` fxcoudert at gcc dot gnu dot org
2005-12-19 18:40 ` mmitchel at gcc dot gnu dot org
2005-12-21 19:36 ` dir at lanl dot gov
2005-12-21 20:21 ` kargl at gcc dot gnu dot org
2005-12-21 21:43 ` dir at lanl dot gov
2005-12-21 22:14 ` fxcoudert at gcc dot gnu dot org
2005-12-22  1:19 ` jvdelisle at gcc dot gnu dot org
2005-12-22  2:08 ` jvdelisle at gcc dot gnu dot org
2005-12-22 14:00 ` dir at lanl dot gov
2005-12-22 14:18 ` dir at lanl dot gov
2005-12-22 14:24 ` fxcoudert at gcc dot gnu dot org
2005-12-22 16:01 ` dir at lanl dot gov
2005-12-22 16:32 ` dir at lanl dot gov
2005-12-22 17:59 ` jvdelisle at gcc dot gnu dot org
2005-12-22 19:23 ` dir at lanl dot gov
2005-12-22 21:14 ` dir at lanl dot gov
2005-12-22 22:49 ` jvdelisle at gcc dot gnu dot org
2005-12-22 23:03 ` jvdelisle at gcc dot gnu dot org
2005-12-23  0:21 ` jvdelisle at gcc dot gnu dot org
2005-12-23 15:14 ` dir at lanl dot gov
2005-12-23 20:21 ` jvdelisle at gcc dot gnu dot org
2005-12-28 20:58 ` jvdelisle at gcc dot gnu dot org
2005-12-28 21:12 ` jvdelisle at gcc dot gnu dot org
2006-01-01  3:49 ` jvdelisle at gcc dot gnu dot org
2006-01-01  3:53 ` jvdelisle at gcc dot gnu dot org
2006-01-01  5:14 ` jvdelisle at gcc dot gnu dot 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=20051210163926.16075.qmail@sourceware.org \
    --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).