|Titel||Use RE2 regular expression engine for Livestatus queries.|
|Check_MK Edition||Check_MK Raw Edition (CRE)|
|Level||2 - Prominent Change|
|Kompatibilität||Kompatibel - benötigt keine manuelles eingreifen|
Livestatus offers various places where a regular expression can be used, e.g. in its "Filter:" header for GET queries. The previous implementation had various problems, which have all been fixed by switching to a new regular expression engine RE2:
- Unicode was not handled correctly: RE2 fully understands UTF-8, so this has been fixed.
- Unbounded memory usage during matching: This could lead to stack overflows and CMC/Nagios crashes when trying to match some classes of regular expressions on long inputs. RE2 guarantees that this won't happen, it either complains that a regular expression is too complicated (which is hard to provoke) or runs in constant memory afterwards.
- Exponential runtime: Some classes of regular expressions could lead to exponential runtime, blocking Livestatus threads and using CPU time for some millenia or more. RE2's runtime is linear in the size of the regular expression and the input, so this has been fixed, too.
As an additional bonus, most of the time RE2 is quite a bit faster than the previous implementation.
Note that one esoteric detail is different, though, namely the semantics of submatching. If you relied on this, you probably already had some problems, because almost every POSIX regex implementation out there was buggy in some way.