public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/35293]  New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
@ 2008-02-22  7:52 hp at gcc dot gnu dot org
  2008-02-22 14:11 ` [Bug libfortran/35293] " jvdelisle at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-22  7:52 UTC (permalink / raw)
  To: gcc-bugs

With a commit in the range 132503:132513, gfortran.dg/streamio_11.f90
gfortran.dg/streamio_3.f90 and gfortran.dg/streamio_4.f90 started to fail,
besides
the new test gfortran.dg/streamio_15.f90. The failure is just a call to abort.
The patch exposing the failure seems to be
<http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00814.html>. There's analysis in
the follow-up message in
<http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00901.html>.
To wit, it seems like one or more bugs in libgfortran/io/unix.c:fd_truncate.


-- 
           Summary: [4.4 Regression] truncation errors with
                    gfortran.dg/streamio_11.f90, 3, 4 and 15.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hp at gcc dot gnu dot org
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: cris-axis-elf


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
@ 2008-02-22 14:11 ` jvdelisle at gcc dot gnu dot org
  2008-02-22 14:20 ` jvdelisle at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-22 14:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2008-02-22 14:10 -------
Created an attachment (id=15207)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15207&action=view)
Modified streamio_15.f90 test case

hp, can you try this test case and post the output and also a hex dump of the
content of the file "fort.20".  The problem is on cris-elf?  Are you testing
with a simulator on x86_64-unknown-linux-gnu?  I am trying to understand the
environment.  :)


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
  2008-02-22 14:11 ` [Bug libfortran/35293] " jvdelisle at gcc dot gnu dot org
@ 2008-02-22 14:20 ` jvdelisle at gcc dot gnu dot org
  2008-02-24 20:15 ` hp at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-22 14:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2008-02-22 14:19 -------
oops, the file name is foo.txt


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
  2008-02-22 14:11 ` [Bug libfortran/35293] " jvdelisle at gcc dot gnu dot org
  2008-02-22 14:20 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-24 20:15 ` hp at gcc dot gnu dot org
  2008-02-24 20:18 ` hp at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-24 20:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hp at gcc dot gnu dot org  2008-02-24 20:14 -------
(In reply to comment #1)
> Are you testing
> with a simulator on x86_64-unknown-linux-gnu?  I am trying to understand the
> environment.  :)

Hm, I thought I was clear enough with the bug report unambiguously indicating a
cross target, with the *-elf indicating and the message pointed to saying
"(remember, cris-elf is one of those challenged newlib simulator targets)" but
to wit: yes, your reading is correct.  If there's a clearer way of saying it,
send patches.

For the pr35132.f90 attachment, abort is called and "hexdump -C foo.txt"
produces:
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 31 32 33  34 35 36 0a 61 62 63 64  |.....123456.abcd|
00000020  65 66 0a 71 77 65 72 74  79 0a                    |ef.qwerty.|
0000002a
(foo.txt will also be attached as-is for your enjoyment)

I'll work on a patch to unix.c:fd_truncate.


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-02-24 20:15 ` hp at gcc dot gnu dot org
@ 2008-02-24 20:18 ` hp at gcc dot gnu dot org
  2008-02-24 20:26 ` hp at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-24 20:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hp at gcc dot gnu dot org  2008-02-24 20:17 -------
Created an attachment (id=15220)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15220&action=view)
foo.txt as was output from above modified test-case


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-02-24 20:18 ` hp at gcc dot gnu dot org
@ 2008-02-24 20:26 ` hp at gcc dot gnu dot org
  2008-02-24 20:50 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-24 20:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hp at gcc dot gnu dot org  2008-02-24 20:25 -------
The above was with 132513.


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-02-24 20:26 ` hp at gcc dot gnu dot org
@ 2008-02-24 20:50 ` jvdelisle at gcc dot gnu dot org
  2008-02-26 21:45 ` tkoenig at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-24 20:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2008-02-24 20:49 -------
Besides not truncating or even seeking, the leading NULLs in the file are very
bad.


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-02-24 20:50 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-26 21:45 ` tkoenig at gcc dot gnu dot org
  2008-02-26 22:48 ` hp at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-02-26 21:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tkoenig at gcc dot gnu dot org  2008-02-26 21:45 -------
If we don't have a way to truncate a file, we won't have an
easy time enforcing Fortran semantics.  Are there any other
ways of truncating a file on that particular target?

If there aren't, we could

a) refuse to configure for that target at all
b) fail at runtime (noisily) and xfail the
   corresponding test cases
c) juggle the file offsets, never read past the
   (logical) end of file and do a copy-on-close.  Yuck.

My personal preference would go towards b), but again - there
has to be a way of truncating a file, right?


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-02-26 21:45 ` tkoenig at gcc dot gnu dot org
@ 2008-02-26 22:48 ` hp at gcc dot gnu dot org
  2008-02-26 23:19 ` tkoenig at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-26 22:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hp at gcc dot gnu dot org  2008-02-26 22:47 -------
(In reply to comment #7)
> If we don't have a way to truncate a file, we won't have an
> easy time enforcing Fortran semantics.  Are there any other
> ways of truncating a file on that particular target?

I can certainly add support for this particular target, but the same goes for
*all* newlib targets except sh and spu.

> a) refuse to configure for that target at all

I mentioned this in the analysis (second url in description), but I'd advise
against it, as it'd imply breaking builds for all newlib targets configured
without --enable-targets=all-except-fortran - except for the one that marks
fortran as unsupported (using unsupported_languages in top/configure.ac).

