I have a Java Swing Application interfacing with a third party shared library (DLL). The application crashes intermittently and when I inspect the crash dumps, i discover the crash occurred when attempting to access native code. See dump snippets below:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd32321fdc, pid=7692, tid=8816
Stack: [0x0000000014b00000,0x0000000014c00000], sp=0x0000000014bff2f0, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [ftrScanAPI.dll+0x61fdc]
j my.pkg.finger.futronic.FutronicScanner.close()Z+4
j my.pkg.finger.ks.captureImage(Ljavax/swing/JLabel;Lcom/sf/sfxfinger/sfs;)Ljava/awt/image/BufferedImage;+25
j my.pkg.sfxfinger.sfs.captureFingerImage(Ljavax/swing/JLabel;Lcom/sf/sfxfinger/sfs;)Ljava/awt/image/BufferedImage;+6
j my.pkg.sc.laf.panels.FingerprintCaptureDialog$5.doInBackground()Ljava/lang/Object;+370
j javax.swing.SwingWorker$1.call()Ljava/lang/Object;+14
j java.util.concurrent.FutureTask.run()V+42
j javax.swing.SwingWorker.run()V+4
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
V [jvm.dll+0x1cf7f3]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.Futronic.ScanApiHelper.Scanner.CloseDevice()Z+0
j my.pkg.finger.futronic.FutronicScanner.close()Z+4
j my.pkg.finger.ks.captureImage(Ljavax/swing/JLabel;Lcom/sf/sfxfinger/sfs;)Ljava/awt/image/BufferedImage;+25
j my.pkg.sfxfinger.sfs.captureFingerImage(Ljavax/swing/JLabel;Lcom/sf/sfxfinger/sfs;)Ljava/awt/image/BufferedImage;+6
j my.pkg.sc.laf.panels.FingerprintCaptureDialog$5.doInBackground()Ljava/lang/Object;+370
j javax.swing.SwingWorker$1.call()Ljava/lang/Object;+14
j java.util.concurrent.FutureTask.run()V+42
j javax.swing.SwingWorker.run()V+4
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+95
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
Is it possible to catch the exception thrown by the native code in my Java code?
NOTE: This library is a third party library which I do not have access to. Also, the crash behavior is very erratic. If it has to do with usage, my guess is that it will happen every time I try to use the device.