[MDEV-16529] [Draft] Server crashes in cleanup_empty_jtbm_semi_joins on 2nd execution of SP Created: 2018-06-19 Updated: 2023-11-28 Resolved: 2023-11-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Stored routines |
| Affects Version/s: | 10.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 1 |
| Labels: | None | ||
| Environment: | |||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Not reproducible so far. |
| Comments |
| Comment by Michael Widenius [ 2018-06-19 ] |
|
The crash happens in this code: void cleanup_empty_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list) Here is what I found out from the core dump: #4 0x00005636a71ce5c9 in cleanup_empty_jtbm_semi_joins (join=0x7f89945b5b40, info = 0x7f89942c7a58} (gdb) p join_list[0].first[0].next[0] $6 = {<Sql_alloc> = {<No data fields>} , next = 0x5636a8736d00 <end_of_list>,
(gdb) p table
(gdb) p ((TABLE_LIST*) join_list[0].first[0].info)->table_name b) p ((TABLE_LIST*) join_list[0].first[0].next[0].info)->table_name (gdb) p ((TABLE_LIST*) join_list[0].first[0].next[0].info)->table So the bug is that the second table in join_list was allocated on the The memory could be allocated here (or somewhere else where we add a table to the join_list) I did run the test case that Elena thinks was executed to try to find I added the following trivial patch to the code to ensure that we would +++ b/sql/opt_subselect.cc When now running the example code in the the bug report, I was able to So the bug is that in some cases we are using the wrong mem_root in Other things: |
| Comment by Oleksandr Byelkin [ 2018-12-21 ] |
|
It looks like it is fixed already (there was several bugs in semijoins fixed) |