fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 19 forks source link

Structorizer does not save my file #339

Closed scorneil closed 7 years ago

scorneil commented 7 years ago

I started having this issue yesterday. Today, one of my students is having the same problem ...

I'm using Windows 10 + Structorizer 3.26.02 + JRE jre1.8.0_121 64-bit student is using same but with JRE 32-bit

When I start from Structorizer.bat in command line, it seems that the program is looking for a language file that it cannot find (attachment). There are no errors. commandline

fesch commented 7 years ago

What file does Structorizer not save? Your NSD-file? Or the INI-file? Or a language file?

Version 3.26.02 has been uploaded only a few hours ago, so yesterday you had still 3.26.01 ;-)

The text "Loading now ... " is an information, not a warning nor an error messages. It tells you that the corresponding file has been loaded, not that it cannot find it ...

codemanyak commented 7 years ago

@scorneil I would like to draw your attention to the questions Bob added to his comment after having sent it as mail. Well, if I understand you well (or if I guess well), you want to say that you can edit a diagram, possibly even execute it, but Structorizer ignores your saving attempt without raising an error message or writing some elucidating hint to the console? Does it just refuse to save but you can go on editing - or does the Structorizer window freeze? You just don't find the nsd file in the selected target directory though saving seems to have happened? Or don't you even see the file chooser menu? It would be nice if you could describe what you did and what happened or didn't happen in more detail. According to your report it didn't make a difference whether you tried with version 3.26-01 or 3.26-02. Is that right?

codemanyak commented 7 years ago

@scorneil Ah well, just a wild guess that came to my mind: You have of course given your diagram a name different than "???", haven't you? Because while the proposed file name, which is derived from the diagram name, contains question marks you won't have a chance to get it saved on the file system.

scorneil commented 7 years ago

Ha, ha ! You're absolutely right ! I just thought I'd be brief :-)

I had 3.25 or 3.26, 2 days ago, when I first encountered the problem. Yesterday; I noticed that there was a newer version. but I had the same problem. The student only worked with the latest version.

It's a really strange thing ... We both were able to use Structorizer for a while without any problems. Then, later on, when we try to save our nsd-file (not something hugely complicated or so), Structorizer seems to save the file just fine ... It just doesn't show up on our pc.

If I then open some random other nsd-file, and then try to open the first file again ... it shows up in the 'open file' menu (attachment 1). But if I close Structorizer first, and then try to find that same file again ... it's no longer there (att.2).

1

2

codemanyak commented 7 years ago

@scorneil Another investigation direction: You might check in the Java Control Panel, whether perhaps older Java versions are still active. If so deactivate them. Another try (though less likely to help here) might be to clear the Java Cache (also to be done via the Java Control Panel). You might want to have a look to the log sub-directory of the specified Java temp directory first...

scorneil commented 7 years ago

@codemanyak : the log dir is empty (AppData/LocalLow/Sun/Java/Deployment/log). The Java Cache Viewer is showing me this :

I have only jdk1.8.0_112 and jre1.8.0_121. The Java Control Panel shows me the jre is used.

@codemanyak, @fesch : thank you both for your help !

codemanyak commented 7 years ago

@scorneil Thank you for detailing the problem. I still haven't got exactly how it happens, though. Unfortunately, the two referenced attachments haven't been transported:

If I then open some random other nsd-file, and then try to open the first file again ... it shows up in the 'open file' menu (attachment 1). But if I close Structorizer first, and then try to find that same file again ... it's no longer there (att.2).

Would you mind opening the GitHub issue in the browser and upload the screenshot files explicitly into your cited comment (press the pencil button "Edit comment") or into a new comment? Thanks for your cooperation.

scorneil commented 7 years ago

@codemanyak Sure ! 1 2

There's probably not all that much information in them anyway. The first img is a screenshot of the 'File Open' menu in Structorizer. The newly created and 'saved' file is visible : 'Test2.nsd' The second img is the same thing, but after closing and restarting Structorizer : the file is gone. It is also nowhere to be found on my computer.

codemanyak commented 7 years ago

Puh, how strange is that! At the moment I try to explain it with a pending close or or renaming operation. But I don't see in the code what might cause it. Yo wrote that you have to open an arbitrary NSD file first inbetween in order to see the previously created nsd file on next opening attempt. Does this mean that an open attempt immmediately after having saved the file (i.e. without having loading another file or closing Structorizer) does not show it in the file chooser? Would you find a temporary file Structorizer.nsd in your temp directory with the timestamp of your saving approach and containing the vanished content?

scorneil commented 7 years ago

'Strange' it certainly is ! :-)

No, no, I didn't explain it very well. Sorry ! I don't HAVE to open another file. When I save my .nsd, Structorizer thinks it is saving it just fine. I get no errors or warnings. If I leave Structorizer, with the nsd (which Structorizer thinks it has saved to my pc) still open, and I open up Windows explorer to go look for the nsd on my computer, the file just isn't there. I opened the other random nsd-file to check if I could still find my original nsd back through Structorizer (file > open). And yes ! As long as I don't close Structorizer, Structorizer thinks it has saved my nsd file (but it hasn't).

Ouch. I hope you understand ...

scorneil commented 7 years ago

Which temp folder is it you want me to look in ? I checked Window/temp and the Java/Deployment/tmp, but they're both empty.

fesch commented 7 years ago

Is your Desktop really on the local PC or somewhere synched to an remote file-server?

scorneil commented 7 years ago

@fesch : Local pc

fesch commented 7 years ago

OK. I just wanted to exclude any sych-problems, because I know that such may exist too.

scorneil commented 7 years ago

Sure.

codemanyak commented 7 years ago

@scorneil

Which temp folder is it you want me to look in ?

Well, I'm referring to the user-specific temporary files directory, Under Windows 7 it is AppData/Local/Temp.

As long as I don't close Structorizer, Structorizer thinks it has saved my nsd file (but it hasn't).

