Bug #378
closedError in "toffile" (Windows)
0%
Description
Occured in cross-platform testing under Cygwin 1.7.7:
E-Mail from ME to JR:
This problem:
Seeking to start of blocks using SEEK_END [0%------------25%-------------50%--------------75%----------100%] [* Error: unexpected read error after fseek(SEEK_END) to block 6140 Error: fseek() tests unsuccessful. LFS test failed.
I've seen this before in Win32, not sure if it's a problem with OFFile or a bug in the test program though.
What's happening here is that the test program jumps to a random offset with fseek(file, offset, SEEK_END), reads a data block there, but doesn't find the data that should be there at this offset. Either a calculation error in the test program, or a problem with the implementation of fseek(SEEK_END).
=== Nachtrag JR ===
After Uli's correction from 2010-12-13 the test gets a bit further:
Seeking to random positions using SEEK_CUR [0%------------25%-------------50%--------------75%----------100%] [ Error: unexpected read error after fseek(SEEK_CUR) to block 0 Error: fseek() tests unsuccessful. LFS test failed.
Updated by Andrew Chiw over 12 years ago
Possible error in "toffile" (Windows)
Description
Occured in cross-platform testing under Cygwin 1.7.7:
E-Mail from ME to JR:
This problem:
Seeking to start of blocks using SEEK_END [0%------------25%-------------50%--------------75%----------100%] [* Error: unexpected read error after fseek(SEEK_END) to block 6140 Error: fseek() tests unsuccessful. LFS test failed.
I've seen this before in Win32, not sure if it's a problem with OFFile or a bug in the test program though.
What's happening here is that the test program jumps to a random offset with fseek(file, offset, SEEK_END), reads a data block there, but doesn't find the data that should be there at this offset. Either a calculation error in the test program, or a problem with the implementation of fseek(SEEK_END).
=== Nachtrag JR ===
After Uli's correction from 2010-12-13 the test gets a bit further:
Seeking to random positions using SEEK_CUR [0%------------25%-------------50%--------------75%----------100%] [ Error: unexpected read error after fseek(SEEK_CUR) to block 0 Error: fseek() tests unsuccessful. LFS test failed.
Updated by Andrew Chiw over 12 years ago
- Subject changed from Möglicher Fehler in "toffile" (Windows) to Error in "toffile" (Windows)
Updated by Marco Eichelberg almost 9 years ago
- Status changed from New to Closed
Fixed the problem. Apparently the rewind() system call does not work when a read-only file was read to EOF before the call to rewind().
Fixed this by using fseek() instead, which does work.
Closed by commit 9b5a651.