CC: Tweaked

CC: Tweaked

57M Downloads

term.blit IllegalStateException when displaying on monitor

hugeblank opened this issue ยท 3 comments

commented

Minecraft Version

1.19.x

Version

1.102.2

Details

I have a computer with a monitor running the following on startup: https://p.sc3.io/MHcx6fxDka
After letting it run for an extended period of time, sometimes I will come back to it with an error:
startup.lua:89: vm error: java.lang.IllegalStateException Resuming from unknown instruction
The following is a lightly altered image of what I see, I used the monitor after discovering it to display the above paste code while I copied the link. This is the second time this has happened to this specific board.
image

commented

I suspect this occurs if the computer gets pre-emptively suspended and then resumed in a slightly weird state. As this occurs inside the Lua runtime, we didn't log an exception for this. The above commit fixes that, so we should be able to grab a stacktrace from the logs later on.


As an aside, that code is incredibly inefficient. Each book[i][j] = ... allocates 3 or 4 new strings, which you're doing for every single pixel in the book every 1/20ths of a second!

Please don't change it yet (wait until this bug is fixed), but please do change it eventually!

commented

Oh, that's actually far less useful than I hoped. I guess it confirms my expectation at least.

java.lang.IllegalStateException: Resuming from unknown instruction
        at Not Enough Crashes deobfuscated stack trace.(1.19.3+build.3) ~[?:?]
        at org.squiddev.cobalt.function.LuaInterpreter.resume(LuaInterpreter.java:793) ~[org_squiddev_cobalt-0.5.10-d5f22397c8dd8ea2.jar:?]
        at org.squiddev.cobalt.function.LuaInterpretedFunction.resume(LuaInterpretedFunction.java:193) ~[org_squiddev_cobalt-0.5.10-d5f22397c8dd8ea2.jar:?]
        at org.squiddev.cobalt.debug.DebugFrame.resume(DebugFrame.java:243) ~[org_squiddev_cobalt-0.5.10-d5f22397c8dd8ea2.jar:?]
        at org.squiddev.cobalt.LuaThread.loop(LuaThread.java:570) ~[org_squiddev_cobalt-0.5.10-d5f22397c8dd8ea2.jar:?]
        at org.squiddev.cobalt.LuaThread$1.run(LuaThread.java:466) ~[org_squiddev_cobalt-0.5.10-d5f22397c8dd8ea2.jar:?]
        at dan200.computercraft.core.lua.CobaltLuaMachine.lambda$new$1(CobaltLuaMachine.java:80) ~[cc-tweaked-1.19.3-fabric-1.102.2-9e1de23f4a1b703d28d5f1816ae2c338dfbf006d.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Unknown Source) ~[?:?]
commented

Change on the Cobalt side for reference: cc-tweaked/Cobalt@d27073d. This was a very silly bug on my part.