[MCOL-693] Segmentation Fault with non-string SP parameter Created: 2017-04-28 Updated: 2017-05-04 Resolved: 2017-05-04 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.0.8, 1.1.0 |
| Fix Version/s: | 1.0.9, 1.1.0 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Seungmin Yang | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
RHEL 6.6 |
||
| Attachments: |
|
| Sprint: | 2017-9 |
| Description |
|
While I was using MariaDB ColumnStore, segmentation fault occured. Log messages in dmesg command are belows:
I'm sorry that there is not enough information.. Thank you. |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2017-04-28 ] | |||||||||||||||||
|
Can you please run the MariaDB ColumnStore support tool and attach the resulting .tar.gz? This will help give us a clearer picture of what is going on across the cluster at the time of failure: | |||||||||||||||||
| Comment by Seungmin Yang [ 2017-05-02 ] | |||||||||||||||||
|
Thank you for your comment. | |||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-05-02 ] | |||||||||||||||||
|
Many thanks for the report. The problem occurs when this is executed:
Can you please show us the contents of this stored procedure so that we can reproduce this? | |||||||||||||||||
| Comment by Seungmin Yang [ 2017-05-02 ] | |||||||||||||||||
|
The contents of procedure is belows: There is no error when I input quotation mark. MariaDB [(none)]> call stm.SP_STM_SET_NCSC_STATUS(-1); MariaDB [(none)]> call stm.SP_STM_SET_NCSC_STATUS('-1'); | |||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-05-02 ] | |||||||||||||||||
|
Excellent, many thanks. I've been able to easily reproduce this and found the cause. The workaround for now is to use quotes as you have indicated. For ColumnStore team:
This assumes the parameter is always a string, the item may not have string data in it. In this case we probably should have used arg_item->val_int() to get the value so we probably need a type based switch statement or something that forces arg_item->str_value to be generated (the latter may be easier). My guess is for InfiniDB MySQL 5.1 automatically did the conversion whereas MariaDB 10.1/10.2 do not for optimisation purposes. This problem affects non-ColumnStore and ColumnStore tables as is in the vtable detection code. Test case:
| |||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-05-04 ] | |||||||||||||||||
|
Server tree pull request for develop and develop-1.0 | |||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2017-05-04 ] | |||||||||||||||||
|
Build tested: 1.0.9-1 and 1.1.0-1 GitHub source 1.0.9-1 Merge pull request #47 from mariadb-corporation/ [root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/ Merge pull request #159 from mariadb-corporation/ 1.1.0-1 [root@localhost mariadb-columnstore-server]# git show Merge pull request #46 from mariadb-corporation/ [root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/ Merge pull request #168 from mariadb-corporation/ Both branches returned the following error: MariaDB [mytest]> create table t2 (a int, b datetime) engine=columnstore; MariaDB [mytest]> insert into t2 values (1, now()); MariaDB [mytest]> delimiter // MariaDB [mytest]> delimiter ; | |||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2017-05-04 ] | |||||||||||||||||
|
reopen per my last comment | |||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-05-04 ] | |||||||||||||||||
|
Sorry, my test was bad. The errors are expected behaviour instead of a crash in that case. Improved test case:
The result should be similar to this for both call queries:
Before the fix the first would crash and the second would work. | |||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2017-05-04 ] | |||||||||||||||||
|
Verified the same two builds using the new test case. The issue was reproduced in 1.0.8-1. |