InterruptedException at JVM exit due to cleaner

113 views
Skip to first unread message

Daniel Widdis

unread,
Oct 3, 2022, 1:35:35 AM10/3/22
to Java Native Access

While testing some code on AIX (JDK 17 on an OpenJ9 JVM), I got the following printed out on STDOUT as the program exited:

Oct 02, 2022 10:57:00 PM com.sun.jna.internal.Cleaner$1 run

SEVERE: null

java.lang.InterruptedException

        at java.base/java.lang.Object.wait(Native Method)

        at java.base/java.lang.Object.wait(Object.java:219)

        at java.base/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:138)

        at java.base/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:110)

        at com.sun.jna.internal.Cleaner$1.run(Cleaner.java:58)

 

Not a big deal as the program was exiting, but wondering if this is normal behavior for a daemon thread or if there’s anything that can be done to suppress that…

Daniel Widdis

unread,
Oct 3, 2022, 2:37:26 AM10/3/22
to jna-...@googlegroups.com

Looking into the code, it seems there is identical catch block behavior for an InterruptedException (expected at program exit) and any other exception.  A severe log with null message and stack trace is posted.

 

IMO the interrupt should be silently swallowed in this case.  

--
You received this message because you are subscribed to a topic in the Google Groups "Java Native Access" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jna-users/j0fw96PlOpM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jna-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/198f0dfd-d63f-4115-b320-12610557c318n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages