Internal Error (os_windows_x86.cpp:114)
David Holmes
David.Holmes at oracle.com
Mon Jun 14 01:00:36 PDT 2010
Hi Gili,
cowwoc said the following on 06/13/10 16:52:
> Hi David,
>
> On 13/06/2010 2:46 AM, David Holmes wrote:
>> cowwoc said the following on 06/13/10 16:39:
>>> Mystery solved. This had nothing to do with bytecode generation.
>>>
>>> It seems that any time a native method throws a std::exception (as
>>> opposed
>>> to using JNIEnv->Throw()) it causes the JVM to crash
>>
>> You can't expect the VM to deal with your C++ exceptions - which have
>> nothing to do with java exceptions, as indicated by JNIEnv->throw().
>
> It's one thing for the JVM to be unsophisticated about translating
> C++ exceptions to Java ones. It's a different matter for them to crash
> the entire VM (especially with this cryptic error message). Why doesn't
> Java simply wrap all native exceptions in a subclass of
> java.lang.Exception or java.lang.Error instead?
The simple answer is that JNI is a C interface not a C++ interface, so
there's no such thing as a "native exception" in JNI. It is up to the
application to ensure that C++ exceptions don't "leak" into the VM. In
this case this crash is telling you (somewhat obscurely) that the VM
received an unexpected exception and that it considers that a fatal error.
But there's always room for improvement, so I'll file a RFE. Though it's
not likely to be worked on by anyone in the near term.
David Holmes
More information about the hotspot-dev
mailing list