Closed recke96 closed 4 years ago
Hi. Can you try out the latest develop-SNAPSHOT version to see if it fixes the issue?
No the problem persists. Test program (kotlin):
fun main() {
val service = HidManager.getHidServices()
// service.start()
val disc = service.getHidDevice(0x17b5, 0x10, null)
if (disc != null) {
val vendor = disc.getIndexedString(0x01)
val product = disc.getIndexedString(0x02)
println("Vendor: $vendor, Product: $product")
} else {
println( "Not attached" )
}
// service.shutdown()
}
Output shows that the error persists and some other error:
Vendor: L, Product: M
java: io.c:2146: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
I'm on Linux 5.7.6-arch1-1 (ArchLinux) with Java version
openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode)
If I use the commented start
shutdown
calls the program crashes with SIGSEV:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f7de408e78b, pid=1135265, tid=1135294
#
# JRE version: OpenJDK Runtime Environment (14.0.1+7) (build 14.0.1+7)
# Java VM: OpenJDK 64-Bit Server VM (14.0.1+7, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C [libusb-1.0.so.0+0xb78b]
[error occurred during error reporting (printing problematic frame), id 0xb, SIGSEGV (0xb) at pc=0x00007f7e15e56b1d]
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /path/to/project/core.1135265)
#
# An error report file with more information is saved as:
# /path/to/project/hs_err_pid1135265.log
free(): invalid pointer
this is using the develop-SNAPSHOT from https://raw.github.com/bitcoin-solutions/mbhd-maven/master/snapshots
Using the device.manufacturer
and device.product
functions (converted to kotlin properties) yields the correct result but the other error is still there:
Vendor: Lunatone, Product: MFT Sensor
java: io.c:2146: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
also getIndexedString
in the hidapi for linux seems to return an error by default? Linux hid.c
Hmm, that SIGSEV issue looks very similar to a different issue. Can you verify that you're using the latest develop-SNAPSHOT
from Maven Central? It should be dated 1st July 2020 at the time of writing.
also getIndexedString in the hidapi for linux seems to return an error by default? Linux hid.c
That code is in the Linux hid.c but the library for Linux is built using the libusb/hid.c which does provide a return value. The cross-compiler environment fails if libudev-dev libusb-1.0-0-dev
are not present.
this is using the develop-SNAPSHOT from https://raw.github.com/bitcoin-solutions/mbhd-maven/master/snapshots
I used this repository. There is no develop-SNAPSHOT in maven central?
Ah, you might not have enabled Maven snapshot versions in your project's pom.xml. Here's a link to the relevant section in the README. You'll need to delete the <url>
entry (I'll update the README to correct this now).
Do you know how to do this in gradle? Can't find the snapshots setting in the repository declarations
I've updated the README with Gradle configuration information. Can you let me know if this resolves the issue?
I think this is fixed, but I'm going to bump this into 0.7.0 release.
Given that 0.6.0 has been released and fixed a lot of SIGSEV issues I'm going to close this issue.
I'm trying to get a usb-device running in a java application which has only a proprietary windows/mac application. It reports itself as
[path=00xx:00xx:xx, vendorId=0x17b5, productId=0x10, serialNumber=000043C7, releaseNumber=0x106, manufacturer=Lunatone, product=MFT Sensor, usagePage=0x0, usage=0x0, interfaceNumber=0]
.Currently I'm just playing around since I don't know what I have to send to the device but
getIndexedString
seems to only return the first character.getIndexedString(0x01)
returnsL
but capture showsLunatone
getIndexedString(0x02)
returnsM
but capture showsMFT Sensor
also if the program continues running this produces a SIGSEV