SEGFAULT with uv_poll usage on low memory system

11 views
Skip to first unread message

Thomas Barusseau

unread,
Apr 20, 2017, 10:58:08 AM4/20/17
to v8-users
Hello,

I'm working with a printer device and overhauling some node.js code. Previously, communication was done with set interval reads, with writes in between.
I thought that it could be a good idea to implement a native C polling interface using node-gyp to compile a node.js-compatible addon.
However, I'm having run-time issues : SEGFAULT.

The SEGFAULT happens every time there is a Garbage Collection sweep. Starting node.js with the --expose-gc option and calling `global.gc()' causes an immediate crash.
Since the software turns on a low-capacity/low-power embedded Linux, and we don't have any debug symbols for node.js, I tried replicating it on my system, but I have 0 issue here.
The garbage collection is done, and the program continues to work as intended.

So... I'm kinda lost, and don't know what I'm doing wrong. My code is heavily inspired by the node's serialport module (also using libuv and the uv_poll methods).

You can find a full snippet of my program here : https://gist.github.com/Neph0/511fbd967300e231e91d5a9052c329b8

Any help would be greatly appreciated, I'm stuck on this.

-- 
Thomas
Reply all
Reply to author
Forward
0 new messages