Testers needed - Bug:1860932

I’ve done some I/O cleanup work over the past few days, aimed at correcting
this bug:

http://vassalengine.org/forums/viewtopic.php?t=67

Since I can’t reproduce the bug myself, I need some people to help me test
it. What isn’t supposed to happen is that you get an error when attempting
to save a module (particularly on Windows). Additionally, other things
involving file I/O which worked before should continue working.

If you’d like to help get this bug fixed, please try this build, and
report back to me whether it works for you:

nomic.net/~uckelman/tmp/vass … vn2780.zip

Finally re-produced the error with your build Joel :slight_smile:
I opened the module for editing, then started another instance of Vassal, selected “Play Module” and opened it again; Then went back to the Edit session and tried to save. Good to know we can re-produce it!

– OS Windows Vista
– Java version 1.6.0_03
– VASSAL version 3.0.16-svn2780
Invalid version format :3.0.16-svn2780, 3.0.16-svn2780
– Sweden Fights On versijava.io.IOException: Unable to overwrite C:\Users\Public\Gaming Stuff\VASSAL-3.0 - testing\Sweden Fights On v1.0.mod\Sweden Fights On vtest.mod.zip
Data stored in C:\Users\Public\Gaming Stuff\VASSAL-3.0 - testing\Sweden Fights On v1.0.mod\temp1.zip
at VASSAL.tools.ArchiveWriter.write(ArchiveWriter.java:302)
at VASSAL.build.GameModule.save(GameModule.java:753)
at VASSAL.build.GameModule.save(GameModule.java:739)
at VASSAL.configure.ModuleEditWindow.save(ModuleEditWindow.java:189)
at VASSAL.configure.ModuleEditWindow$2.actionPerformed(ModuleEditWindow.java:83)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Is it a bug not to be able to write files that are already opened by
another process? I wouldn’t consider that a bug myself.

Now, if there is only one vassal process and the error occurs, or if
another process was unintentionaly lingering, I would think its a bug.

On Dec 29, 2007, at 11:12 PM, “bsmith”
messages@forums.vassalengine.org wrote:


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

In this instance no, but I’m not sure how to reproduce the “Save As” issue.

I do know Joel wants to create a decent error dialog instead of “Couldn’t save module {0}” so at least being able to generate the error may help.

What is the module save process?

When I “Save As” a different filename and get the error, the original module file has been removed somehow. Presumably this is because Vassal has deleted it in preparation for copying the temp file to the same name?

Thus spake Tim Byrne:

No, that’s not a bug on its own. What is a bug is if trying to do that
gets us into a state where it becomes impossible to save to other files
instead.

I was under the impression that we had the former situation, and that
was causing this bug, at least in some cases.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

For what it’s worth I don’t consider this bug to be a high priority as it only applies to module designers (a minority) and personally I’ve managed to churn out 15 modules with very little impact. It’s rare enough to probably push down a notch or two. I would much rather get rid of that Vassal startup wizard!

Just to clarify, this is the problem at hand:

  1. you open a module for editing.
  2. Make modifications.
  3. Click “Save”.
  4. A dialog pops up with “Couldn’t save module {0}”.
  5. At this point, a simple Save As with a different file name will usually fix the problem. Otherwise another dialog pops up with “Couldn’t save module {0}”.
  6. Retries with “Save” and “Save As” repeatedly generate the same error.
  7. With Vassal still open, when you open Windows Explorer and look in the folder where the module file should be, you see that it has gone!
  8. At this point, there will usually be a temp1.zip file of around the same size as your old module. This file will still have your saved changes and allow you to recover the module fully.
  9. If there’s no temp.zip files or they’re all too small to be your old module then you’re boned. The only option is to quit Vassal and restore from backup.

Joel I’m not seeing your funky zoom features in this release. Do they not work with modules created under 3.0.13?

Thus spake “bsmith”:

Check the version number: This test build is 3.0.16-svn2780. My zooming
work is in 3.1.0 builds only.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

That cleared things up, cheers!

Thus spake “bsmith”:

I’m still trying to clarify this for myself.

What should happen is that whenever you save module.mod, VASSAL writes
to tempN.zip, and if that succeeds, moves tempN.zip to module.mod.

What we actually do after writing tempN.zip is delete module.mod and
then rename tempN.zip to module.mod, because File.renameTo() isn’t
guaranteed to succeed on all platforms if the destination file already
exists.

I guess this problem could be caused by an open stream on the temp
file, since then the deletion of the module would succeed but it wouldn’t
be possible (on Windows) to rename the temp file.

I think this means that we should manage these temp files with the temp
file manager I wrote, which will ensure that the temp files have globally
unique names—and so nothing else could have a stream open on them.

Thanks—this comment was really helpful for me, since it made me think
about how the save process could fail.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Ben, you can unsticky this thread. The problem isn’t completely resolved
yet, but I don’t need any testers right now.