Does Sun's Windows JVM catch Win32 Structured Exceptions?

Discussion in 'Java' started by Barney, Sep 2, 2004.

  1. Barney

    Barney Guest

    Hi

    I have a java program running on a windows platform which makes calls
    to an external product (dll, .NET) through JNI.

    In most cases where an exception is generated in the external code,
    the JVM catches it and exits with a mesage "an exception has occurred
    in native code outside the VM", and an hs_err_pid file is created.

    However, recently I have had cases where the VM exits abruptly, with
    no error message and no hs_err_pid file.

    After such a crash, by typing "echo %ERRORLEVEL" at the windows
    command prompt, the code -529697949 is reported. In hex, this is
    0xE06D7363, which from what I have read on the web indicates that the
    exception was generated within C++ code when a Win32 Structured
    Exception occured.

    So it is likely that the exception is occuring somewhere external dll.
    The java program's logs lend some support to this theory, but not
    conclusive support.

    It is possible that when the exception occurs, a C++ abort() is being
    called somewhere in the dll, or a dll underneath it.

    Another possibility that the exception is being thrown back to the
    JVM, but not handled here, causing the abrupt crash. Does Sun's
    Windows JVM catch Win32 Structured Exceptions?

    Ta,

    Barney
     
    Barney, Sep 2, 2004
    #1
    1. Advertising

  2. On 2 Sep 2004 00:45:44 -0700, Barney wrote:
    > I have a java program running on a windows platform which makes
    > calls to an external product (dll, .NET) through JNI.
    >
    > In most cases where an exception is generated in the external code,
    > the JVM catches it and exits with a mesage "an exception has
    > occurred in native code outside the VM", and an hs_err_pid file is
    > created.
    >
    > However, recently I have had cases where the VM exits abruptly, with
    > no error message and no hs_err_pid file.
    >
    > After such a crash, by typing "echo %ERRORLEVEL" at the windows
    > command prompt, the code -529697949 is reported. In hex, this is
    > 0xE06D7363, which from what I have read on the web indicates that
    > the exception was generated within C++ code when a Win32 Structured
    > Exception occured.


    Most likely these are not exceptions invoked explicitely by the native
    code, rather they are caused by errors in the code and caught by the
    operating system, which then kills the process.

    Typically, attempting to read or write memory that you had no business
    accessing will cause the JVM to crash in the manner you describe. Look
    for things like sloppy use of pointers, uninitialized variables, etc.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Sep 2, 2004
    #2
    1. Advertising

  3. Barney

    Chris Uppal Guest

    Barney wrote:

    > It is possible that when the exception occurs, a C++ abort() is being
    > called somewhere in the dll, or a dll underneath it.


    You may be able to get more information by running your Java program under the
    control of a (non-java) debugger. E.g. start the windows executable program,
    java.exe, under VC++. That should catch and halt at abort() or uncaught
    Windows exception, and you may be able to work something out from the stack
    trace and list of threads. It's a bit of a long shot, mind. You stand a
    marginally better chance of tracking it down if you have the "symbol" files for
    your windows version installed too (you can get them from MS site).

    -- chris
     
    Chris Uppal, Sep 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Hooke

    Re: Handling both MS JVM and Sun JVM

    Kevin Hooke, Aug 26, 2003, in forum: Java
    Replies:
    2
    Views:
    879
  2. Lasse
    Replies:
    1
    Views:
    700
    Jon A. Cruz
    Jan 5, 2004
  3. Young-Jin Lee

    MS JVM and Sun JVM problem

    Young-Jin Lee, Jan 20, 2004, in forum: Java
    Replies:
    3
    Views:
    575
    Mickey Segal
    Jan 21, 2004
  4. Replies:
    0
    Views:
    2,885
  5. George2
    Replies:
    4
    Views:
    406
    Mike Smith
    Jan 28, 2008
Loading...

Share This Page