[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:
Relates
relates to MDEV-11367 ArmHF SIGBUS errors in Mroonga Storag... Closed

 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.
The test that fails is connect.upd.

Sadly, no stack trace is available, however the common error message is:

161113  0:19:49 [ERROR] mysqld got signal 7 ;

NOTE: ArmHF requires memory alignment of 8 for 64 bit double values.

The problem is fixed on Launchpad via this patch:
https://github.com/cvicentiu/mariadb-10.0/commit/9e44ef13086672f2e852cd2ad6ae3ed658f999dd



 Comments   
Comment by Vicențiu Ciorbaru [ 2016-11-28 ]

MDEV-11367 is the same type of bug, different place in the code

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:

  1. Is it only required for double values?
  2. can a ArmHF be tested in #if conditions?

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 MDEV-11367. That patch replaces a longlong pointer dereference.
For #2: Yes

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.

Generated at Thu Feb 08 07:49:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.