unjs/consola

100% CPU on Linux, possibly stuck in an endless loop

georgzoeller opened this issue · 1 comments

Environment

Debian Bullseye / Node 20

Reproduction

Something is happening here (potentially related to emojiregexp, not sure) that's causing 100% on linux, it looks like the function may be stuck in an endless loop.

image

If I SIGUSR the process and inspect, I see it is running a loop around here that doesn't seem to end

image

Describe the bug

Specific conditions (have not been able to assertain exactly what the input string is is causing consola 3.2.2 to consume 100% CPU and make the main thread unresponsive. Stracktrace included in repro

Additional context

No response

Logs

No response

image

Bit more info. I don't know the exact string that blew it up, but the input was coming from a CLIP interrogator, which usually contains strings with weights such as

(artist:0.5), (modern:-1), etc. The brackets should be balanced but may not always be

It looks to me like a regexp is misfiring causing an endless loop in consola