Segmentation Fault - NodeJS v6.1.0 and AerospikeNodeJS v2.1.1
See original GitHub issueProblem
I have nodejs v6.1.0
and Aerospike NodeJS v2.1.1
and when I try to put a user , I get a Segmentation Fault
. What I tried are:
- I removed
node_modules
andnpm install
again - Running
npm rebuild
But nothing worked! I call my aerospike code from my test.
We are using redis
and we want to migrate to aerospike
and I don’t know that when these kind of problems show up to prevent.
Code
client.put(key, userProfile, function (err){
if(err){
throw err;
next(err);
}else{
console.log("@Ping/AerospikeService: new userRecord wrote:", userProfile);
next(null, "done "+ Aerospike.status.AEROSPIKE_ERR_RECORD_NOT_FOUND);
}
});
break;
Data
My userProfile
is a json object fetched from a mongoDB
:
{ _id: 577626aafa6164f014ad1708,
__v: 0,
memberships: { groups: [], boards: [] },
lastSeenSetting: { VIPList: [] },
statusSetting: { VIPList: [] },
pictureSetting: { VIPList: [] },
profileSettings: { exclude: [] },
sessionList:
[ { sessionToken: 'sessionTokenA-1',
deviceName: 'DeviceNameA',
lastLoginDate: 2016-07-01T08:15:38.076Z,
ipAddress: '127.0.0.1',
_id: 577626aafa6164f014ad1709 } ],
info:
{ id: 'userIdA',
username: 'username',
phoneNumber: '**********',
profilePhotoList: [],
status: { title: ':)) ', likes: 100 } },
id: '577626aafa6164f014ad1708' }
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Segmentation Fault · Issue #128 · aerospike ... - GitHub
Aerospike Node.js Client v2 no longer supports Node v0.10 due to incompatibilities ... I have nodejs v6.1.0 and aerospike node js lv2.1.1 ....
Read more >How to Debug Node.js Segmentation Faults - HTTP Toolkit
A segmentation fault occurs when a program attempts to access a memory location ... When Node.js itself has a bug somewhere, and segfaults...
Read more >Bug#922075: npm: segfault during extract on i386
I get a repeatable segfault from npm install by doing the following on ... npm WARN npm Supported releases of Node.js are the...
Read more >After upgrading Node, 'Segmentation fault (core dumped ...
I faced The same Issue just now, This because of conflicting the npm of node and nodejs. so remove nodejs by below commands...
Read more >Segmentation faults in rhsmd, subscription-manager
Issue. Found segmentation faults in rhsmd everyday according to the log. Lots of segmentation faults for subscription-manager , rhsmd and yum.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For future reference, here is a copy of the test script I used: https://gist.github.com/jhecking/d67e94162e4a1e2b1cfc3556700f9f8f
Great that you found a solution!
However, it’s unacceptable that the client generates a segfault, regardless of the record object being passed. It should return a regular error object in the callback function instead.
So I setup Mongo and mongoose to try to replicate the issue with a simplified test case. I created a simple document schema, created a new document for it, saved it to MongoDB using mongoose and read it back. The resulting JS object is much more complex than a simple JSON representation of the document. In fact, the actual document is stored in a
_doc
property in the object. But there are lots of other properties as well.Trying to store this Mondo model object into an Aerospike DB as is, resulted in various errors, due to unsupported Boolean or
undefined
property values and property names exceeding the max. bin name length (14). However I was not able to trigger a segfault, even after disabling a lot of the checks in the client code that guard against the previously encountered errors.