MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 430 forks source link

event error #2528

Closed Nex4rius closed 7 years ago

Nex4rius commented 7 years ago

I'm getting this weird error in my program. Am I doing something wrong or is this a problem in the event api?

payonel commented 7 years ago

you definitely may have found a bug. can you please:

  1. tell us what oc version you are running ("latest" is not descriptive)
  2. explain the repro a) steps you take to hit this, b) how often this error occurs, c) does it repro after you reboot your oc computer?
  3. please, if you can, reduce this to MINIMAL repro [far less code i need to run]

I would be very glad to fix this if you can improve this bug report. Thanks -payo

Nex4rius commented 7 years ago

I have OpenComputers-MC1.7.10-1.6.2.12-universal I tested it with OpenOS 1.6 and OpenOS 1.6.1 and it didn't happen.

But I used my program to update OpenOS directly from the github files to 1.6.8 and I got the error but strangly only in this program and not in other programs that use the event api (probably something to do with event.timer() and event.cancel() which I don't use in other programs). I've tried to pinpoint what line(s) exactly is causing this error in my code but so far without luck.

Reproduce: run this "pastebin run -f icKy25PF" (on a fresh installation, with t3 gpu and t3 screen) then run this "pastebin run -f cyF0yhXZ Tank" wait ~2min

edit: I've shortend the code a bit (550 down to 186 lines) and the error still appears here

skyem123 commented 7 years ago

I remember getting something similar to this error before... I can't recall exactly what I did to get my program working, but I do know that it was caused by timers.

I think it's because it doesn't like you cancelling timers that are already finished or cancelled? I am not too sure though, either way, the error message is not helpful and it stumped me for a while.

payonel commented 7 years ago

This bug has my attention because the handler object should NEVER be nil. But If you can reduce the repro, I would appreciate it.

first of all, the first program changes the openos files. I'm not going to try to debug what that updater does, if it messes up any of the kernel files, and MOST importantly, expecting me to update openos to test your repro completely nullifies the meaning of what version you are on, and whether the bug has been fixed in later versions (assuming that updater even works corretly)

secondly, running the Tank program has two issues

  1. you didn't tell me whether to select server or client. nor did you mention if I needed both
  2. you didn't mention that I needed a modem device, and it appears that i do? ...

I am very invested in fixing this bug - and I appreciate the time you've already put into working with this bug. But honestly, this repro is more of a "debug my program" and less of a "bug" report.

payonel commented 7 years ago

a minimal repro won't require me to press enter to a prompt, pick a name for a "Client", choose between server and client, none of that

payonel commented 7 years ago

I ran as Client for about 30 minutes. no crash [testing on latest openos from http://ci.cil.li/job/OpenComputers-dev-MC1.7.10/ ]

payonel commented 7 years ago

If I run your program and choose "Server", it reboots and changes the resolution and tells me to wait. After some time (maybe two minutes like you said) it reverts to a command prompt home #. But the resolution is only 1 line high, so who knows if an error message printed. Oh, and while I'm typing this I see my test machine with your script just rebooted...

Everything is wrong with this as a repro

  1. simplify the program
  2. remove all code unrelated to your program and keep only what is needed for the bug
  3. don't make it hard for me to see the error
  4. don't make me choose ANY options unless it is crucial for the repro
  5. don't make me add any hardward (e.g. modem) unless it is necessary for a repro
Nex4rius commented 7 years ago

Sorry about that.

I've reduced the code now and the error still appears. Copy this and run it and after 1min the error occurs.

payonel commented 7 years ago

it repros very nicely with this. thank you @Nex4rius