adoptium / adoptium/adoptium-support
JVM crash in JNI code
- Dominant language
- No language data
- Stars
- 59
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
A JVM crash in some JNI code of Bonjour (the Apple MDNS implementation). I noticed it when trying to update to the newest Adoptium version.
## Steps to reproduce
Find attached a prebuilt jar which demonstrates the issue.
[bonjour.zip](https://github.com/adoptium/adoptium-support/files/9027374/bonjour.zip)
The code basically only initiates our self-built AiO java library (we had to fix an issue in the native code) for Bonjour (see: https://github.com/smartbow-gmbh/bonjour) and registers a example service in the network.
Details
```java
Path p = Files.createTempDirectory("libs");
DNSSDDllProvider.setDataDir(p);
try {
DNSSD.register("testService", "_test._tcp.", 6789, new RegisterListener() {
@Override
public void serviceRegistered(DNSSDRegistration registration, int flags, String serviceName, String regType, String domain) {
System.out.println("registered");
System.exit(0);
}
});
} catch (DNSSDException e1) {
e1.printStackTrace();
}
```
## Expected results
The example should not crash.
## Actual results

## Triaging info
Java version:
```
openjdk version "1.8.0_332"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_332-b09)
OpenJDK 64-Bit Server VM (Temurin)(build 25.332-b09, mixed mode)
```
What is your operating system and platform?
Windows 10 Enterprise on x86-64
How did you install Java?
I used the MSI installer for the latest Windows x64 JDK: https://adoptium.net/de/temurin/archive?version=8
Did you test with other Java versions?
Works with Oracle Java until version 1.8_251. Later versions produce the same crash.
I tried the oldest (jdk8u302-b08) and newest (jdk8u332-b09) versions of Adoptium. Both produce the crash.
Crash dump file: [hs_err_pid20628.log](https://github.com/adoptium/adoptium-support/files/9027564/hs_err_pid20628.log)
Contributor guide
Research direction
Start by running the attached bonjour.zip example on Windows 10 with the reported Adoptium Java 8 versions, then inspect hs_err_pid20628.log and compare with Oracle Java 8u251. Trace the DNSSD.register call and its native Bonjour/JNI boundary; done means the example registers its service without a JVM crash and the failure cause is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100