View Issue Details

IDProjectCategoryView StatusLast Update
0034848FPCRTLpublic2019-10-13 14:36
ReporterhellotigerAssigned ToFlorian 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionreopened 
PlatformX86-64OSDebian LinuxOS Version9
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0034848: ISO mode file reading error
DescriptionOpen a typed binary file and try to read its contents after seeking to a new position. It works in the default mode but fails in the ISO mode. In ISO mode, the first read() call always reads the first element of the file, ignoring the seek() operation. The second read() call gets the element at the correct position.
Steps To Reproduce1. Download the attached Pascal source file and the test data file.
2. Compile the source using the default mode. Result:

File size: 11
File position: 9
57
10

3. Compile the source with -Miso switch to use ISO mode. Result:

File size: 11
File position: 9
         48
         57
TagsNo tags attached.
Fixed in Revision40850, 43188
FPCOldBugId
FPCTarget-
Attached Files

Activities

hellotiger

2019-01-11 07:27

reporter  

fpc-iso.zip (581 bytes)

Marco van de Voort

2019-01-11 10:45

manager   ~0113322

Can reproduce with FPC 3.3.1

Florian

2019-01-12 14:36

administrator   ~0113351

Is seek supposed to work in ISO mode? I would expect that its behaviour clashes with the behaviour of ISO file handling.

hellotiger

2019-01-12 17:38

reporter   ~0113354

Last edited: 2019-01-12 17:46

View 3 revisions

Thanks. What is the root cause of the problem? I need to compile code in ISO mode and deal with files. Is there an alternative way of supporting seek like functions in FPC ISO mode? In GNU Pascal, ISO mode is the default and seek can be used. GNU Pascal is obsolete now. I would like to compile it using FPC.

Florian

2019-01-13 00:30

administrator   ~0113369

Ok, I tried to mimic this behaviour in FPC's iso mode.

hellotiger

2019-09-30 11:58

reporter   ~0118209

I applied the patch of iso7185.pp to fpc 3.0.4 (the version used on Debian Buster) and tested using the same files in the original attachment. Now with fpc -Miso I got:
File size: 11
File position: 10
         57
         10

While with fpc default mode I got:
File size: 11
File position: 9
57
10

The readings are the same now but I'm not sure why the reported file positions are different.

Thaddy de Koning

2019-09-30 12:10

reporter   ~0118212

Last edited: 2019-09-30 12:11

View 2 revisions

0..10 vs 1..11?

Issue History

Date Modified Username Field Change
2019-01-11 07:27 hellotiger New Issue
2019-01-11 07:27 hellotiger File Added: fpc-iso.zip
2019-01-11 10:45 Marco van de Voort Note Added: 0113322
2019-01-11 10:46 Marco van de Voort Status new => confirmed
2019-01-12 14:36 Florian Note Added: 0113351
2019-01-12 17:38 hellotiger Note Added: 0113354
2019-01-12 17:43 hellotiger Note Edited: 0113354 View Revisions
2019-01-12 17:46 hellotiger Note Edited: 0113354 View Revisions
2019-01-13 00:30 Florian Fixed in Revision => 40850
2019-01-13 00:30 Florian Note Added: 0113369
2019-01-13 00:30 Florian Status confirmed => resolved
2019-01-13 00:30 Florian Fixed in Version => 3.3.1
2019-01-13 00:30 Florian Resolution open => fixed
2019-01-13 00:30 Florian Assigned To => Florian
2019-09-30 11:58 hellotiger Status resolved => feedback
2019-09-30 11:58 hellotiger Resolution fixed => reopened
2019-09-30 11:58 hellotiger Note Added: 0118209
2019-09-30 12:10 Thaddy de Koning Note Added: 0118212
2019-09-30 12:11 Thaddy de Koning Note Edited: 0118212 View Revisions
2019-10-13 14:36 Florian Status feedback => resolved
2019-10-13 14:36 Florian Fixed in Revision 40850 => 40850, 43188
2019-10-13 14:36 Florian FPCTarget => -