[MXS-968] Maxinfo throws SIGSEGV and crashes maxscale Created: 2016-11-14 Updated: 2016-11-21 Resolved: 2016-11-21 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | maxinfo |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | 2.0.2 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Christopher Swingler | Assignee: | Esa Korhonen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 14.04.5 LTS, 3.13.0-58-generic #97-Ubuntu SMP Wed Jul 8 02:56:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux |
||
| Sprint: | 2016-22 |
| Description |
|
I'm still working to get some specifics, but after querying maxinfo enough times it will attempt to access a dereferenced pointer and crash. Working to determine if this is specific to the SQL listener or the HTTP listener, as we're querying both. We are dumping information out of maxinfo at a rate of probably twice per second; but I'm able to reproduce this within 30 minutes or so by simply turning our polling rate way up. Logs report:
I was able to get a core dump, as it may possibly contain passwords/hashes that we'd like to avoid sharing please reach out of me for a copy. Loading the core dump in GDB does get this:
|
| Comments |
| Comment by Christopher Swingler [ 2016-11-14 ] | ||||||||||
|
For what it's worth, it looks like this may be directly related to
against 2.0.1 will result in infinitely increasing memory consumption until it segfaults with the information above. Switching to 1.4.4 and repeating the same test leaves memory utilization static. Did the memory fix from | ||||||||||
| Comment by Johan Wikman [ 2016-11-15 ] | ||||||||||
|
Yes, the memory fix is in 2.0.1, so this seems to be something else. Thanks for reporting, we'll look into this. | ||||||||||
| Comment by Esa Korhonen [ 2016-11-16 ] | ||||||||||
|
The leaking memory is allocated in httpd.c:362 and assigned to dcb->data. After the maxinfo query has been completed, the dcb is closed as it should. Usually, the dcb->data is freed by calling a protocol specific authenticator free function. However, because the HTTPD-protocol in MaxScale does not specify an authenticator, an empty null-authenticator is used and the data never freed. The next query then generates another dcb and leaks more memory. This should be quickly fixable, but does not fix the crash when thread count > 0. | ||||||||||
| Comment by Esa Korhonen [ 2016-11-17 ] | ||||||||||
|
The crash with multiple threads executing the maxinfo-variables-query has been found to originate in maxinfo_exec.c:884. An address to a static variable is returned, and all threads modify the same data, causing the array index to go out-of-bounds. Fix is on the way. |