[MDEV-11366] ArmHF SIGBUS errors in Connect Storage Engine Created: 2016-11-28 Updated: 2016-12-02 Resolved: 2016-12-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.28 |
| Fix Version/s: | 10.0.29, 10.1.20, 10.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Vicențiu Ciorbaru | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | foundation | ||
| Environment: |
Launchpad Ubuntu |
||
| Issue Links: |
|
||||||||
| Description |
|
While building and testing on Launchpad, MariaDB crashes with SIGBUS in the connect storage engine when working with doubles as data, in a TABLE_FORMAT=BIN table. Sadly, no stack trace is available, however the common error message is:
NOTE: ArmHF requires memory alignment of 8 for 64 bit double values. The problem is fixed on Launchpad via this patch: |
| Comments |
| Comment by Vicențiu Ciorbaru [ 2016-11-28 ] |
|
|
| Comment by Olivier Bertrand [ 2016-11-30 ] |
|
I have seen your patch. However, because can be a performance increase, I'd like to make it conditional:
Thanks. |
| Comment by Vicențiu Ciorbaru [ 2016-11-30 ] |
|
For #1: This concerns more than ArmHF unfortunately. We need to check with every platform what kind of restrictions it imposes. Also, it happens with longlong values as well I think, but testing it was very tricky. Check the related I know that this matter is concerning performance wise, but I'd really want to test this instead of relying on brittle code. It might be that compilers are smart enough to transform memcpy into a pointer dereference anyway. I can try a micro benchmark to see if this impacts performance or not, but the caveat is that it might not give the full picture depending on various compilers. |
| Comment by Olivier Bertrand [ 2016-11-30 ] |
|
I know, the same kind of patch is also needed for MIPS platforms but for all numerical types, not only doubles. |
| Comment by Vicențiu Ciorbaru [ 2016-11-30 ] |
|
I didn't know about that. Can you link it somehow? Where is it applied? I'm slightly worried that my patch is not complete. I think there are more potential pointer dereferences in the Connect Storage engine but I did not spend too much time to understand the surrounding logic. |
| Comment by Olivier Bertrand [ 2016-11-30 ] |
|
There has been a discussion about such problems with MIPS and a proposed patch that was not correct. Looking into the code, I discover another patch that was made by I don't know who, but that I am going to test because it may not be correct in some cases. The key places to look at are in tabfix.cpp from line 471 and the patch is in value.h line 127. |
| Comment by Olivier Bertrand [ 2016-12-02 ] |
|
Vicentiu: I applied your patch plus some more fixes concerning writing in BIN table files. However this was tested on my machine and on buildbot machines only and apparently none of them have CPU requiring alignment. So please test if my fixes really work when the new versions will be released and reopen this case if not. Thanks. |