Skip to content

Segmentation fault on multiple runs #47

@hamzashezad

Description

@hamzashezad

OS: macOS 10.14.5
Node version: 10.15.3
Ghostscript version: 9.27 (2019-04-04)
Electron version: 5.0.7
Ghostscript4js version: 3.1.1

I am converting postscript files to text files using the following:

gs.executeSync("-sDEVICE=txtwrite -dNOPAUSE -dQUIET -dBATCH \
    -sOutputFile=output.txt -sDEVICE=txtwrite input.ps");

It works the first time but my electron application crashes when I try to convert a second file.

The command runs fine on bash but gives a segmentation fault when I run it on Node REPL:

> const gs = require("ghostscript4js")
undefined
> gs.executeSync("-sDEVICE=txtwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=job1.txt -sDEVICE=txtwrite job-1.ps")
undefined
> gs.executeSync("-sDEVICE=txtwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=job2.txt -sDEVICE=txtwrite job-1.ps")
[1]    70491 segmentation fault  node

Note job2.txt was not created and it crashed after with a segmentation fault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions