Tom Freudenberg Tom Freudenberg - 9 months ago 116
Linux Question

Build mongo shell 3.2.x on ARM (armv7l/arm64/aarch64) - segmentation fault

Over the past days I tried a lot to get mongo shell running on Ubuntu 16.04 for ARM64 (aarch64) at Linaro cluster. I am currently working on the next release fork for meteorjs on ARM architecture.


While the mongod (DB) is running well after build without seen issues yet, it is not possible to get a running mongo shell [even WITHOUT javascript (mozjs) support] after build.

Simplest build:

mkdir -p /tmp/mongo-build

cd /tmp/mongo-build

git clone --branch "r3.2.6" --depth 1

cd mongo

scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs mongo mongod

Even that this build will be run on all tested platforms and architectures (Linux on armv7l, aarch64, amd64) without issues during compiling, the results in case of running programs differs.

Running mongo command after build on amd64:

Just run mongo shell and try to connect to a non existing instance

./mongo mongodb://localhost:5002/sample

this will give this output:

MongoDB shell version: 3.2.6
connecting to: mongodb://localhost:5002/sample
2016-07-05T14:10:23.772+0200 W NETWORK [thread1] Failed to connect to, reason: errno:111 Connection refused
2016-07-05T14:10:23.772+0200 E QUERY [thread1] Error: couldn't connect to server localhost:5002, connection attempt failed :

exception: connect failed

Running mongo command after build on aarch64/armv7l:

Instead of this, the output on ARMs is just:

MongoDB shell version: 3.2.6
Segmentation fault (core dumped)

It seems to me that the TCP connection part might bring up that "SEGMENTATION FAULT" but I can't debug this.

I would be happy about any help to get this run.

Thanks in advance

Answer Source

After running a lot more tries and compiles, I have changed the branch for mongodb release and work with r3.3.9.

While using the same scons parameters it seems to run without any issue. I have not yet digged into details and changes in the versions but to have a running release is fine to me

mkdir -p /tmp/mongo-build

cd /tmp/mongo-build

git clone --branch "r3.3.9" --depth 1

cd mongo

scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs mongo mongod