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.

SIGSEGV fatal error on USB device attach/detach with usb4java and oshi

See original GitHub issue

Describe the bug A SIGSEGV fatal error occurs when USB devices get attached/detached and both the usb4java and oshi libraries are called, with usb4java being called first.

To Reproduce

  1. Compile and deploy this test bundle to Kura.
  2. Wait for the message OshiTestService - SLEEP END to be printed to console.
  3. Attach or detach any USB device.
  4. As Kura crashes, check the kura-console.log file for additional information.

Expected behavior Using both usb4java and oshi should not cause a SIGSEGV fatal error.

Target Environment

  • Kura 5.1.1 Intel UP2 Ubuntu 20 64bit (no network admin)
  • Ubuntu 20.04
  • Java 8 (OpenJDK 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07 )

Additional context Not sure who’s at fault here, but deploying the test bundle I linked above to another OSGi framework (tried with Apache Karaf) does not cause the issue, so I would exclude both oshi and usb4java from being at fault. Maybe the re-wrap of native libraries such as libudev by Kura is at fault? I noticed that usb4java makes use of libusb while oshi makes use of libudev, so I’m guessing something is going on with native libraries here.

Here’s the log of the crash (full log attached below):

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fec0d28fafe, pid=3378, tid=0x00007febf0479700
#
# JRE version: OpenJDK Runtime Environment (8.0_312-b07) (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07)
# Java VM: OpenJDK 64-Bit Server VM (25.312-b07 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x183afe]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /opt/eclipse/kura_5.1.1_intel-up2-ubuntu-20-nn/hs_err_pid3378.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

hs_err_pid3378.log

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pierantoniomerlinocommented, Aug 3, 2022

@s-leo I tried your test bundle also on a RPi3 with the same SIGSEGV. Without the bundle, indeed, the usb events are correctly caught and no crash accours. Definitely, more investigation is needed…

0reactions
pierantoniomerlinocommented, Oct 4, 2022

Hi @s-leo, sorry for the late reply. I should admit that I wasn’t able to find the cause of this issue… I’ve planned to come back to this as soon as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error SIGSEGV (0xb) at attaching/detaching usb devices #104
In runtime, when any USB device is connected, the JVM crashes due to SIGSEGV. # # A fatal error has been detected by...
Read more >
FAQ - usb4java
If usb4java crashes on Windows then please first of all make sure you have created a proper device driver as explained in the...
Read more >
[usb4java] JVM Crash (SIGSEGV/SIGACCERR)
A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at ... LOG.error("Unable to create a USB device...
Read more >
Claiming USB device on OS X with usb4java fails
usb.UsbPlatformException: USB error 3: Unable to claim interface: Access denied (insufficient permissions) at org.usb4java.javax.
Read more >
SIGSEGV (11)" when a session with XML source fails
While running a session with XML source, the session fails with the following error message in the session log: FATAL ERROR: Caught a...
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