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

node core dumps if 2nd argument is not a function #12

Open
mhirsch opened this issue Jun 22, 2021 · 1 comment
Open

node core dumps if 2nd argument is not a function #12

mhirsch opened this issue Jun 22, 2021 · 1 comment

Comments

@mhirsch
Copy link

mhirsch commented Jun 22, 2021

If the 2nd argument to gs.exec() is, for example, undefined, the node process segfaults. It seems like this should be handled more gracefully.

> gs.exec(['-sDEVICE=tiff24nc','-sOutputFile=test.tif','testPDF.pdf'])
undefined
> 

#
# Fatal error in , line 0
# Check failed: receiver.IsJSFunction().
#
#
#
#FailureMessage Object: 0x7fff54c0eff0
 1: 0x7f91dc74f199  [/lib64/libnode.so.83]
 2: 0x7f91dd41a03d V8_Fatal(char const*, ...) [/lib64/libnode.so.83]
 3: 0x7f91dcf9c278 v8::internal::JSReceiver::GetCreationContext() [/lib64/libnode.so.83]
 4: 0x7f91dcc49e09 v8::Object::CreationContext() [/lib64/libnode.so.83]
 5: 0x7f91dc622243 node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context) [/lib64/libnode.so.83]
 6: 0x7f91de8fdaf9 Nan::Callback::Call(int, v8::Local<v8::Value>*) const [/home/mhirsch/test-gs-js/node_modules/ghostscript-js/build/Release/ghostscriptjs.node]
 7: 0x7f91de8fdbfa ghostscript::HandleOKCallback() [/home/mhirsch/test-gs-js/node_modules/ghostscript-js/build/Release/ghostscriptjs.node]
 8: 0x7f91de8fd573 Nan::AsyncExecuteComplete(uv_work_s*, int) [/home/mhirsch/test-gs-js/node_modules/ghostscript-js/build/Release/ghostscriptjs.node]
 9: 0x7f91dcb3a1fb  [/lib64/libnode.so.83]
10: 0x7f91dcb3defe  [/lib64/libnode.so.83]
11: 0x7f91dcb50b3c  [/lib64/libnode.so.83]
12: 0x7f91dcb3e7f4 uv_run [/lib64/libnode.so.83]
13: 0x7f91dc71e586 node::NodeMainInstance::Run() [/lib64/libnode.so.83]
14: 0x7f91dc695859 node::Start(int, char**) [/lib64/libnode.so.83]
15: 0x7f91db9fcb75 __libc_start_main [/lib64/libc.so.6]
16: 0x56526a15512e _start [node]
Illegal instruction (core dumped)

@mhirsch mhirsch changed the title node Segmentation Fault if 2nd argument is not a function node core dumps if 2nd argument is not a function Jun 22, 2021
@rmeja
Copy link
Collaborator

rmeja commented Jun 22, 2021

Hello,
I just produced an update (v1.1.8) which fixes this issue. Tell me back if it's ok for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants