[MDEV-31117] Spider UBSAN runtime error: applying non-zero offset x to null pointer in st_spider_param_string_parse::restore_delims Created: 2023-04-24 Updated: 2023-10-22 Resolved: 2023-08-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Spider |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1 |
| Fix Version/s: | 10.4.32, 10.5.23, 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Roel Van de Paar | Assignee: | Yuchen Pei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | UBSAN | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Leads to:
Setup:
Bug confirmed present in: |
| Comments |
| Comment by Roel Van de Paar [ 2023-04-24 ] | |||||||||||||||||||||||||||||||||||||||
|
Interestingly, in 10.4 only, the debug and optimized stacks are missing function names in the leading frames:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2023-05-20 ] | |||||||||||||||||||||||||||||||||||||||
|
Similar outcome with this testcase
And interesting:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-05-25 ] | |||||||||||||||||||||||||||||||||||||||
|
With the testcase in the description, at 10.4 9f909e546e14ed9b529cddc2c1a5c2aa61d57e56 and 11.0 8e55d7ea4a2f94ae3f38fdd8785778612d4b1203, I get
With the other testcase that has ALTER TABLE mysql.help_topic ENGINE=Spider;, at 11.0 8e55d7ea4a2f94ae3f38fdd8785778612d4b1203 I get
| |||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2023-05-27 ] | |||||||||||||||||||||||||||||||||||||||
|
Yes, these are the outcomes in the CLI (or MTR without changes).
Leads to:
Interesting here is that the error is "Unknown" (so I had to use the numerical to get it to work, this is the original output before the fix):
It would be good to resolve the "Unknown" as par of the fix. I assume this is another example of MDEV-30576, as:
The other testcase:
Same outcome. | |||||||||||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-06-16 ] | |||||||||||||||||||||||||||||||||||||||
|
A crude fix: https://github.com/MariaDB/server/commit/025ad07aae1 But the spider connection info parser itself does not look very healthy. It is poorly written and documented, and should be cleaned up. | |||||||||||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-06-19 ] | |||||||||||||||||||||||||||||||||||||||
|
So the invalid connection string "help topics" comes from the comment | |||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2023-06-26 ] | |||||||||||||||||||||||||||||||||||||||
|
An additional testcase with a different stack
Leads to UniqueID/stack:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-07-05 ] | |||||||||||||||||||||||||||||||||||||||
|
Hi holyfoot, ptal thanks: https://github.com/MariaDB/server/commit/1c997a3d07fda1a81baf39df89ef011436a71740 The parsing logic that caused the issue in this ticket was a mess. So my fix involves a cleanup of the parser. In the future we may remove the spider parsing mechanism altogether in favour of engine-defined options ( This above commit is based on 11.0. I also have a commit based on 10.4[1] which is not qualitatively different, and a review of the 11.0 version should be sufficient. | |||||||||||||||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2023-08-16 ] | |||||||||||||||||||||||||||||||||||||||
|
ok to push. | |||||||||||||||||||||||||||||||||||||||
| Comment by Yuchen Pei [ 2023-08-23 ] | |||||||||||||||||||||||||||||||||||||||
|
Thanks for the review. Pushed e9f3ca612528c5f917e27ef6113fd1deda2aef26 to 10.4 before pushing: tested on 10.4-6,10.10-11.2,ES-10.4,10.6,23.06 after merge changes:
|