You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the lua built-in functions string.match and string.find take in patterns, which are matched using a backtracking matcher. a backtracking matcher can take exponential time to complete, effectively freezing the game even with very low instruction counts.
Reproduction Steps
lower your own avatar's trust level
/figura run string.find("this will run for at least three eternities", ".*.*.*.*.*.*.*.*.*.*z.*")
observe that the game freezes
Log File
N/A
The text was updated successfully, but these errors were encountered:
Step 1: make a while true loop Observe that the game freezes :trol:
Due to instruction counting, such a construct will not freeze the game with low trust levels. as string pattern matching happens inside luaj itself, it is not counted against the instruction limit despite having the ability to take an arbitrarily long amount of time.
I don't see a reasonable way to fix this without reimplementing string.match, unless we just add a 2ⁿ punishment for having n + or * characters in the pattern from the sandbox script.
Bug Description
the lua built-in functions
string.match
andstring.find
take in patterns, which are matched using a backtracking matcher. a backtracking matcher can take exponential time to complete, effectively freezing the game even with very low instruction counts.Reproduction Steps
/figura run string.find("this will run for at least three eternities", ".*.*.*.*.*.*.*.*.*.*z.*")
Log File
N/A
The text was updated successfully, but these errors were encountered: