It is currently March 29th, 2024, 12:30 pm

Crash with RegExp

Report bugs with the Rainmeter application and suggest features.
fredricko
Posts: 1
Joined: October 27th, 2014, 10:55 am

Crash with RegExp

Post by fredricko »

I've discovered a crash (and possible solution) when using RegExp to match multiple lines. The crash is a stack overflow, and seems to occur because of too much recursion when matching too many lines. Here is a repro:

1) Add the following to a skin's INI file:
[Measure]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=file://#CURRENTPATH#test.txt
RegExp="((.|\n)*)"

[Meter]
Meter=STRING

2) In a file called test.txt in the same folder, add the following lines:
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

(if this doesn't repro the crash, keep adding those lines until it does)

The solution seems to be to add "#define NO_RECURSE" in Library\pcre-8.10\config.h. I tried this and it seemed to fix the issue.