> b) fail at runtime (noisily) and xfail the
>    corresponding test cases

*sigh* ok, I'll do it, except for the noise.  As I mentioned, there are a few
bugs there anyway, but nobody commented on that.

> c) juggle the file offsets, never read past the
>    (logical) end of file and do a copy-on-close.  Yuck.

Not me.

> My personal preference would go towards b), but again - there
> has to be a way of truncating a file, right?

There's no incentive.  Bare-iron targets rarely really care about having a full
POSIX-or-whatever set of file operations.


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |hp at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-26 22:47:59
               date|                            |


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-02-26 22:48 ` hp at gcc dot gnu dot org
@ 2008-02-26 23:19 ` tkoenig at gcc dot gnu dot org
  2008-02-26 23:38 ` hp at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2008-02-26 23:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from tkoenig at gcc dot gnu dot org  2008-02-26 23:19 -------
(In reply to comment #8)


> > b) fail at runtime (noisily) and xfail the
> >    corresponding test cases
> 
> *sigh* ok, I'll do it, except for the noise.

Thanks a lot!

You'll probably want to make the truncate a no-op if we
are at the end of file already.  IIRC, there may be a few
places in the library where we call ftruncate() even
if we don't really need to.

> As I mentioned, there are a few
> bugs there anyway, but nobody commented on that.

We know :-(

The alloc stream facility has quite a few bugs in unexpected places
that tend to be exposed by seemingly harmless changes far away.
It needs to be replaced someday, but so far nobody has made a
start on this.  This is PR 25561, dated 2005-12-25.


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-02-26 23:19 ` tkoenig at gcc dot gnu dot org
@ 2008-02-26 23:38 ` hp at gcc dot gnu dot org
  2008-03-04 18:12 ` hp at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-02-26 23:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from hp at gcc dot gnu dot org  2008-02-26 23:37 -------
(In reply to comment #9)
> You'll probably want to make the truncate a no-op if we
> are at the end of file already.

No, that'd be an unrelated change.  I don't wanna mix things up and/or
together.


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-02-26 23:38 ` hp at gcc dot gnu dot org
@ 2008-03-04 18:12 ` hp at gcc dot gnu dot org
  2008-03-05  1:52 ` hp at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-04 18:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from hp at gcc dot gnu dot org  2008-03-04 18:12 -------
Patches at <http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00225.html> and
<http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00226.html>.


-- 

hp at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-03-04 18:12 ` hp at gcc dot gnu dot org
@ 2008-03-05  1:52 ` hp at gcc dot gnu dot org
  2008-03-05  1:56 ` hp at gcc dot gnu dot org
  2008-03-05  1:59 ` hp at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-05  1:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from hp at gcc dot gnu dot org  2008-03-05 01:51 -------
Subject: Bug 35293

Author: hp
Date: Wed Mar  5 01:50:33 2008
New Revision: 132888

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132888
Log:
        PR libfortran/35293
        * io/unix.c (fd_truncate): Fold s->special_file case into
        success case of ftruncate/chsize call instead of the failure case.
        Make failure case actually return failure.  Properly update stream
        pointers on failure.  Call runtime_error for targets without
        neither ftruncate nor chsize where such a call would be needed.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/unix.c


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2008-03-05  1:52 ` hp at gcc dot gnu dot org
@ 2008-03-05  1:56 ` hp at gcc dot gnu dot org
  2008-03-05  1:59 ` hp at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-05  1:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from hp at gcc dot gnu dot org  2008-03-05 01:56 -------
Subject: Bug 35293

Author: hp
Date: Wed Mar  5 01:55:27 2008
New Revision: 132889

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132889
Log:
        PR libfortran/35293
        * lib/lib/target-supports.exp (check_effective_target_fd_truncate):
        New.
        * gfortran.fortran-torture/execute/list_read_1.x,
...
        gfortran.dg/write_back.f: Gate test on effective_target
        fd_truncate.
(missing PR ChangeLog decoration)

Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug libfortran/35293] [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15.
  2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2008-03-05  1:56 ` hp at gcc dot gnu dot org
@ 2008-03-05  1:59 ` hp at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: hp at gcc dot gnu dot org @ 2008-03-05  1:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hp at gcc dot gnu dot org  2008-03-05 01:58 -------
Patches committed, case closed.


-- 

hp at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-03-05  1:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-22  7:52 [Bug libfortran/35293] New: [4.4 Regression] truncation errors with gfortran.dg/streamio_11.f90, 3, 4 and 15 hp at gcc dot gnu dot org
2008-02-22 14:11 ` [Bug libfortran/35293] " jvdelisle at gcc dot gnu dot org
2008-02-22 14:20 ` jvdelisle at gcc dot gnu dot org
2008-02-24 20:15 ` hp at gcc dot gnu dot org
2008-02-24 20:18 ` hp at gcc dot gnu dot org
2008-02-24 20:26 ` hp at gcc dot gnu dot org
2008-02-24 20:50 ` jvdelisle at gcc dot gnu dot org
2008-02-26 21:45 ` tkoenig at gcc dot gnu dot org
2008-02-26 22:48 ` hp at gcc dot gnu dot org
2008-02-26 23:19 ` tkoenig at gcc dot gnu dot org
2008-02-26 23:38 ` hp at gcc dot gnu dot org
2008-03-04 18:12 ` hp at gcc dot gnu dot org
2008-03-05  1:52 ` hp at gcc dot gnu dot org
2008-03-05  1:56 ` hp at gcc dot gnu dot org
2008-03-05  1:59 ` hp at gcc dot gnu dot 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).