Counterfeit Monkey freezes iPhone Safari
dfabulich opened this issue · 12 comments
I've encountered a reproducible crashing bug in Counterfeit Monkey Release 10. I'm on iPhone 13 Pro, iOS version 16.3.
After a few dozen moves, Safari will freeze up. The keyboard will be visible, but tapping keys on the keyboard does nothing at all, and the transcript stops being scrollable. I've tried waiting more than 60 seconds to see if it unfreezes, but it doesn't work. Navigating back to the iPhone home screen and back into Safari, it will show the game UI for a few seconds, and then Safari will crash. At that point, if you navigate back into the game, you'll see this on-screen error:
Quixe run: glk_put_jstring: window has pending line input
Clear autosave and restart
You can click "clear autosave and restart," but you'll just hit the error again a few turns later.
Note that Release 10 is hard to play on iPhone because of the map. You can type graphics off
in Release 10 after answering the initial questions (y / andra
). In Release 11 and up, the map will be hidden by default, and you can turn it on and off with map on
and map off
.
I also like to use highlighting
to highlight words, and this might make it more likely to reproduce, but that could be superstition.
@angstsmurf In case you have any thoughts on this
Using Browserstack I can confirm that it gets pretty slow at times, but it's always resumed responsivity for me. Oddly it seems to be hanging after outputting text, not while the VM is running, which is what I'd expect if it was Quixe being very slow processing the game code. No idea of the cause yet.
Is there a previous release of the game where this does not happen?
I just tried it on iplayif.com with release 7, and it froze. I got as far as turning off graphics, turning off the tutorial, turning on highlighting, and going north, and it froze.
It did seem to freeze in Quixe, (using the Release 10 link above), but less, and for shorter periods of time.
In Zarf's Quixe, the iPhone keyboard closes after every command you type, forcing you to tap on the command area to re-open the keyboard. I found that sometimes, I'd go to tap in that area, but it just… wouldn't tap. Then maybe I'd leave and reenter Safari, and it still wouldn't tap, but then a few seconds later, it would be tappable again.
It never locked up quite as bad as Parchment did/does.
I note that I was able to play through Lost Pig without issue, so it does appear to have something to do with Counterfeit Monkey. I speculate that the problem has to do with memory usage, and specifically I think it has to do with garbage collection; perhaps CM is generating a lot of garbage, so the garbage collector is freezing after we yield the UI thread.
I might poke around with this at some point. https://webkit.org/blog/6425/memory-debugging-with-web-inspector/