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

Abort Trap: 6 on successive writes #1076

Closed
mikehall314 opened this issue Jan 23, 2017 · 3 comments
Closed

Abort Trap: 6 on successive writes #1076

mikehall314 opened this issue Jan 23, 2017 · 3 comments
Labels

Comments

@mikehall314
Copy link

SerialPort version: 5.0.0-beta3
NodeJS Version: 7.4.0
Operating System and Hardware Platform: macOS Sierra. Also observed on Ubuntu 16.04 (ia32)
Are you using an alternative NodeJS runtime? (eg Electron): Both vanilla node and Electron

Summary of Problem

Two successive writes to a thermal printer causes node to crash with Abort Trap: 6

Steps and Code to Reproduce the Issue

const SerialPort = require("serialport");
const port = new SerialPort("/dev/cu.usbserial", {baudRate: 9600}, _ => {
    port.write("Hello World\n");
    port.write("Hello World\n");
});

Expected result

Printer prints

   Hello World
   Hello World

Actual result

Printer prints

    Hello World

Then node crashes with the error Abort Trap: 6

@wilcoxky
Copy link

SerialPort version: 5.0.0-beta3
NodeJS Version: 6.9.2

Also having this problem code below:

const port = new SerialPort('/dev/tty.usbserial-FT9JAO38', {
  baudRate: 115200,
 });

const Readline = SerialPort.parsers.Readline;
const parser = port.pipe(new Readline());

parser.on('data', (data) => {
  console.log(data);
});

port.on('open', () => {
  console.log('Opened Port')
  write();
})

function write() {
  port.write('Hello', function () {
    port.drain();
  });
  port.write('World', function () {
    port.drain();
  });
}

Error:
Abort Trap: 6

@reconbot reconbot added the bug label Mar 3, 2017
@glumb
Copy link

glumb commented May 9, 2017

SerialPort version: 4.0.7
babel-node 6.11.4
macOS Sierra 10.12.4

Same issue when writing more than one time.

calling drain() as described here #660 (comment) fixed it.

@reconbot
Copy link
Member

reconbot commented Jul 6, 2017

This is probably fixed in serialport@5.0.0-beta6 I'm going to close this in favor of #1188 which is a duplicate but active issues to this one.

@reconbot reconbot closed this as completed Jul 6, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants