I am trying to build Couchbase server on s390x architecture (RHEL7/SLES12). After successful build, when I ran the test cases, following test cases failed for s390x:
I made following change in the code to make 16 test cases pass:
bash-4.2# diff ./forestdb/src/arch.h_ORIG ./forestdb/src/arch.h
#define SPIN_INITIALIZER (spin_t)(0)
The above code change is required because older code was setting SPIN_INITIALIZER value to 1. This was causing ‘spin_lock’ to wait infinitely for spin lock which is not acquired by any
other thread (it’s just the lock is initialized with wrong value). Adding a check – “#if defined _s390x)” will make sure that the functionality doesn’t get changed for other architectures.