SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 20/10/2018, 11:29 PM   #71
DeLTi
Little Clucker
 
Join Date: Nov 2016
Posts: 20
Reputation: 0
Default Re: Timer Fix

[plugin.timerfix] error: cannot execute callback with name "Malloc_SolidifyTimer"
[plugin.timerfix] error: cannot execute callback with name "Malloc_SolidifyTimer"
DeLTi is offline   Reply With Quote
Old 21/10/2018, 11:59 AM   #72
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 50
Reputation: 24
Default Re: Timer Fix

Quote:
Originally Posted by DeLTi View Post
[plugin.timerfix] error: cannot execute callback with name "Malloc_SolidifyTimer"
[plugin.timerfix] error: cannot execute callback with name "Malloc_SolidifyTimer"
https://github.com/KashCherry/Timer-Fix-plugin/issues/5
__________________
KashCherry is offline   Reply With Quote
Old 03/11/2018, 02:37 PM   #73
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 62
Reputation: 0
Default Re: Timer Fix

When I put this plugin on my server the timers are freezing. I put the include in the script + the plugin.
When I run the gamemode with crashdetect I got this:
Code:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[15:34:02] 
[15:34:02] Server Plugins
[15:34:02] --------------
[15:34:02]  Loading plugin: crashdetect.so
[15:34:02]   CrashDetect v4.15.1 is OK.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: timerfix.so
[15:34:02]   Timer Fix plugin v1.05 by KashCherry loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: mysql_static.so
[15:34:02]  >> plugin.mysql: R34 successfully loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: Whirlpool.so
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Whirlpool loaded
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: sscanf.so
[15:34:02] 

[15:34:02]  ===============================

[15:34:02]       sscanf plugin loaded.     

[15:34:02]          Version:  2.8.1        

[15:34:02]    (c) 2012 Alex "Y_Less" Cole  

[15:34:02]  ===============================

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: streamer.so
[15:34:02] 

*** Streamer Plugin v2.9.3 by Incognito loaded ***

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: pawncmd.so
[15:34:02] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
[15:34:02]   Loaded.
[15:34:02]  Loaded 7 plugins.

[15:34:02] 
[15:34:02] Filterscripts
[15:34:02] ---------------
[15:34:02]   Loading filterscript 'GYM.amx'...
[15:34:02] [debug] Server crashed due to an unknown error
[15:34:02] [debug] Native backtrace:
[15:34:02] [debug] #0 f73e5e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[15:34:02] [debug] #1 f73debcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[15:34:02] [debug] #2 f73dfdbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[15:34:02] [debug] #3 f73e0226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[15:34:02] [debug] #4 f73e5adc in ?? () from plugins/crashdetect.so
[15:34:02] [debug] #5 f7749410 in ?? ()
[15:34:02] [debug] #6 f7749430 in ?? ()
[15:34:02] [debug] #7 f7439137 in gsignal () from /lib/libc.so.6
[15:34:02] [debug] #8 f743a973 in abort () from /lib/libc.so.6
[15:34:02] [debug] #9 f747ae15 in ?? () from /lib/libc.so.6
[15:34:02] [debug] #10 f74838ad in ?? () from /lib/libc.so.6
[15:34:02] [debug] #11 f767baef in _ZdlPv () from /lib/libstdc++.so.6
[15:34:02] [debug] #12 f72de6e9 in _ZN4Hook5ApplyEP6tagAMX () from plugins/timerfix.so
[15:34:02] [debug] #13 f72df80f in AmxLoad () from plugins/timerfix.so
[15:34:02] [debug] #14 080d1c89 in ?? () from ./samp03svr
[15:34:02] [debug] #15 080a1261 in ?? () from ./samp03svr
[15:34:02] [debug] #16 080ab601 in ?? () from ./samp03svr
[15:34:02] [debug] #17 080aba0b in ?? () from ./samp03svr
[15:34:02] [debug] #18 080aa0fd in ?? () from ./samp03svr
[15:34:02] [debug] #19 f74241b3 in __libc_start_main () from /lib/libc.so.6
[15:34:02] [debug] #20 0804b4e1 in ?? () from ./samp03svr
any solution?
UPDATE:
After I removed all filterscripts from my server the plugin is working, but after I added the necessary fs to the server again, the timers are working slow, like 5 seconds are gone and then 2 seconds to go -1 on the timer.
This is really strange becouse I have tried with some fs who don't use timers.
Video:
yt.com/watch?v=wCnbSGuT2ow
ALSO I have a question: I heard that some timer fixes plugins(not this one) are going crazy after ~20 days. I need to know if someone tested this timer plugin and got no problem with timers going "crazy".
Thanks

