jhead / node-svmq

Native System V message queues in Node.js
MIT License
19 stars 10 forks source link

Fatal error in ../deps/v8/src/objects.cc, line 3577 #6

Open berkevaroll opened 4 years ago

berkevaroll commented 4 years ago

Hi, thank you for the this IPC module. I have an issue with using it. I am trying communicate between my node server and a C program which is located in the same device. I am working with ARMv7 architecture. I am just trying to send a simple message to an id using your example code in readme. I am using Nodejs v8.11.4 and dont have npm in it. Getting packages with buildroot. So the issue is that I am getting this fatal error

# Fatal error in ../deps/v8/src/objects.cc, line 3577
# Check failed: receiver->IsJSFunction().

when I try to run this code:

var msg = svmq.msg;
var MSGMAX = svmq.MSGMAX;
var id = msg.get(1, 950);
msg.snd(id, new Buffer('Hello World!'), 1, (err) => {
    if (err) throw err;
});

Is that about being compatible with versions or that I am working on a embedded device. Thanks for all!(btw I am submitting an issue for the first time so if I did something wrong please tell.)

jhead commented 4 years ago

Hey @berkevaroll! Thanks for reaching out about this. The info you provided is very helpful.

Have you tried updating your version of Node to v8.17.0 -- the latest release of Node 8 available? I'm wondering if this issue has already been addressed, seeing as how you're using v8.11.4.

berkevaroll commented 4 years ago

Hi, thank you for contacting about this issue. No I havent tried to update it because we install packages with Buildroot(A software that compiles linux system with the configurations you make and with programs you choose if it has, if you dont know). So I think that the latest release that I can install in this device is the one I'm using right now without being sure. I will check to make sure of it. Also, after trying many solutions I decided to use the push function you made and it worked however I am sending a binary data inside a typedarray or a buffer to a C program. Message is being received via the message queue which has the id I gave but it adds a 4 bytes with the value of 1(00000001) in front of every message. Thank you, good work.

Have a nice weekend

On Sat, Sep 12, 2020, 22:02 Justin Head notifications@github.com wrote:

Hey @berkevaroll https://github.com/berkevaroll! Thanks for reaching out about this. The info you provided is very helpful.

Have you tried updating your version of Node to v8.17.0 -- the latest release of Node 8 available? I'm wondering if this issue has already been addressed, seeing as how you're using v8.11.4.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhead/node-svmq/issues/6#issuecomment-691531881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZRBM7XU6KSNU64R6ED6QTSFPASZANCNFSM4REYKBPQ .

jhead commented 4 years ago

Oh I just noticed the README snippet for msg.snd is incorrect; it's missing a parameter before the callback, which is causing your error. It should be:

var msg = svmq.msg;
var MSGMAX = svmq.MSGMAX;
var id = msg.get(1, 950);
var msgType = 1;
var flags = 0;
msg.snd(id, new Buffer('Hello World!'), msgType, flags, (err) => {
    if (err) throw err;
});

I'll update the README shortly.

Message is being received via the message queue which has the id I gave but it adds a 4 bytes with the value of 1(00000001) in front of every message.

I'm looking into this but I'm currently unable to reproduce it. This might be specific to your OS since each OS implements these queues differently. What OS and ARM architecture are you using on the device? I might be able to setup some unit tests to run in different environments to catch the bug.

berkevaroll commented 4 years ago

Thanks for looking it up so fast. I am using arm7 architecture and linux as OS but not a specisific dist i am afraid. Sorry im not with my computer so I can reply from phone as I can remember these things. I will also check it. And i also realized it gives a not declared error to the parameter of closing function under the msg.snd in the same page. Thanks

On Sat, Sep 12, 2020, 23:03 Justin Head notifications@github.com wrote:

Oh I just noticed the README snippet for msg.snd is incorrect; it's missing a parameter before the callback, which is causing your error. It should be:

var msg = svmq.msg;var MSGMAX = svmq.MSGMAX;var id = msg.get(1, 950);var msgType = 1;var flags = 0;msg.snd(id, new Buffer('Hello World!'), msgType, flags, (err) => { if (err) throw err;});

I'll update the README shortly.

Message is being received via the message queue which has the id I gave but it adds a 4 bytes with the value of 1(00000001) in front of every message.

I'm looking into this but I'm currently unable to reproduce. This might be specific to your OS since each OS implements these queues differently. What OS and ARM architecture are you using on the device? I might be able to setup some unit tests to run in different environments to catch the bug.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhead/node-svmq/issues/6#issuecomment-691538621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZRBM6LKRWEE2NHMCSWJG3SFPH2TANCNFSM4REYKBPQ .