Jump to content
The Dark Mod Forums

Event Overflow. Possible Infinite Loop in Script


Recommended Posts

I'm getting this fatal 2.08 error message now and then when testing my WIP.

I've seen it happen when doing nothing, or when doing a specific action (like turning off a light switch).

Has anyone seen this, and does anyone have any suggestions on how to debug it? The error message doesn't give any information about which script might be causing the problem.

I have tons of scripting work in this WIP, so it looks like it'll be a big job trying to find the culprit.

Thanks.

  • Like 1
Link to post
Share on other sites

Stgatilov has added diagnostics for this kind of crash in 2.09, showing the 5 last events and 5 randomly chosen events out of the maximum of 10,000 per frame (IIRC).

Personally I've seen this happen in a custom elevator script that sometimes repeated itself an infinite number of times without any waits inbetween. This was in a script that started if IsOpen() is true, but would only continue if getFractionalPosition() was also true, otherwise it'd restart itself by checking IsOpen(). Sometimes those 2 tests don't agree with each other, so IsOpen would be true while getFractionalPosition is considered false. The solution was to use the same method, IsOpen(), for both tests.

JackFarmer has seen this when he had 2 or more elementals in his map near a door. They'd both place a reminder to check back in x seconds whether the door is still open, but for some reason those reminders accumulated so much that each elemental would post 6000 events per frame to check the door's state. This was fixed in 2.08.

  • Like 2
Link to post
Share on other sites

I'm afraid the whole story about event overflow was too late into 2.08 beta, so I decided to add only the core fixes to 2.08, and postpone the diagnostics. But any dev version published afterwards (or SVN version) should have the diagnostics. It should print something like "Soft limit of %d events per frame exceeded!" to console, with a list of latest events nearby, just before it stops with the hard error. The events log should provide some hint at what's going on.

Also there is the "ask a dev to investigate" option. It works pretty well, I promise 😄
But it requires sharing the map, which may be a hassle. If diagnostics don't help quickly and you are OK about sharing the map, just PM me.

Link to post
Share on other sites

Can I run SVN TDM in Release mode or do I need Debug mode to see the error messages.

Normally I would try either but it takes a long time for the error to occur.

Thanks.

Link to post
Share on other sites

I will see if I can reproduce the problem in the next week and understand the diags.

If there's no joy, I'll put together a pk4 and you can give it a try. You'll need everything; a subset would be useless.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...