Last edited by StRaphael; 03/11/2018 at 05:05 PM.
StRaphael is offline   Reply With Quote
Old 03/11/2018, 03:02 PM   #74
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,241
Reputation: 3185
Default Re: Timer Fix

I confirmed another bug in timers the other day, and looking at your code, yours has the same. If you spawn 2^32 timers the ID wraps around and returns 0 as a valid ID. Fixing it is easy - just check if the ID is 0, and increment it again if so.
Y_Less is offline   Reply With Quote
Old 03/11/2018, 03:36 PM   #75
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,241
Reputation: 3185
Default Re: Timer Fix

Actually, I've not confirmed this yet, but it looks like on wrap around you could end up re using IDs that are still valid timers and end up clobbering them.
Y_Less is offline   Reply With Quote
Old 04/11/2018, 07:43 AM   #76
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 50
Reputation: 24
Default Re: Timer Fix

Quote:
Originally Posted by Y_Less View Post
I confirmed another bug in timers the other day, and looking at your code, yours has the same. If you spawn 2^32 timers the ID wraps around and returns 0 as a valid ID. Fixing it is easy - just check if the ID is 0, and increment it again if so.
Yes, you're right, but I use signed int, so 2^31. However, it's not easy to create such a number of timers, of course if you don't do it on purpose. Unfortunately, increasing ID will not help. If the first timer with ID 1 isn't killed, then we will get a collision. I can change type for this variable, but then the functions like SetTimer will return ID < 0.
__________________
KashCherry is offline   Reply With Quote
Old 04/11/2018, 07:59 AM   #77
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 50
Reputation: 24
Default Re: Timer Fix

Quote:
Originally Posted by StRaphael View Post
When I put this plugin on my server the timers are freezing. I put the include in the script + the plugin.
When I run the gamemode with crashdetect I got this:
Code:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[15:34:02] 
[15:34:02] Server Plugins
[15:34:02] --------------
[15:34:02]  Loading plugin: crashdetect.so
[15:34:02]   CrashDetect v4.15.1 is OK.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: timerfix.so
[15:34:02]   Timer Fix plugin v1.05 by KashCherry loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: mysql_static.so
[15:34:02]  >> plugin.mysql: R34 successfully loaded.
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: Whirlpool.so
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Whirlpool loaded
[15:34:02]  
[15:34:02]  ==================
[15:34:02]  
[15:34:02]   Loaded.
[15:34:02]  Loading plugin: sscanf.so
[15:34:02] 

[15:34:02]  ===============================

[15:34:02]       sscanf plugin loaded.     

[15:34:02]          Version:  2.8.1        

[15:34:02]    (c) 2012 Alex "Y_Less" Cole  

[15:34:02]  ===============================

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: streamer.so
[15:34:02] 

*** Streamer Plugin v2.9.3 by Incognito loaded ***

[15:34:02]   Loaded.
[15:34:02]  Loading plugin: pawncmd.so
[15:34:02] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
[15:34:02]   Loaded.
[15:34:02]  Loaded 7 plugins.

