Exception out of nowhere

All other Source.Python topics and issues.
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Exception out of nowhere

Postby iPlayer » Thu Apr 21, 2016 11:54 pm

Hey there

Wanted to share a puzzle that you guys might want to look at if you have some spare time.

My code (that was working properly before) recently started crashing, and I can't figure out what has changed - yes, I'm this bad.

Somehow the crash is related to the pre-hooks, because if I remove the prehook, the crash doesn't happen.

Because I'm too lazy to download a SRCDS again and am doing all my tests on a listen server, it's difficult to check if there're any exceptions raised - the game just closes itself.

What I did is put host_timescale 0.05, triggered the chain of events that would lead to crash (threw a grenade) and started waiting the crash (grenade detonation) with the opened console, ready to take a screenshot.

This.
Image

What's funny, the game did not crash.

But the exception... I personally do not have any method called _execute, but SP does. It belongs to TickRepeat class from listeners/tick.py. And this method is only referenced in several places

Code: Select all

# Start the delay
        self._delay = Delay(self._interval, self._execute)


Code: Select all

# Start the delay
        self._delay = Delay(self._loop_time, self._execute)


Code: Select all

# Call the delay again
            self._delay = Delay(self._interval, self._execute)


That's it, it's only called from withing a Delay, which is created without any arguments to pass to ._execute. So 'self' is the first positional argument obviously, but where could another, unexpected one come from?

And the fact that there's basically no traceback to this exception doesn't make things easier. Most probably it indeed belongs to tick listener system.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Exception out of nowhere

Postby iPlayer » Fri Apr 22, 2016 2:42 am

Figured out the reason of the crashes. Posted it here.
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests