Created attachment 78137 [details] Avoid overflow when computing availableStackSize from stack limit If the current stack limit is unlimited KJS::RegExp::availableStackSize is set to -1 (RLIM_INFINITY), which causes limits.match_limit_recursion being set to 0. This results in the spurious error "RangeError: Resource exhaustion trying to perform regexp match." $ ulimit -s unlimited $ kjs -e '/a/.test("a")' (eval) (line 0): RangeError: Resource exhaustion trying to perform regexp match.
Thx for reporting, but I posted a different solution on reviewboard https://git.reviewboard.kde.org/r/109555/ which also makes $ ulimit -s 2147483649 $ kjs -e '/a/.test("a")' work
Git commit ffc8a6a316cacc8df6a91584653fe2c867a5d489 by Bernd Buschinski. Committed on 29/03/2013 at 21:26. Pushed by buschinski into branch 'master'. kjs: Avoid overflow computing availableStackSize in KJS::RegExp::match REVIEW:109555 M +5 -0 kjs/regexp.cpp M +11 -0 kjs/regexp.h http://commits.kde.org/kdelibs/ffc8a6a316cacc8df6a91584653fe2c867a5d489
Bernd, Thanks for fixing this correctly. (and one more reason for submitting fixes upstream instead of submitting random quality patches to the opensuse packages)