Menu

#1325 xpet 4040 not handling REL files correctly

v3.4
closed-fixed
nobody
None
GTK3
xpet
2020-12-09
2020-10-16
No

REL files on a D64 disk image are not being handled correctly. The drive reports 'OK' status when positioning with a byte offset that's past end of the defined record size. Similarly, it reports 'OK' to record positions that are larger than the file size. The former should return 51, RECORD OVERFLOW and the second 50, RECORD NOT PRESENT.

Discussion

  • gpz

    gpz - 2020-10-16

    please attach your settings. if it happens with TDE enabled... then this is a DOS bug :)

     
  • Steven Hirsch

    Steven Hirsch - 2020-10-16

    OOoof. Not sure what is going on, but I just tried this again with a D64 image and it provided the correct behavior. But, in the large something is flaky with this build. I've had it crash in flames for no apparent reason and several times it's become unresponsive and had to be killed. Is GTK-3 build of 3.4 r38766 expected to be stable on Ubuntu 18.04?

     
  • Olaf Seibert

    Olaf Seibert - 2020-10-17

    I tried it with this little test program and this command line:

     ./gtk3-xpet -default -model 8032 +truedrive -virtualdev -fs8 . -fs8savep00 -fs8convertp00 -9 blah.d64
    
     100 open 1,9,2,"reltest,l,"+chr$(20)
     110 record#1,1:print#1,"hello";
     120 print#1,"world";
     130 print#1,"how";
     140 print#1,"are";
     150 print#1,"you";
     160 print#1,"today?";
     170 close 1
     500 open 1,9,2,"reltest,l,"+chr$(20)
     510 record#1,50
     520 print ds$
     550 record#1,3,50
     560 print ds$
     600 close 1
    ready.
    
    run
    50,record not present,00,00
    p"c
    
    ready.
    

    The result is on a vdrive disk image. Log output was

    Open existing REL file 'RELTEST,L,' with record length 20 on channel 2.
    Requested position 0, 0 on channel 2.
    VDriveCommand: ERR = 50, RECORD NOT PRESENT, 00, 00
    VDriveREL: Error - Position larger than record!?
    VDrive REL close channel 2.
    

    so here the 1st error is handled ok but the second isn't. DS$ has a very weird value.
    On drive 8, output is

    run
    00, ok,00,00
    51,overflow in record,00,00
    
    ready.
    

    and the relative file has been extended to 50 records (its R00 container is 1007 bytes). Log output:

    Fsdevice: ERR = 50, RECORD NOT PRESENT, 00, 00
    Fsdevice: ERR = 50, RECORD NOT PRESENT, 00, 00
    Fsdevice: ERR = 51, OVERFLOW IN RECORD, 00, 00
    

    And if I turn on True Drive Emulation, I get

    run
    50, record not present,00,00
    51,overflow in record,00,00
    
    ready.
    cA u9
     0 "nnnnnnn         " nn 2a
     2    "reltest"          rel
     647 blocks free.
    
    ready.
    

    so the file has not been expanded to 50 records. That happens only if I add 530 print#1,"...";.

     

    Last edit: Olaf Seibert 2020-10-17
  • Olaf Seibert

    Olaf Seibert - 2020-10-17

    r38822 improves the file system device in this matter.
    r38823 adds some semicolons that were mysteriously missing.

     

    Last edit: Olaf Seibert 2020-10-17
    • Steven Hirsch

      Steven Hirsch - 2020-10-17

      Hahaha... I was just about to report the syntax issues in fsdevice-read.c :-). But, yes, REL behavior with .R00 files seems now to be correct. Previously, position commands would mysteriously extend the file even when no write had occured. Nice work, Olaf!

       
  • Roberto Muscedere

    Does this fix apply to the vdrive on unit 9? I just put in a patch (39131) for this so it won't give you garbage back when reading the error channel.

     
  • Roberto Muscedere

    I checked the original code with the latest versions and the output matches. The rel file contents are good as well so I'm closing this one.

     
  • Roberto Muscedere

    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB