The first 5 messages are sent without problems, but at the 6th the program completely crashes - not in the way a Node.js program normally exits with an error, but it seems to be the interpreter itself crashing:
node: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long) old_end & pagemask) == 0)' failed.
Aborted
This is under Node v7.9.0 on a Raspberry Pi 3 running Raspbian GNU/Linux 8.0 (jessie).
The behavior is reproducible: it's always at the 6th message. The first five arrive correctly. I think my code is according to the instructions: at the start of the program it does
var svmq = require('svmq');
var inqueue = new svmq(55809);
var sendarray = new Uint8Array(16);
and after that, each time a message must be sent, sendarray is populated with the right data, after which this is run:
inqueue.push(Buffer.from(sendarray), {type: 3}, (err) => {
if (err) console.log('Error: '+err);
else console.log('Command put on the message queue');
});
The first 5 messages are sent without problems, but at the 6th the program completely crashes - not in the way a Node.js program normally exits with an error, but it seems to be the interpreter itself crashing:
This is under Node v7.9.0 on a Raspberry Pi 3 running Raspbian GNU/Linux 8.0 (jessie).
The behavior is reproducible: it's always at the 6th message. The first five arrive correctly. I think my code is according to the instructions: at the start of the program it does
and after that, each time a message must be sent,
sendarrayis populated with the right data, after which this is run: