lsongdev / lsongdev/node-escpos

Closing the device results in nullpointer

Open
#393 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.6k
Forks
443
PR merge metrics
No merged PRs in 30d

Description

this.device = new escpos.USB();
this.device.close()

results in

npm run start[30776]: c:\ws\src\node_api.cc:1286: Assertion `(func) != nullptr' failed.
 1: 00007FF7AC75815F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114079
 2: 00007FF7AC6E54C6 DSA_meth_get_flags+65542
 3: 00007FF7AC6E5881 DSA_meth_get_flags+66497
 4: 00007FF7AC716A66 napi_release_threadsafe_function+166
 5: 00007FFBEF13CFF4 
 6: 00007FFBEF140EA1 
 7: 00007FFBEF140BF8
 8: 00007FF7AC724B9B node::Stop+36395
 9: 00007FF7ACFD63E6 v8::internal::Builtins::code_handle+172790
10: 00007FF7ACFD5FD9 v8::internal::Builtins::code_handle+171753
11: 00007FF7ACFD629C v8::internal::Builtins::code_handle+172460
12: 00007FF7ACFD6100 v8::internal::Builtins::code_handle+172048
13: 00007FF7AD0A9801 v8::internal::SetupIsolateDelegate::SetupHeap+494673
14: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
15: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
16: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
17: 00007FF7AD0390E9 v8::internal::SetupIsolateDelegate::SetupHeap+34105
18: 00007FF7AD139266 v8::internal::SetupIsolateDelegate::SetupHeap+1083062
19: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
20: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
21: 00007FF7AD0B3854 v8::internal::SetupIsolateDelegate::SetupHeap+535716
22: 00007FF7AD039EBC v8::internal::SetupIsolateDelegate::SetupHeap+37644
23: 00007FF7AD039ABB v8::internal::SetupIsolateDelegate::SetupHeap+36619
24: 00007FF7ACF1A5D1 v8::internal::Execution::CallWasm+1521
25: 00007FF7ACF1A71B v8::internal::Execution::CallWasm+1851
26: 00007FF7ACF1B125 v8::internal::Execution::TryCall+213
27: 00007FF7ACCC772D v8::internal::SourceTextModule::GetImportMeta+1165
28: 00007FF7ACCC579E v8::internal::SerializeStackFrameInfo+9790
29: 00007FF7ACCC7D28 v8::internal::SourceTextModule::GetImportMeta+2696
30: 00007FF7ACCC5309 v8::internal::SerializeStackFrameInfo+8617
31: 00007FF7ACD01637 v8::internal::JSPromise::status+3367
32: 00007FF7ACD0135C v8::internal::JSPromise::status+2636
33: 00007FF7AD0055EE v8::Module::Evaluate+526
34: 00007FF7AC71DE48 node::Stop+8408
35: 00007FF7ACFD63E6 v8::internal::Builtins::code_handle+172790
36: 00007FF7ACFD5FD9 v8::internal::Builtins::code_handle+171753
37: 00007FF7ACFD629C v8::internal::Builtins::code_handle+172460
38: 00007FF7ACFD6100 v8::internal::Builtins::code_handle+172048
39: 00007FF7AD0A9801 v8::internal::SetupIsolateDelegate::SetupHeap+494673
40: 00007FF7AD03BCAE v8::internal::SetupIsolateDelegate::SetupHeap+45310
41: 00007FF7AD06B983 v8::internal::SetupIsolateDelegate::SetupHeap+241107
42: 00007FF7AD0F1F92 v8::internal::SetupIsolateDelegate::SetupHeap+791522
43: 00007FF7AD05DBBA v8::internal::SetupIsolateDelegate::SetupHeap+184330
44: 00007FF7AD039DBB v8::internal::SetupIsolateDelegate::SetupHeap+37387
45: 00007FF7ACF1A5FB v8::internal::Execution::CallWasm+1563
46: 00007FF7ACF1A71B v8::internal::Execution::CallWasm+1851
47: 00007FF7ACF1B1CA v8::internal::Execution::TryCall+378
48: 00007FF7ACEF755A v8::internal::MicrotaskQueue::RunMicrotasks+410
49: 00007FF7ACEF72FA v8::internal::MicrotaskQueue::PerformCheckpointInternal+74
50: 00007FF7AC786822 node::CallbackScope::~CallbackScope+978
51: 00007FF7AC7864BE node::CallbackScope::~CallbackScope+110
52: 00007FF7AC676F1C std::basic_ostream<char,std::char_traits<char> >::operator<<+80092
53: 00007FF7AC675726 std::basic_ostream<char,std::char_traits<char> >::operator<<+73958
54: 00007FF7AC7B766B uv_async_send+331
55: 00007FF7AC7B6DFC uv_loop_init+1292
56: 00007FF7AC7B6F9A uv_run+202
57: 00007FF7AC785E05 node::SpinEventLoop+309
58: 00007FF7AC69DD13 v8::internal::Isolate::stack_guard+53827
59: 00007FF7AC71B38C node::Start+220
60: 00007FF7AC53894C RC4_options+348236
61: 00007FF7AD5A05D8 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+14472
62: 00007FFBF56654E0 BaseThreadInitThunk+16
63: 00007FFBF77C485B RtlUserThreadStart+43

Process finished with exit code 134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the shown escpos.USB setup and close call, then trace the USB device close path in the repository. Compare the shutdown behavior with the node_api.cc assertion in the report. Done means closing the device no longer aborts the Node.js process; add or run a regression test if the repository provides a relevant test location.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.