[MDEV-6985] MariaDB crashes on stored procedure call Created: 2014-10-30 Updated: 2014-12-17 Resolved: 2014-12-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5.40, 10.0.14 |
| Fix Version/s: | 5.5.41, 10.0.16 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Laurent Mahieux | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | crash, optimizer, procedure | ||
| Environment: |
Linux mariadblab 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u3 i686 GNU/Linux Mirror used: deb http://nwps.ws/pub/mariadb/repo/10.0/debian wheezy main Fresh debian install with those packages (plus nginx/phpmyadmin): ii libmariadbclient18 10.0.14+maria-1~wheezy i386 |
||
| Attachments: |
|
| Description |
|
We encoutered the crash with an unusually complicated stored procedure we restored from a mysql dump (works on mysql 5.5.40-0+wheezy1). We trimmed it down to the attached test case: The server will crash on the first to third call (usually first).
Although this procedure as it is is badly written (and we fixed it and the server no longer crashes), it should not bring down the whole the server. We also tried building the package from source (deb-src) to no avail. We reproduced this on 3 different physical servers, with default my.cnf settings as well as innoDB optimized settings for lots of RAM, on a new install as well as on a fully loaded server. For what it's worth, we noticed that the problem seems to be linked to the connection: if the server does not crash on the first call, quitting the client and connecting again seems to somehow delay the occurance of the crash. Best regards, |
| Comments |
| Comment by Elena Stepanova [ 2014-10-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, Could you please attach your cnf file(s) or the output of SHOW VARIABLES? Thanks. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Laurent Mahieux [ 2014-10-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
my.cnf when we first noticed the problem | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Laurent Mahieux [ 2014-10-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Stock Debian default my.cnf which also produces the crash | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Laurent Mahieux [ 2014-10-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have attached both the initial config in which we encountered the bug, as well as the default debian package config that we tested before submitting the report. Best regards, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Laurent Mahieux [ 2014-11-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, any update on this problem? Has anyone been able to replicate the problem? Knowing it is possible to crash the whole server with a poorly crafted stored procedure is a show stopper for us (we were a week away from production deployment). We would be thankful for any indication of progress, even if negative, as we need to re-evaluate our options. Best regards, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-11-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, a notification about your previous feedback slipped through the cracks. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2014-11-13 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can reproduce it. MTR-like test case (the query is exactly the same as in the initial SP, no simplification).
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
map2table second element is freed on second execution (why only second?) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
table_count somehow become 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
everything happened in subquery where is really only one table. So why in subquery it tries to find external table field that is the question. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The field resolved from cache and does not marked as "outer". | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Problem is that can_be_dependent is not set on the second execution (but set on the first) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The problem is that Item_ident can't stand double cleanup: first cleanup() set depended_from to NULL | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2014-11-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you review this please? |