question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native code crashing

See original GitHub issue

Bug Description:

I recently upgraded to node-usb 2.5.*, and I started noticing that the native code was crashing my program when plugging in or unplugging hardware. I was able to debug it with VS and found it hit a call stack inside of PNP (plug and play) in native code.

Steps to Reproduce:

  1. Create a program where usb.on("attach") and usb.on("detach") is used.
  2. Run the program and disconnect or connect a board.
  3. Notice the failure.

Additional info: I downgraded to 2.4.3 and the issue went away. Exception: image

Call stack: image

Additional Information

  • Operating System: Windows 10
  • Runtime (node -v or electron -v): 16.13.1, node.
  • Node USB Version (npm ls usb): 2.5.1

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Julusiancommented, Sep 8, 2022

No, not something I’ve seen there, but the code here was written differently and with a newer api.

I have a theory, with a hopeful fix #541

0reactions
yooouuricommented, Oct 5, 2022

https://gist.github.com/yooouuri/5140bd9c806a98952aed455aa383f130 A crash report.

Im getting a

ProcessPlugPlayEventCallback Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ / 0xa31054a2

In my error handling service (Sentry)

image

image

Using node-usb 2.5.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Diagnosing Native Crashes | Android Open Source Project
The following sections include common types of native crash, an analysis of a sample crash dump, and a discussion of tombstones.
Read more >
5 Troubleshoot System Crashes - Java
In some cases a bug in a native library manifests itself as a crash in Java VM code. Consider the crash in the...
Read more >
Effects of Fatal Error - crash happened in native code
A fatal error has been detected by Java Runtime Environment. The crash happened outside the java virtual machine in native code. java ·...
Read more >
Unity Crashed!!Got a UNKNOWN while executing native code
Open Project -> crash. I am new to Unity, and cannot get started... Log: "Got a UNKNOWN while executing native code. This usually...
Read more >
Debugging Native Crashes in Android Apps | by Jackson Cheek
TL;DR — Native Crash Debugging Steps · Check for the bug on multiple device architecture types. · Decompile the . · Check that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found