Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using SerialPort ends in Segmentation fault (Speicherzugriffsfehler) #1771

Closed
Maintraxx opened this issue Jan 9, 2019 · 10 comments
Closed
Labels

Comments

@Maintraxx
Copy link

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+ Install fails w/ Nodejs 8.x #1183 SMP Fri Dec 21 14:03:50 GMT 2018 armv7l GNU/Linux
  • Hardware and chipset? All (internal UART and CH341)
@Maintraxx
Copy link
Author

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

@pierreroth64
Copy link

Here is mine #1770

@nowakpl
Copy link
Contributor

nowakpl commented Jan 10, 2019

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.

@Ks89
Copy link

Ks89 commented Jan 10, 2019

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

@mmccool
Copy link

mmccool commented Jan 10, 2019

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...

@luccasmaso
Copy link

Same here, downgrading to 6.2.2 works

@reconbot
Copy link
Member

How does 7.1.0 work for you?

@reconbot
Copy link
Member

We should have this fixed later today btw #1772

@johnp789
Copy link

415891c fixes the segfaults for me on a Raspberry Pi 3 running 32-bit Arch Linux ARM. 👍

@reconbot
Copy link
Member

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

@reconbot reconbot added the bug label Jan 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

8 participants