kura
kura copied to clipboard
SIGSEGV fatal error on USB device attach/detach with usb4java and oshi
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
- Compile and deploy this test bundle to Kura.
- Wait for the message
OshiTestService - SLEEP END
to be printed to console. - Attach or detach any USB device.
- 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
#
I have the same problem myself and it is quite serious. Can you please check it out?
@s-leo I cannot download the test bundle since it is private... Could you share it, so we can test on a device? Thanks!
@s-leo I cannot download the test bundle since it is private... Could you share it, so we can test on a device? Thanks!
my bad, I forgot to make it public. You should be able to see it now
@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...
Any news on the issue @pierantoniomerlino ?
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.