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.
TL;DR
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.
mkdir -p /tmp/mongo-build cd /tmp/mongo-build git clone --branch "r3.2.6" --depth 1 https://github.com/mongodb/mongo.git 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.
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 127.0.0.1:5002, 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 : connect@src/mongo/shell/mongo.js:223:14 @(connect):1:6 exception: connect failed
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 Tom
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 https://github.com/mongodb/mongo.git cd mongo scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs mongo mongod
If you issue ./mongo --help the binary still works but the connection has issues dealing with a non existant database. Seg Faulting instead of failing gracefully at the non existant database. Due to a null pointer dereference.
The offending code is in /src/mongo/client/mongo_uri_connect.cpp
if (!_user.empty()) {
ret->auth(_makeAuthObjFromOptions(ret->getMaxWireVersion()));
}
return ret;
}
It is claimed to be effected from 3.2.8 until 3.3.9 here.
https://jira.mongodb.org/browse/SERVER-23126
On another note if you require sharding add "core" to the scons line. For mongod, mongos and mongo to have them all included with the build.
scons --disable-warnings-as-errors --prefix=/tmp/mongo-build/mongo --js-engine=mozjs core
A good way around this would be to just point it to an existing database instead of a sample database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With