Menu

JVM crashes using java 7

Help
Jens B.
2012-10-19
2015-01-10
  • Jens B.

    Jens B. - 2012-10-19

    Hey chris,

    we are using DJ Native since 3 years but have problems with Java 6 and 7 after switching to
    latest version DJNativeSwing-SWT-1-0-2-20120308.

    First some infos and explanations.

    Operating machines: Windows 7, 64 bit and 32 bit

    JRE: 6, 32 bit on 50 machines

    latest version of Native Swing:

    DJNativeSwing.jar
    DJNativeSwing-SWT.jar
    DJNativeSwing-SWTDemo.jar
    jna-3.2.4.jar
    jna_WindowUtils.jar
    swt-3.7M5-win32-win32-x86.jar

    Using this configuration we had trouble (freezing problems) on the 64 bit machines
    and sometimes (dayly, weekly or monthly) generated hs_err_pid files.

    Stack: [0x00300000,0x00350000], sp=0x0034f3c8, free space=316k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [jvm.dll+0x133d0a]
    V [jvm.dll+0x12e94d]
    V [jvm.dll+0x1094d0]
    V [jvm.dll+0x11712e]
    V [jvm.dll+0x2b9b]
    V [jvm.dll+0x91bf8]
    C [swt-win32-3721.dll+0x116c] Java_org_eclipse_swt_internal_Callback_reset+0xe5
    C 0x003f018f
    C [ole32.dll+0x8ee0d] CoRevokeClassObject+0x33e
    ...
    C [ole32.dll+0x488e8] SetErrorInfo+0x75
    C [swt-win32-3721.dll+0xc10c] Java_org_eclipse_swt_internal_win32_OS_OleUninitialize+0x6
    j org.eclipse.swt.widgets.Display.releaseDisplay()V+607
    j org.eclipse.swt.widgets.Display.release()V+154
    j org.eclipse.swt.graphics.Device.dispose()V+50
    j chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.destroyControls()V+104

    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j org.eclipse.swt.internal.win32.OS.OleUninitialize()V+0
    j org.eclipse.swt.widgets.Display.releaseDisplay()V+607
    j org.eclipse.swt.widgets.Display.release()V+154
    j org.eclipse.swt.graphics.Device.dispose()V+50
    j chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.destroyControls()V+104
    j chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.access$4()V+0
    j chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess$CMN_destroyControls$1.run()V+0
    J org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Z)Z
    J org.eclipse.swt.widgets.Display.readAndDispatch()Z
    J chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface$OutProcess.runNativeSide([Ljava/lang/String;)V
    j chrriis.dj.nativeswing.swtimpl.core.SWTNativeInterface.main_([Ljava/lang/String;)V+1
    j chrriis.dj.nativeswing.swtimpl.NativeInterface.main([Ljava/lang/String;)V+7

    OS: Windows 7 Build 7601 Service Pack 1
    CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, tsc
    Memory: 4k page, physical 3110020k(839764k free), swap 6218288k(3786988k free)
    vm_info: Java HotSpot(TM) Client VM (23.3-b01) for windows-x86 JRE (1.7.0_07-b10), built on Aug 28 2012 19:49:22 by "java_re" with unknown MS VC++:1600

    One week ago I changed the JRE 6 up to 7 on 10 machines.

    and also I had to change the SWT lib because your released SWT lib caused massive freezing problems.
    The users had to cancel the application process and to restart the application.

    SWT version is now: swt-4.2.1-win32-win32-x86

    Now it "seems" that the JRE 7 running clients have less or no problems...don't know it exact...
    7 days of testing is to short. No generated hs_err_pid file till now.
    I was happy about this.....

    But now and finally my question.......

    I'm developing all with Netbeans and jdk 6.
    Yesterday I switched to jdk 7 and nearly every 4th time when I test the application and close the main frame
    a hs_err_pid file is generated. Sometimes also at run time.

    Now I'm confused and it gives me a headache.
    I also tried using NativeInterface.close() or switching to your released swt version,
    no difference.
    I become scared that when switching all client 6 JRE's to 7 side effects come in play up to new application freezing...system crashing....

    Any idea what I can do to avoid these jvm crashes.
    I have no idea about swt so any help would be fine.
    We don't use the platform of netbeans, no RCP, so the libs lay simple in the lib folder.

    Jens

     
  • Christopher Deckers

    Hi Jens,

    Native crashes are either due to bugs in the JVM (very rare), SWT (rare) or to the native runtime (Internet Explorer).

    Using SWT 4.2 fixes several issues present in the version that I ship (but I am waiting for Java 7 bug fixes on Mac before updating SWT).

    Java 7 has some bug fixes but because of certain internal changes also has certain instabilities (focus issues when printing a component, etc.), so depending on the capabilities you use you should favor one Java version upon another. I wish the situation stabilizes but this is the status as of now. In any case, these changes do not result in VM crashes as far as I know.

    About native runtime, you have to see what version of Internet Explorer is used on the systems that are unstable. You could also give a try of using a 32 VM (which would use a 32bit version of Internet Explorer) to see if it is more stable.

    Hope this helps,
    -Christopher

     
  • Keven

    Keven - 2013-01-03

    Hi Chris,

    I have also problems with Java 1.7. I am using DJNativeSwing to integrate a Flash Player in a Java Web Start Application.
    My Settings are:
    MAC OS X 10.7.5
    java 1.7.0_05
    swt-4.2.1
    DJNativeSwing-SWT-1-0-2-20120308

    Each time I try to call the load method on a JFlashPlayer object the java VM craches with the following error message. I have the same problem when I try to run to Flash examples in the demo application under java 1.7.

    2012-12-18 15:52:49.377 java[90804:707] Cocoa AWT: Apple AWT Java VM was loaded on first thread -- can't start AWT. (
    0 liblwawt.dylib 0x000000015f723ad0 JNI_OnLoad + 468
    1 libjava.dylib 0x000000010b3a46f1 Java_java_lang_ClassLoader_00024NativeLibrary_load + 207
    2 ??? 0x000000010b3f6f90 0x0 + 4483674000
    3 ??? 0x000000010b3eb158 0x0 + 4483625304
    4 ??? 0x000000010b3eb450 0x0 + 4483626064
    )
    _NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib
    JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit

    Thanks,
    Keven

     
  • Christopher Deckers

    Hi Keven,

    There is a problem with Java 7 on Mac. Since they decided to use OpenJDK from Java 7 onwards, DJ Native Swing is broken. This problem is known and Oracle, Mac JRE developers and SWT developers are working on it. As far as I know, Java 7u12 should contain their fix so I am eagerly waiting for it.

    Hope this helps,
    -Christopher

     
  • Patrick TALBOT

    Patrick TALBOT - 2013-01-04

    Hi Chris, I also have clients complaining about Java 7 on Mac with DJNAtiveSwing, could you elaborate on these bugs and maybe point us to the relevant bug trackers so that we can maybe vote/check out on these issues?
    Thanks,
    -Patrick

     
  • Christopher Deckers

    Hi Patrick,

    The Mac JRE implementation is being replaced by Open JDK from Java 7, but Open JDK did not have a way to get the native handle of the Canvas.
    The first step is to get the Open JDK implementation to have a similar mechanism as was present in the Mac JRE (AWT team), then to get SWT to adapt to the OpenJDK implementation (SWT team), and then check that there is nothing else broken with Java 7 on the Mac.

    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7154778
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=374199

    Hope this helps,
    -Christopher

     
  • Keven

    Keven - 2013-04-02

    Hi Chris,
    is there anything new about Java7 support on Mac?
    Thanks

     
  • Christopher Deckers

    Hi Keven,

    The fix is part of Java 8. It is supposed to be backported to Java 7, but I haven't seen a non-security-related release so I guess it is not there yet.

    Hope this helps,
    -Christopher

     
  • chipu

    chipu - 2015-01-07

    Hi Chris,
    I still can reproduce the crash with Mac 10.9.5 and Java 8u25.
    It works properly for windows
    I am using DjNativeSwing 1.0.3-20140708 (and the SWT jar as well), jna 4.0.0, jna_windowsUtils.jar from the distribution zip.
    Do you have any further news about this?
    Thanks for this great software

     
  • Christopher Deckers

    Hi,

    Unfortunately, news is not very good about this issue. Read comments 7 to 9 of this bug:
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=418245

    I don't think this will get fixed any time soon unless someone provides a patch for SWT. But finding a solution to this issue seems very difficult (incompatibility between toolkits).

    Hope this helps,
    -Christopher

     

Log in to post a comment.