js-dos
js-dos copied to clipboard
Uncaught RuntimeError: unreachable
Hi, I'm using jsdos play a turn based game. But when I reached about 50 rounds the game freeze and shows this error in the console
wdosbox.js:9 Uncaught RuntimeError: unreachable
at 0059645a:0x9ca6
at 0059645a:0x2824
at 0059645a:0x11a05b
at 0059645a:0xf5607
at 0059645a:0xdf3e7
at ret.
Uncaught RuntimeError: unreachable Uncaught RuntimeError: table index is out of bounds
Uncaught RuntimeError: table index is out of bounds
at 0059645a:0xdd98b
at ret.
Do you have link to test?
@caiiiycuk sorry I don't have. It happened in one of my users.
I think myabe this error is related with the saves in indexedDB? Because he said he saved the game in the 49th round, and it will throw this error every time in the 50th round.
Is it because the save in the indexedDB is too large? There was another user mentioned a similar error about 2-3 months ago, which happened in the same game level and around 50 rounds

Nope, it’s not related to saves. The problem is in game. I need the game and save on 49 level to reproduce and fix
Пн, 5 сент. 2022 г. в 12:16, Ziiven @.***>:
Is it because the save in the indexedDB is too large? There was another user mentioned the same error about 2-3 months ago, which happened in the same game level and around 50 rounds
— Reply to this email directly, view it on GitHub https://github.com/caiiiycuk/js-dos/issues/247#issuecomment-1236744687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANFVMCI3OGAILBT3AURBLLV4W257ANCNFSM6AAAAAAQERTDVI . You are receiving this because you were mentioned.Message ID: @.***>
@caiiiycuk I have asked that user to keep the save. Could you tell me how to export the saves from browser?
If you use logged integration, then you can find download button in js-dos settings. Btw, maybe you can pass this turns on PC?
He said the game freeze after he end the player's turn, no matter what he did. Anyway I will upload the game save as soon as he give it to me.
Which game we are talking about?
The game is called "Flame Dragon 2". The game bundle is here: https://doszone-uploads.s3.dualstack.eu-central-1.amazonaws.com/personal-v2/studio/dkkpr/bundle.jsdos
However I found out I didn't use logged integration. Is it ok if I exported the game save as arrayBuffer and converted it to base64? You can convert it back to arrayBuffer using this function:
function _base64ToArrayBuffer(base64) {
let binary_string = window.atob(base64);
let len = binary_string.length;
let bytes = new Uint8Array(len);
for (let i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
}
return bytes.buffer;
}
Just tried the save myself, it will 100% trigger the error even the player don't do anything in that round
When you enter the game you can do the following steps to reproduce:
- in the main menu select "continue"
- once the game loaded, use the arrow key to move the selector to a grid that without any NPC
- press "space" key to popup a option menu, select "end" at the bottom by using the arrow key
- confirm end turn by press "space" key
- error triggered

@caiiiycuk Just confirmed that this issue is not related to the jsdos. It is something that in the game itself (it set a maximum turns of 50, and will force the game to stop when reach 50). So please close this issue :)
Interesting, thanks! I will keep it open, cause I still want to look into.