[BUG] Infinite loop + memory leak in message parsing
sfPlayer1 opened this issue ยท 6 comments
There is a nasty memory leak in dcshadow.me.vankka.simpleast.core.parser.Parser.parse
(dcintegration 2.0.1) when receiving a complex message similar to > some non-trivial quoted message (with various tokens) to break the bot.
from Discord. I am not sure whether this exact message triggers it, will investigate further if the obvious approach below fails.
It appears that the parse method enters an infinite loop, gradually filling the heap with presumably queue items or output data at ~100 MB/s.
SimpleAST recently received a couple commits around the relevant code that may fix this and 949168d apparently also includes them. Please consider a new dcintegration release with this commit included.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
I already had an different fix implemented in-dev, but not released yet. Will implement that SimpleAST update as soon as I can
Link to latest compiled file with workaround implemented: https://cdn.discordapp.com/attachments/302144329785278464/774672955488731136/dcintegration-2.0.2-1.16.jar
btw the problem of that were the newlines
I just tried using the latest commit of SimpleAST in-dev and removing my workaround. It is still not fixed. But I will go and push an release with the workaround soon
(posted to the wrong issue, was #148 (comment) )