Warnings reported with -Xcheck:jni when using Memory class
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- java
- Domaine
- operating-systems
Piste de recherche
Reproduisez le rapport avec le snippet Java fourni, OpenJDK 11.0.8, JNA 5.6.0 et -Xcheck:jni. Commencez par suivre Native.loadNativeDispatchLibraryFromClasspath et Memory.malloc dans Native.java et Memory.java ; le travail est terminé lorsqu’il est déterminé si les avertissements JNI signalés peuvent être éliminés et que le résultat est couvert par un test de régression.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
To reproduce, run the following snippet with -Xcheck:jni VM argument (I'm running with OpenJDK 11.0.8):
import com.sun.jna.Memory;
public class Test {
public static void main(String[] args) {
Memory m = new Memory(1024L);
System.out.println(m);
}
}
Observe output:
Warning: SIGINT handler expected:libjvm.so+0xc14f00 found:0x0000000000000001
Running in non-interactive shell, SIGINT handler is replaced by shell
Signal Handlers:
SIGSEGV: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGXFSZ: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0xc14d00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR2: [libjvm.so+0xc14b80], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: [libjvm.so+0xc14f00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGINT: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGTERM: [libjvm.so+0xc14f00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.so+0xc14f00], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
WARNING: JNI local refs: 33, exceeds capacity: 32
at java.lang.ClassLoader$NativeLibrary.load0([email protected]/Native Method)
at java.lang.ClassLoader$NativeLibrary.load([email protected]/ClassLoader.java:2442)
at java.lang.ClassLoader$NativeLibrary.loadLibrary([email protected]/ClassLoader.java:2498)
- locked <0x00000000ff401e20> (a java.util.HashSet)
at java.lang.ClassLoader.loadLibrary0([email protected]/ClassLoader.java:2694)
at java.lang.ClassLoader.loadLibrary([email protected]/ClassLoader.java:2627)
at java.lang.Runtime.load0([email protected]/Runtime.java:768)
at java.lang.System.load([email protected]/System.java:1837)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.jna.Memory.malloc(Memory.java:722)
at com.sun.jna.Memory.<init>(Memory.java:114)
at test.Test.main(Test.java:9)
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
at java.lang.ClassLoader$NativeLibrary.load0([email protected]/Native Method)
at java.lang.ClassLoader$NativeLibrary.load([email protected]/ClassLoader.java:2442)
at java.lang.ClassLoader$NativeLibrary.loadLibrary([email protected]/ClassLoader.java:2498)
- locked <0x00000000ff401e20> (a java.util.HashSet)
at java.lang.ClassLoader.loadLibrary0([email protected]/ClassLoader.java:2694)
at java.lang.ClassLoader.loadLibrary([email protected]/ClassLoader.java:2627)
at java.lang.Runtime.load0([email protected]/Runtime.java:768)
at java.lang.System.load([email protected]/System.java:1837)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.jna.Memory.malloc(Memory.java:722)
at com.sun.jna.Memory.<init>(Memory.java:114)
at test.Test.main(Test.java:9)
allocated@0x7ffff0510730 (1024 bytes)
Seen with jna-5.6.0.jar (latest I could find from maven: https://mvnrepository.com/artifact/net.java.dev.jna/jna).
Background:
We observe those warnings in our Eclipse based product (when checking for JNI problems with -Xcheck:jni), coming from SVN plug-ins:
WARNING in native method: JNI call made without checking exceptions when required to from CallStaticObjectMethod
at java.lang.ClassLoader$NativeLibrary.load0([email protected]/Native Method)
at java.lang.ClassLoader$NativeLibrary.load([email protected]/ClassLoader.java:2442)
at java.lang.ClassLoader$NativeLibrary.loadLibrary([email protected]/ClassLoader.java:2498)
- locked <0x00000005007d6730> (a java.util.HashSet)
at java.lang.ClassLoader.loadLibrary0([email protected]/ClassLoader.java:2694)
at java.lang.ClassLoader.loadLibrary([email protected]/ClassLoader.java:2627)
at java.lang.Runtime.load0([email protected]/Runtime.java:768)
at java.lang.System.load([email protected]/System.java:1837)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:761)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:736)
at com.sun.jna.Native.<clinit>(Native.java:131)
at com.sun.jna.Pointer.<clinit>(Pointer.java:41)
at org.tmatesoft.svn.core.internal.util.jna.SVNLinuxUtil.<clinit>(SVNLinuxUtil.java:33)
- Langage dominant
- Java
- Étoiles
- 8.9k
- Forks
- 1.7k
- Merge moyen
- 7 j 18 h
- PR mergées (30 j)
- 2
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de java-native-access/jna
-
MacFileUtils: FSPathMakeRef passes an int where the C function takes its FSRef output pointerPeut-être à nouveau libre @VelpulaGangavardhan l’a pris il y a 13 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 79/100
java-native-access/jna#1746 · 1 commentaire ·
-
User32: SetCursorPos is declared (long, long), but Windows declares (int, int)Peut-être pris @OKAN-SOFTWARE l’a pris il y a 8 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
java-native-access/jna#1745 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 43/100
java-native-access/jna#1752 ·
-
Update libffi to v3.8.0?Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 44/100
java-native-access/jna#1751 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
java-native-access/jna#1747 · 1 commentaire ·
Toutes les issues de java-native-access/jna
Issues similaires
-
Marketplace time-zone issueOuvertebug main ui
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
openhab/openhab-webui#4671 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
NearVanilla/IceCream#109 ·
Les mainteneurs répondent en général sous 1 jour
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
bancolombia/bin-stash#79 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour