Node-serialport: Using SerialPort ends in Segmentation fault (Speicherzugriffsfehler)

Created on 9 Jan 2019  路  10Comments  路  Source: serialport/node-serialport

Summary of Problem

  • What are you trying to do?
    Using serialport for access the serial port.

  • What happens?
    A simple test program ends up in an error message Speicherzugriffsfehler ("segmentation fault").
    Other ports (e.g. ttyAMA0) produce the same error.

  • What should have happened?
    No error message / crash should occure.

Code to Reproduce the Issue

const SerialPort = require('serialport')
const port = new SerialPort('/dev/ttyUSB0', { baudRate: 256000 })

Versions, Operating System and Hardware

  • SerialPort@?7.1.2
  • Node.js v8.15.0
  • Linux HomeControl_Panel1 4.14.90-v7+ #1183 SMP Fri Dec 21 14:03:50 GMT 2018 armv7l GNU/Linux
  • Hardware and chipset? All (internal UART and CH341)
bug

All 10 comments

In the meanwhile, pierreroth64 postet the same issue. I can confirm, what he descriped. When i change to 6.2.2 everythink works.

Here is mine #1770

https://github.com/node-serialport/node-serialport/blob/8fc58a429bbc1483589897b9d3d497ffdaac16cf/packages/bindings/src/serialport_unix.cpp#L284

SIGSEGV happens at that line because ConnectionOptionsBaton inherits from Nan::AsyncResource (requiring a v8 isolate) and EIO_Open -> setup is called from a uv thread that doesn't have an associated isolate.

Downgrading to 6.2.2 it's ok. With 7.x.x it's broken.

I had the same problem. Tried different versions of Node (eg LTS, latest, 8.15, etc) with no change. Glad to see it is possible to roll back to an earlier version, but...

Same here, downgrading to 6.2.2 works

How does 7.1.0 work for you?

We should have this fixed later today btw #1772

415891c586f202f07006ba4f541c437cad2ba5d0 fixes the segfaults for me on a Raspberry Pi 3 running 32-bit Arch Linux ARM. :+1:

[email protected] has been relased with the fix. Sorry for the delay on this.

Was this page helpful?
0 / 5 - 0 ratings