erkyrath / lectrote

The IF interpreter in an Electron shell
Other
248 stars 28 forks source link

Counterfeit Monkey only starts with Quixe #122

Closed angstsmurf closed 4 years ago

angstsmurf commented 4 years ago

We have discussed this on the Intfiction.org forum, but I figured it wouldn't hurt to have an issue here as well, so that we don't forget.

The relevant posts are https://intfiction.org/t/lectrote-1-3-6/46539/12 and https://intfiction.org/t/suppressing-line-break-after-cancelling-line-event/13488/8 at the time of writing.

Under Lectrote-Glulxe it crashes saying “OOM” (abortOnCannotGrowMemory). Under Lectrote-Git it just doesn’t start up – no error message, which is odd, but leaves me no strings to pull.

In Lectrote 1.3.3, it is possible to get to the initial question (“Can you hear me?”) in Lectrote-Git by compiling Counterfeit Monkey without Startup Precomputation support. However, it is not possible to actually enter an answer, as pressing the enter key has no effect. In 1.3.4 and later, it won’t even start.

It is a little cumbersome to remove Startup Precomptuation from Counterfeit Monkey, so I've uploaded a binary without it here: https://github.com/i7/counterfeit-monkey/releases/tag/r9b7

erkyrath commented 4 years ago

Dannii has reworked the emglken interpreters; this should work in the next release.

angstsmurf commented 4 years ago

I tested the current code, and standard builds now work, as does debug builds without Startup Precomputation. Debug builds with Startup Precomputation (such as the CM-9b7-debug.gblorb linked above) still hang at start with an eternal spinning compass in both Git and Glulxe, but work with Quixe just as before.

angstsmurf commented 4 years ago

I did some further testing, now that debug builds kind of run. TEST ACT1 works, but both non-Quixe interpreters seem to hang on TEST ACT2. When they "get stuck" the console always shows the same kind of errors, both when they refuse to start at all and when stuck on Act 2:

file_fopen: failed to open : Error: ENOENT: no such file or directory, open
~/lectrote-master/quixe/lib/elkote.min.js:207

TypeError: Cannot read property 'fseek' of null
~/lectrote-master/emglken/glulxe.js:1

Not sending repeated generation number: 0
~/lectrote-master/quixe/lib/elkote.min.js:207

The second one will of course show git.js:1on Git. The last one will sometimes be absent, sometimes repeat with different numbers.

curiousdannii commented 4 years ago

Hmm, I'll look into it.

angstsmurf commented 4 years ago

I wonder if it has something to do with reading or writing external files. A new standard build will hang in Lectrote-Glulxe when trying to start, with the same errors in console. But release 9, which has a startup state in the Blorb, will start without errors.

curiousdannii commented 4 years ago

Yeah it's definitely the external files, which is the tricky part of Emglken, because of how I've implemented the virtual file system. The question is why an open call gets all the way to electrofs.js on a file that doesn't exist - it should have tested for that before hand.

Edit: actually, looks from that first error like it's sending a blank filename? weird.

Btw, if you have extra time and like testing things, you can also see how it goes with the emglken script from the npm package. Though it will probably be a lot of the same thing.

Edit: Well I ran CM-9b7-debug.gblorb in emglken outside of Lectrote, and it worked fine. And it successfully creates the startup data and the achievements files. So something else is up.

curiousdannii commented 4 years ago

Seems like the bug was another one of those annoying ones caused by a dumb typo. Which I had already fixed yesterday! If you can try the code from my PR @angstsmurf let me know if you have any more troubles.

(I'm now linting the Emglken code, so there should be far fewer bugs caused by typos in the future.)

angstsmurf commented 4 years ago

I'll just link to my comment on the PR here.