Couchdb-couch_set_view-19-compaction-retry test failure for s390x


I am trying to build Couchbase server on s390x architecture (RHEL7/SLES12). After successful build, when I ran the test cases, “couchdb-couch_set_view-19-compaction-retry” test case failed for s390x.

I made following change in the code to make it pass:

bash-4.2# diff ./couchstore/src/views/bin/couch_view_file_merger.c_ORIG ./couchstore/src/views/bin/couch_view_file_merger.c
< } merge_file_type_t;
.> };
.> typedef unsigned char merge_file_type_t;

The “if (fscanf(stdin, “%c\n”, (char *)&view_file_type) != 1)” statement gets wrong input character if we don’t do this change. The C and C++ standards allows the character type char to be signed or unsigned, depending on the platform and compiler. For s390x, the type of char is unsigned. This variation causes getting junk characters for s390x. The code change will make the type consistent across all platforms.


Thanks - I have been in touch with Cindy. We can communicate through JIRA here as well on some of these issues. If you can pass me your email, I can send you an invite for our JIRA tracking system.


Thanks for the invitation Cihan. My email id is


great - you should have an invite to make signup easy to our tracking system.