sandalle / minecraft_bigreactor_control

Minecraft BigReactor Computercraft Control Program
MIT License
76 stars 41 forks source link

EZ-Nuke crashes attempting to concatentate string and nil in a print statement #3

Closed sandalle closed 9 years ago

sandalle commented 10 years ago

Some users have reported EZ-Nuke crashes, see http://i.imgur.com/pXaugU9.png (reactorcontrol:503: attempt to concatenate string and nil, from version 0.3.6). This should only be caused by the list of monitors being changed, or a monitor becoming invalid, but users report that no chunk boundaries are being crossed, the chunk is force loaded, and no cabling/monitor changes have been done by them.

The offending line from 0.3.6 (I believe other lines have been reported, but this is the most recent report of a similar issue, all were print statements with a monitor):

printLog("Verifying monitor["..monitorIndex.."] is of size x:"..monitorX.." by y:"..monitorY)
mechaet commented 10 years ago

Strict typing would prevent this, and I've got a pass coming up to take a look at stricter typing for all of the variables, as well as storing the device lists in tables then storing those tables on the disk. With all of the work having been done recently on the debug code and whatnot, I think it would be safe to go ahead and close this issue unless someone else has seen it since 0.3.8

sandalle commented 10 years ago

I am unsure if strict typing will help as this bug is more about the list of devices (monitors in the example provided) changing during the running of the program. I'd like to add a way (e.g. p_call) to catch these and recover, rather than crash.

mikeyyc commented 10 years ago

Shows up in 0.3.12 as well.

What's interesting is if I go into the code (edit mode) and exit out, no saves, then re-execute, all is well. Maybe it's a one-time load bug only?