Issue information

Issue ID
#3967
Status
Done
Severity
Medium
Started
Hercules Elf Bot
Dec 24, 2009 17:56
Last Post
Ind
Apr 16, 2013 6:48
Confirmation
N/A

Hercules Elf Bot - Dec 24, 2009 17:56

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3967

If a timer function specifies a timeout of 0ms and calls itself, you will get an infinite loop. The timer code will forever keep processing this timer function, making the server freeze. Should we add some sort of safeguard/failsafe to let the server continue operating in such a case?

Additionally, if the timer function A pushes some other timer function B onto the timer heap before pushing a copy of itself, the timer heap will behave like a stack, processing the newest entry. This produces an ever-growing array of B timer entries. The infinite loop will go on until the process runs out of allocable memory.

Ind - Apr 16, 2013 6:48

I think this sort of low-level baby sitting doesn't really help, it's a source-level coding error if this happens -- and hardly worth the overhead of checking this, if it happens its a one-time thing which you can debug with gdb or similar, then never again.