Opened 9 years ago

Closed 9 years ago

#4827 closed bug (fixed)

Data.Array.IO.hPutArray/hGetArray ignore count argument

Reported by: dylex Owned by: batterseapower
Priority: high Milestone: 7.2.1
Component: libraries (other) Version: 6.12.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

The ghc versions of hGetArray and hPutArray in Data.Array.IO in the array library ignore their count arguments, and read or write the full array regardless. This was observed as a bug where extraneous garbage data was written to the end of a file. The non-ghc versions (appear) correct.

Attachments (2)

4827-testsuite.dpatch (1.8 KB) - added by batterseapower 9 years ago.
4827-array.dpatch (1.5 KB) - added by batterseapower 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by simonmar

Architecture: x86_64 (amd64)Unknown/Multiple
Milestone: 7.0.3
Operating System: LinuxUnknown/Multiple
Owner: set to simonmar
Priority: normalhigh

oh, that's bad.

Changed 9 years ago by batterseapower

Attachment: 4827-testsuite.dpatch added

Changed 9 years ago by batterseapower

Attachment: 4827-array.dpatch added

comment:2 Changed 9 years ago by batterseapower

Status: newpatch

Simple oversight, fixed by attached patch, with a new test.

comment:3 Changed 9 years ago by simonmar

Owner: changed from simonmar to batterseapower

Commit away...

comment:4 Changed 9 years ago by batterseapower

Resolution: fixed
Status: patchclosed

Fixed in:

commit bdf4ce746aefb2cfb3c767e0f458b653238c1672
Author: Max Bolingbroke <batterseapower@hotmail.com>
Date:   Tue Apr 5 22:48:26 2011 +0100

    Use count argument in hPutArray/hGetArray. Fixes #4827
commit 9617477db64e9e2bc3dbf8be4e29bc6233b363ea
Author: Max Bolingbroke <batterseapower@hotmail.com>
Date:   Tue Apr 5 22:55:35 2011 +0100

    Test that hPutArray/hGetArray use count argument: #4827
Note: See TracTickets for help on using tickets.