[MDEV-13356] 10.0.29 crashes on REGEXP with "(.|x)*" on certain conditions Created: 2017-07-19 Updated: 2017-07-20 Resolved: 2017-07-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.0.24, 10.0.29 |
| Fix Version/s: | 10.1.24, 10.0.31, 10.2.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Nicky Gerritsen | Assignee: | Sergei Golubchik |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu Xenial (16.04) |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
On at least MariaDB server 10.0.24 and 10.0.29 I can let the MariaDB server crash with a simple REGEXP query. Use the following table:
With the following content:
Now execute the following query:
This will result in MySQL crashing everytime. (note: we actually used (.|[\n\s])* in our code but I simplified it a bit here) Some things I have already noticed:
My my.cnf is attached, as well as a core dump (created with MariaDB 10.0.29-MariaDB-0ubuntu0.16.04.1 on Ubuntu 16.04). The stack trace for the core dump is:
If I need to supply anything else please let me know! |
| Comments |
| Comment by Nicky Gerritsen [ 2017-07-19 ] |
|
The current 10.2 packages from the MariaDB repo (version 10.2.7+maria~xenial as of writing) does not seem to have this issue by the way, but there it seems the regex does not match any results, which I think it should do. |
| Comment by Sergei Golubchik [ 2017-07-20 ] |
|
It's pcre stack overflow when recursion goes too deep. A duplicate of It doesn't match the result with a warning "recursion too deep". We prevent stack overflow by limiting recursion depth. In 10.0.31 the limit was 100, always the same. In 10.0.32 it'll depend on the available stack size (usually, about 500 with default settings on x86-64). |