[MDEV-23902] MariaDB crash on calling function Created: 2020-10-07 Updated: 2023-11-24 Resolved: 2023-09-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Procedure, Views |
| Affects Version/s: | 10.3.24, 10.4.14, 10.5.5, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8 |
| Fix Version/s: | 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | suresh ramagiri | Assignee: | Dmitry Shulga |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
One of our customer observed server crashes, when calling a function, which invokes two other functions, involving some tables and a view. This behavior is observed at the 10.3.24, 10.4.14 and 10.5.5 (the latest releases). Also, important to note customer has provided the related functions, tables, views details, through which I can locally able to reproduce the issue at our latest releases. Attached is the dump.sql having all related functions, tables, views. Also, attaching full error log(maria.err), all threads backtrace(mysqld_bt_all_threads.txt) output. To reproduce:
Error log output:
|
| Comments |
| Comment by Daniel Black [ 2020-10-07 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Nice bug report. Thanks. Can you attach the dump.sql? It seems to be missing despite your description. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2020-10-07 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Repeatable on 10.3-10.5.
| ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2021-04-21 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
SP trys to access memory to delete sp_result_field which was allocated in runtime arena of other sp and already deleted after execution of other (outer) SP. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2021-04-23 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
The problem is also that there is 2 Item for f3 SP. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2021-04-23 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Problem is with Item_sp (f3) created by make_view, which allocates result firld in runtime of f2 function and cleaned up when the runtime root is already freed. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2021-04-26 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
the test with no errors:
on 10.2 can not be reproduced because "ROW TYPE OF v1" is important but it is absent in 10.2. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Dmitry Shulga [ 2023-07-20 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
A patch for review is pushed to the branch bb-10.4- | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-07-26 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
I do not see how it avoud memory leak by allocatiing it only once, have you checked it? | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-09-18 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
OK to push |