RocketChat/fuselage

message-parser: RocketChat CPU usage 100% after sending specific lines. VERY NEED HELP!

arpsyapathy opened this issue · 1 comments

Description
Hello!
RocketChat CPU usage 100% after sending specific lines.
This is very big problem. Our server crash every hour.

This problem on your side or this in RC backend?
Is there any way to get around this problem? Maybe you can recommend a patch?

Help please!

issues in RC:
RocketChat/Rocket.Chat#30016
RocketChat/Rocket.Chat#30362

Steps to reproduce
Send for example:
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []
_ [] _ []

But problems also arise with various kinds of markdown messages with different elements that include double brackets

image

Error:

rocketchat_1  |
rocketchat_1  | <--- Last few GCs --->
rocketchat_1  |
rocketchat_1  | [1:0x4c7fee0]   429339 ms: Scavenge 2046.3 (2087.5) -> 2030.3 (2087.5) MB, 2.2 / 0.3 ms  (average mu = 0.996, current mu = 0.997) allocation failure
rocketchat_1  | [1:0x4c7fee0]   429358 ms: Scavenge 2046.3 (2087.5) -> 2030.3 (2087.5) MB, 2.3 / 0.3 ms  (average mu = 0.996, current mu = 0.997) allocation failure
rocketchat_1  | [1:0x4c7fee0]   429377 ms: Scavenge 2046.3 (2087.5) -> 2030.3 (2087.5) MB, 2.5 / 0.3 ms  (average mu = 0.996, current mu = 0.997) allocation failure
rocketchat_1  |
rocketchat_1  |
rocketchat_1  | <--- JS stacktrace --->
rocketchat_1  |
rocketchat_1  | FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
rocketchat_1  |  1: 0xa3ad50 node::Abort() [node]
rocketchat_1  |  2: 0x970199 node::FatalError(char const*, char const*) [node]
rocketchat_1  |  3: 0xbba90e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
rocketchat_1  |  4: 0xbbac87 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
rocketchat_1  |  5: 0xd76ea5  [node]
rocketchat_1  |  6: 0xd4f6d5  [node]
rocketchat_1  |  7: 0xed93be  [node]
rocketchat_1  |  8: 0xed950d  [node]
rocketchat_1  |  9: 0x1077ac3 v8::internal::Runtime_GrowArrayElements(int, unsigned long*, v8::internal::Isolate*) [node]
rocketchat_1  | 10: 0x1449379  [node]

Thank you in advance!