[15:34:02] 
[15:34:02] Filterscripts
[15:34:02] ---------------
[15:34:02]   Loading filterscript 'GYM.amx'...
[15:34:02] [debug] Server crashed due to an unknown error
[15:34:02] [debug] Native backtrace:
[15:34:02] [debug] #0 f73e5e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[15:34:02] [debug] #1 f73debcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[15:34:02] [debug] #2 f73dfdbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[15:34:02] [debug] #3 f73e0226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[15:34:02] [debug] #4 f73e5adc in ?? () from plugins/crashdetect.so
[15:34:02] [debug] #5 f7749410 in ?? ()
[15:34:02] [debug] #6 f7749430 in ?? ()
[15:34:02] [debug] #7 f7439137 in gsignal () from /lib/libc.so.6
[15:34:02] [debug] #8 f743a973 in abort () from /lib/libc.so.6
[15:34:02] [debug] #9 f747ae15 in ?? () from /lib/libc.so.6
[15:34:02] [debug] #10 f74838ad in ?? () from /lib/libc.so.6
[15:34:02] [debug] #11 f767baef in _ZdlPv () from /lib/libstdc++.so.6
[15:34:02] [debug] #12 f72de6e9 in _ZN4Hook5ApplyEP6tagAMX () from plugins/timerfix.so
[15:34:02] [debug] #13 f72df80f in AmxLoad () from plugins/timerfix.so
[15:34:02] [debug] #14 080d1c89 in ?? () from ./samp03svr
[15:34:02] [debug] #15 080a1261 in ?? () from ./samp03svr
[15:34:02] [debug] #16 080ab601 in ?? () from ./samp03svr
[15:34:02] [debug] #17 080aba0b in ?? () from ./samp03svr
[15:34:02] [debug] #18 080aa0fd in ?? () from ./samp03svr
[15:34:02] [debug] #19 f74241b3 in __libc_start_main () from /lib/libc.so.6
[15:34:02] [debug] #20 0804b4e1 in ?? () from ./samp03svr
any solution?
UPDATE:
After I removed all filterscripts from my server the plugin is working, but after I added the necessary fs to the server again, the timers are working slow, like 5 seconds are gone and then 2 seconds to go -1 on the timer.
This is really strange becouse I have tried with some fs who don't use timers.
Video:
yt.com/watch?v=wCnbSGuT2ow
ALSO I have a question: I heard that some timer fixes plugins(not this one) are going crazy after ~20 days. I need to know if someone tested this timer plugin and got no problem with timers going "crazy".
Thanks
Can you give me this fs?
__________________
KashCherry is offline   Reply With Quote
Old 04/11/2018, 01:12 PM   #78
StRaphael
Big Clucker
 
Join Date: Nov 2016
Posts: 62
Reputation: 0
Default Re: Timer Fix

Quote:
Originally Posted by KashCherry View Post
Can you give me this fs?
For sure:
https://pastebin.com/SQDWfc6S (this fs I used in my video)
And another fs(that I didn't used in the video)
https://pastebin.com/9pSXpkQ0
StRaphael is offline   Reply With Quote
Old 04/11/2018, 02:44 PM   #79
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,241
Reputation: 3185
Default Re: Timer Fix

Yes, the problem with potentially reusing valid IDs was what I was getting at in my second post. I know that's hard to fix, but might have some code you can use.

As for the 0 issue, I think it should be fixed even if the other reused IDs aren't. I know it is an unlikely scenario to happen in real code (it took around two hours for specially written code to wrap around without crashing), but the guarantee that the function will never return 0 in normal operating mode seems highly desirable. Without that you can never be entirely certain that the function failed or not.
Y_Less is offline   Reply With Quote
Old 07/11/2018, 12:41 PM   #80
KashCherry
Big Clucker
 
KashCherry's Avatar
 
Join Date: Feb 2018
Location: Estonia
Posts: 50
Reputation: 24
Default Re: Timer Fix

Plugin updated to version 1.06

- Fixed (big) delays.
- Added warning message about a large number of timers.

Download from Releases page.
__________________
KashCherry is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer ID stored in a variable gets wiped when timer hits ? NeXoR Scripting Help 2 25/03/2017 08:22 PM
Performance Question , Per Player Timer vs Timer that loops through all players BiosMarcel Scripting Help 14 12/12/2016 10:50 AM
If /foodsearch doesn't find item, set wait timer (TIMER HELP) Josh_Main Scripting Help 7 14/09/2016 05:13 PM
Which is better Per Player Timer or Global timer? (issue with timer) Dokins Scripting Help 4 07/06/2016 10:50 AM
Slice's Timer Fix include --> timer public function isn't getting called Riwerry Scripting Help 0 02/01/2016 04:50 PM


All times are GMT. The time now is 03:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.