[MDEV-6005] MariaDB 10.0.10 crashing within 10 minutes on CentOS 6.5 (with UDF from lib_mysqludf_preg) Created: 2014-04-02 Updated: 2014-05-04 Resolved: 2014-05-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.10 |
| Fix Version/s: | 10.0.11 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Koen Crijns | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | jemalloc, udf | ||
| Environment: |
|
||
| Attachments: |
|
| Description |
|
We've upgraded our production server to MariaDB 10.0.10 today after succesfull tests on our development server. On our production servers MariaDB crashes within 10 minutes. After crashing 7 times within 10 minutes we rolled back to 5.5. Since it's our production server, I can't do any more debugging. I didn't see any specific query or any other specific thing that caused the crashes. Please note that 5.5 runs rock solid on this server. The MySQL error log part for three crashes is attached. If you need more information, please let me know. |
| Comments |
| Comment by Elena Stepanova [ 2014-04-02 ] | |||||||||||||||||||||||||||||||
|
Hi, Does your development server have lib_mysqludf_preg.so, and of the same version, and use its functions? | |||||||||||||||||||||||||||||||
| Comment by Koen Crijns [ 2014-04-02 ] | |||||||||||||||||||||||||||||||
|
Hi Elena, Our development server has the exact same plugin. I just found out that MariaDB has builtin PCRE functionality that does exactly what we need (and a LOT faster). I'll try again tonight to install 10.0.10 on the production server without the plugin. | |||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-04-02 ] | |||||||||||||||||||||||||||||||
|
With lib_mysqludf_preg from https://github.com/mysqludf/lib_mysqludf_preg.git, I'm getting different failures – crashes, oom and valgrind erros – on a release build (not exactly the same stack as provided, but it might be the matter of the query); but on the debug build, I'm mostly getting one assertion failure as below. I'm not sure whether it's the problem of the udf, jemalloc, or MariaDB server.
No failures on 5.5, even with jemalloc. | |||||||||||||||||||||||||||||||
| Comment by Koen Crijns [ 2014-04-03 ] | |||||||||||||||||||||||||||||||
|
Update: I've disabled the lib_mysqludf_preg plugin and upgraded again from MariaDB 5.5.36 to MariaDB 10.0.10. So far running for 45 minutes without any crashes, so the problem seems to be solved for us. (Offtopic: the performance difference between PREG_REPLACE from the UDF plugin and REGEXP_REPLACE from MariaDB 10.0.10 is incredible, also on our production box!) | |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-05-04 ] | |||||||||||||||||||||||||||||||
|
This is a bug in lib_mysqludf_preg.
So, one must use pcre_free_substring() and not free() in this case. What really happens here — I suspect that the memory is allocated using system malloc, but passed to jemalloc for freeing. Thus the crash. Because jemalloc has provided its own free function, but pcre was loaded before that and pcre_malloc() calls the real system malloc. A fix would be to use pcre_free_substring() as documented. Or set pcre_malloc() to use jemalloc. Or, better, both. |