Reputation: 1589
I have tried executing this node script on an x64 computer, and it appears to work fine.
However, the same script reports a bus error when run on the Raspberry Pi. It gives a [6047.715610] Unhandled Fault: alignment exception error, with the error reported on the next line, as a Bus error. It appears that the error stems from MongoClient.connect().
The script utilizes MongoClient and GridStore from the mongodb module. In addition, I have attempted a re-installation from this repository (which appears to do a gyp-rebuild
), and it fails.
Is there any compilation option that should be set?
Upvotes: 4
Views: 1331
Reputation: 1589
I managed to fix the error by pulling the repo from github, editing bson.h
, and doing a node-gyp rebuild
on it.
Apparently, the error is caused by a compilation option which is not supported by ARM devices. Just in case anyone is interested:
https://github.com/mongodb/node-mongodb-native
./node-mongodb-native/node_modules/bson/ext/bson.h
#define USE_MISALIGNED_MEMORY_ACCESS
from 1
to 0
node-gyp rebuild
to recompile the library.This worked for me.
Upvotes: 3