Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#6087 PS2: scummvm.ini gets corrupted

open
Max Lingua
None
5
2014-01-26
2012-07-07
Michael Kanis
No

The ini file gets written correctly, as it seems, but the file size is not updated, if the new file is smaller than the old one. This results in an ini file, that contains some of the old content at the end. I'll attach 2 files, to make this clear.

Steps to reproduce:
1) Set up BASS to override the global volume settings. Hit Ok → File gets written. File has x (=550 for me) Bytes and is correct.
2) Edit the game and disable "Override global volume settings". Hit Ok → File gets written. File still has x Bytes. It now contains the new content, which is shorter than the old and some of the old content that "fills" the x Bytes.
3) ScummVM will not start anymore with the corrupt ini file.

I tested with 1.4.1 and the daily build as of today, 2012-07-07. Both versions have the bug.

Discussion

  • Michael Kanis
    Michael Kanis
    2012-07-07

    Correct ini

     
    Attachments
  • Michael Kanis
    Michael Kanis
    2012-07-07

    Corrupt ini

     
    Attachments
  • digitall
    digitall
    2012-07-07

    Assigning to the PS2 porter for visibility.

     
  • digitall
    digitall
    2012-07-07

    • assigned_to: nobody --> sunmax
     
  • digitall
    digitall
    2012-07-07

    damumbl: Thank you for reporting this bug.

    Please can you test with the earlier versions i.e. v1.4.0, v1.3.1, v1.3.0, v1.2.1 etc. to see if this is a regression or if the PS2 port has always had this latent bug? Going as far back as the first PS2 release i.e. v0.8.0 could be useful:
    http://wiki.scummvm.org/index.php/PlayStation_2

     
  • Max Lingua
    Max Lingua
    2012-07-07

    Hi there Damumbi,

    thanks for reporting this!

    Now, after we enabled file caching on PS2 in the past (which boosted loading times & gaming experience with titles like COMI) we hit this regression once already.

    Back then it affected all write operations to ScummVM.ini.

    I thought we fixed it, and it probably was for the cases we tested back then (which was saving the same ScummVM.ini or saving a bigger one, like when you add a new game). To be 100% honest with you, we didn't test the scenario where it gets shorter... so it's possible the regression for this particular case had been around since then.

    As David suggested, please if you have a chance run a regression on previous versions, I'd expect this bug to enter the scene with 1.2.0 (IIRC the one where we started caching).

    I'm not 100% sure the issue is in PS2 ScummVM code or the underlying file libraries, but we definitely want to find a complete solution to this bug.

    I'm currently in travel far from my beloved PS2, but will try to check the code to see if I spot something we missed before.

    Thanks!
    -max

     
  • Michael Kanis
    Michael Kanis
    2012-07-08

    Ok, here's what I found out:

    scummvm-0.8.1-ps2: Unable to load module cd...\IOMANX.IRX;1, Error -203a…

    scummvm-0.11.1-ps2: Ok, but only reads ini from mc0
    scummvm-0.12.0-ps2: Only reads ini from mc0; Doesn't write changes at all (I think)
    scummvm-0.13.1-ps2: Reads ini from mass; Corrupt, but differnt I think
    scummvm-1.0.0rc1-ps2: Reads ini from mass → Bug
    scummvm-1.0.0-ps2: Reads ini from mass → Bug

    scummvm-1.4.1-ps2: Reads ini from mass → Bug; Works, if ini on mc!

    I now see that there is a fact, I forgot to mention originally: I use a scummvm.ini inside the directory where the elf is on a USB stick. When I saw that the versions that only read the ini from the memory card work perfectly fine, I tested this again without an ini on the USB. It then writes the file to mc0:/ScummVM/ScummVM.ini and it works perfectly fine.

    So my conclusion would be, that the bug exists only if you write the ini to USB. Could this be a problem with the file system? I am not too familiar with C/C++ nor the PS2, but I wrote a simple text editor for BeOS once and had the same problem there. I had to either set the file size explicitly after writing or set it to 0 beforehand.

    Hope this helps.

     
  • digitall
    digitall
    2014-01-26

    Max: What is the status of this issue?

     
    • Max Lingua
      Max Lingua
      2014-01-26

      I can't reproduce on my side. I store all my ScummVM.ini and save games on mass and they look fine. Might be the USB device, PS2 is very picky. Or I might be missing something when trying to reproduce the OP configuration.

      I would suggest OP tests with 1.5.0 / 1.6.0 as soon as I'm ok'd to upload them. They are ready, just waiting for Sev or Lordhoto to confirm it's ok to scp those release to our download section.

      They contain some stack corruption fixes (double free, etc.) which might be the root of some corruption.

      Thanks.