But if you can see the file in the open file dialog (as you wrote above, cf attachment 1) then it must have been saved because the directory content is retrieved from the OS, not reproduced from a Structorizer-internal cache. And the mechanism works absolutely fine and reliably under Windows 7, Linux etc. So the only reason I can think of is that either Java lies to Structorizer or the Windows 10 NTFS lies to Java. Maybe some buffering or journaling issue? Just to make sure I have the correct impression of the behaviour: When you just saved the file and stay in Structorizer, do you see the produced file in the file open dialog? If so and you check via explorer at the same time, does the file show up as well? Or not? If so, can you rename the file with explorer? And does the "Recent file" list in the File menu show the filename already?

scorneil commented 7 years ago

@codemanyak Windows 10 has a Temp folder in the same location. But nothing comes in from Structorizer ...

'Maybe some buffering or journaling issue?'

I'm completely out of my depth, but I was also thinking in the lines of 'buffer'.

'to make sure I have the correct impression of the behaviour:'

When I save the file and stay in S, I see the file in the file open dialog. I can also see it in the 'recent files' dialog. I cannot see it in the Windows Explorer. If I close S., and start it up again, then the file is gone from 'file open' and 'recent files'.

codemanyak commented 7 years ago

This tells me that the JVM seems to virtualize the file system environment under Windows 10 in a radically new way. (I use the JavaRE version 1.8.0_112 or 1.8.0_111 under Windows 7 and there is no problem.) This would be sound with the observation that the file is only visible in the Java VM world and is not committed to the real filesystem. As soon as you close Structorizer, the JVM is killed, too, and with it all the "virtual files". If I'm true then it would be the same with the preference settings - if you change some default then it would be gone on next Structorizer start (this should also include the recent file list, the current directory etc.). It should even apply to files created by the new Structorizer File API, i.e. using fileCreate(), fileWrite(), and fileClose() within a Structogram. All these files should be visible in the Structorizer file open dialog (with filter set to "all files") but not in explorer if my suspicion were justified. This would be a fat Java error! I haven't found anything about such a behaviour in current developer threads, though. Maybe there is a new configuration in the Java Control Panel...?

fesch commented 7 years ago

Just tried on my brand new Windows 10.

Java 1.8.0_121

codemanyak commented 7 years ago

@fesch Hi Bob, thank you for testing under Windows 10! This just leaves me even more puzzled. What the heck is going on at scorneil's site? Either the Java VM is isolating itself or Windows 10 sandboxes the Java VM. I don't find a different explanation. @scorneil Do you employ any sandbox software in your Windows 10 installation you may not have been aware of?

scorneil commented 7 years ago

@codemanyak : The preferences are indeed gone when I restart S. (change fontsize > all preferences > save). But as @fesch said : I have some Windows 10 machines in my classroom that are just fine ...

I'm not sure about the sandbox software ... I don't think I installed anything ... But just in case : what kinds of programs should I look for ?

@codemanyak , @fesch : I feel really bad about taking up so much of your time. Especially since nobody else (except myself and the one student) seem to have this problem .... I would totally understand if you guys want to move on to other stuff !

scorneil commented 7 years ago

@codemanyak @fish : I just noticed a green border around my Structorizer program (I don't know if this corresponds with my troubles or not ; I did'nt really pay attention) ... Does that ring a bell ?

border

fesch commented 7 years ago

very strange ...

BTW, we always learn, so hey ... don't bother ;-)

fesch commented 7 years ago

green border --> what anti-virus are you running?

scorneil commented 7 years ago

Windows10 Defender ; nothing else (that I know of)

fesch commented 7 years ago

the green border has to do with the sandbox ... but I don't know yet how to disable it ...

scorneil commented 7 years ago

And where/how would I have unknowingly acquired a sandbox ???

codemanyak commented 7 years ago

Comodo (Comodo Internet security / Comodo Antivirus) is known to frame dubious applications with a green border and may automatically sandbox all unknown applications. You may e.g. have a look here: Comodo Antivirus 10 or there (though it's related to Windows 7): Windows 7 forums.

Sandboxie is a very popular semi-free Sandbox tool and can also be configured to start certain programs by default in a sandbox and may show a coloured border if enabled to. The border colour is configurable. Look here for instance: Sandboxie Border Color.

There are further tools on the market with similar behaviour, e.g. avast! etc.

Of course we cannot know what has been installed on your computers.

This doesn't actually seem to be a Structorizer problem - unless Structorizer induces suspicion by its behaviour or some code patterns (maybe by connecting to URLs if you request the user guide from menu or enable the version retrieval?).

codemanyak commented 7 years ago

Since Windows 8, Microsoft brings its own powerfull sandboxing environment, called AppContainer. It is sometimes even advised not to let third-party tools like Sandboxie interfere with it because this may lessen the isolation (of tools running in AppContainer already). But whereas I could read some stuff about how to develop apps (Metro Apps in particular) using AppContainer, there is very little documentation around how it might be used (or not) for existing (not to say legacy) desktop applications.

scorneil commented 7 years ago

@codemanyak : My god ! You are absolutely right ! It's actually coming from my browser (Comodo IceDragon) ! It must at some point have installed/activated (??) Comodo Cloud Antivirus !

And it's not just Structorizer that has been sandboxed : jre1.8.0_122/lib/deploy.jar is in there, as well as a bunch of Adobe Creative Cloud stuff ...

comodo

Thank you so very much ! Everything is working again as it is supposed to !

codemanyak commented 7 years ago

I'm glad we could help. And as Bob already told, we learned a lot, too ;-)