Bug #108618 ClusterJ test case crash at end
Submitted: 26 Sep 2022 16:58 Modified: 20 Oct 2022 19:58
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:8.0.30 OS:MacOS (12.6)
Assigned to: CPU Architecture:ARM (Apple M1 Pro)

[26 Sep 2022 16:58] Mikael Ronström
Description:
Running test case ./mtr --suite=ndb clusterj
It crashes after successfully completing with a crash in
Ndb_LockCPU_End due to the variable ndb_lock_cpu_mutex
(NdbMutex*) is pointing to address 20. This address is
not a proper address and causes the java process to
crash on a SIGBUS.

The bug isn't present in MySQL Cluster 8.0.23.

How to repeat:
./mtr --suite=ndb clusterj
[26 Sep 2022 16:59] Mikael Ronström
AS mentioned it only crashes when using Apple M1 Pro CPU and
Mac OS X. It doesn't crash on older Mac OS X using x86 CPU.
[26 Sep 2022 17:03] Mikael Ronström
Here is the build script used:
cmake -DWITH_DEBUG=0 -DWITH_SSL=$OPENSSL_ROOT -DWITH_NDBCLUSTER=1 -DWITH_NDB_TEST=1 -DWITH_NDBAPI_EXAMPLES=1 -DWITH_ROUTER=0 -DWITH_UNIT_TESTS=1 -DWITH_ERROR_INSERT=1 -DWITH_BOOST=$BOOST_ROOT -DWITH_NDB_JAVA=1 ../
make -j8
[26 Sep 2022 17:18] Mikael Ronström
It works in MySQL Cluster 8.0.29
[26 Sep 2022 18:36] Mikael Ronström
Using git bisect discovers that this is the patch that introduces the error:
commit 889e7da8006b4ce12d3e297ba3a46ee18ddc1278
Author: Mauritz Sundell <mauritz.sundell@oracle.com>
Date:   Wed Mar 23 16:17:39 2022 +0100

    Bug#33797357 portlib: -Wcast-qual [noclose]
    
    Change-Id: I30a1015f8f5f77600903dc6ae187bb1de5b3a2fc

Reverting this patch fixes the bug.
[27 Sep 2022 5:03] MySQL Verification Team
Hello Mikael,

Thank you for the report and feedback.

Sincerely,
Umesh
[28 Sep 2022 14:27] Mauritz Sundell
Posted by developer:
 
Can you provide compiler and java versions?

I failed to reproduce with below versions (from cmake output):

-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Java_VERSION: 11.0.12
[20 Oct 2022 19:58] Daniel So
Posted by developer:
 
Added the following entry to the NDB 8.0.32 changelog: 

"MySQL Test Run (MTR) quit unexpectedly after tests were completed on ClusterJ 8.0.30."