[MCOL-2182] PrimProc crash - signal 11, Segmentation fault - funcexp::Func_lpad::getStrVal Created: 2019-02-19 Updated: 2020-08-25 Resolved: 2019-03-11 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 1.2.2 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hill (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
2um 2pm |
||
| Sprint: | 2019-03 |
| Description |
|
Customer reported PrimProc crash. From logs, there was no other processes crashes at the same time. System was left not working, they had to restart the system Program terminated with signal 11, Segmentation fault. at /data/buildbot/bb-worker/centos7/mariadb-columnstore-engine/utils/funcexp/func_lpad.cpp:127 #1 0x00007fdd447c612d in execplan::FunctionColumn::getStrVal (this=0x7fb6ff08f700, row=..., isNull=<optimized out>) at /data/buildbot/bb-worker/centos7/mariadb-columnstore-engine/dbcon/execplan/functioncolumn.h:209 #2 0x00007fdd43d2bc0e in funcexp::Func_Str::stringValue (this=<optimized out>, fp=..., row=..., isNull=@0x7fdd053fc45d: false, fFloatStr="HO") at /data/buildbot/bb-worker/centos7/mariadb-columnstore-engine/utils/funcexp/functor_str.h:123 #3 0x00007fdd43d2b8ab in funcexp::Func_concat::getStrVal (this=0x7fb70b3ad1a0, row=..., parm=std::vector of length 4, capacity 4 = {...} , isNull=@0x7fdd053fc45d: false) ) |
| Comments |
| Comment by David Hall (Inactive) [ 2019-03-08 ] |
|
The problem is the lpad() with only two parameters. I think the user has a mistake in their SQL, as the second parameter is in quotes and it should be a numeric value. A change in MariaDB 10.3 allows lpad (and rpad) to allow only two parameters, the third --the pad character – defaulting to a space. Columnstore was not updated to reflect this change, and attempted to access the third parameter thus going outside the vector and causing a crash. Code was fixed to insert a space as the default when two parameters are used. In addition, modifications were made to properly use a quoted numeric for the second parameter. Note: the behavior when the second parameter is missed and so the third is used as the second (as possibly in the complainants case), there's a good chance the second parameter will evaluate to 0, in which case NULL will be returned. |
| Comment by David Hall (Inactive) [ 2019-03-08 ] |
|
For QA: Will crash before the patch and will return 85 rows of NULL (1g) after the patch. |
| Comment by Daniel Lee (Inactive) [ 2019-03-11 ] |
|
Build verified: 1.2.3-1 nightly server commit: |