harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Popov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-4338) [drlvm][jvmti] JNI function NewStringUTF() invoked from Exception callback throws assertion `!is_unwindable()'
Date Fri, 06 Jul 2007 04:39:04 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ivan Popov updated HARMONY-4338:
--------------------------------

    Attachment: HY-4338.zip

I added ExceptionDescribe before calling to NewStringUTF, it does not detect any pending exception.
I noticed this happen only in callback for uncaught exception. For caught exception DRLVM
works fine.

I'm attaching test classes to reproduce this problem (you need to apply patches for HARMONY-2892
first). Here is test log on Linux (Windows does the same):

$ $HY_JDK/jre/bin/java -cp . -agentlib:jdwp=transport=dt_socket,server=y,onthrow=TestedException,launch=run.sh
TestCought
Throwing cought exception
 INFO: [TransportManager.cpp:203] transport is listening on 34639
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
>
Exception occurred: TestedException (to be caught at: TestCought.main(), line=6 bci=16)"thread=main",
TestCought.main(), line=5 bci=15
5                throw new TestedException();
 
main[1] cont
> TestedException
        at TestCought.main(TestCought.java:5)
 
The application exited
 
--------------------

$ $HY_JDK/jre/bin/java -cp . -agentlib:jdwp=transport=dt_socket,server=y,onthrow=TestedException,launch=run.sh
TestUncought
Throwing uncought exception
 INFO: [TransportManager.cpp:203] transport is listening on 34643
java: .../trunk/working_vm/vm/vmcore/src/util/vm_strings.cpp:345: _jobject* string_create_from_utf8_h(const
char*, unsigned int): Assertion `!is_unwindable()' failed.
SIGABRT in VM code.
Stack trace:
  0: ?? (??:-1)
  1: abort (??:-1)
  2: __assert_fail (??:-1)
  3: string_create_from_utf8_h(char const*, unsigned int) (.../trunk/working_vm/vm/vmcore/src/util/vm_strings.cpp:346)
  4: NewStringUTF(JNIEnv_External*, char const*) (.../trunk/working_vm/vm/vmcore/src/jni/jni.cpp:1159)
  5: JNIEnv_External::NewStringUTF(char const*) (.../trunk/working_vm/vm/include/jni.h:1441)
  6: jdwp::ThreadManager::CreateAgentThread(JNIEnv_External*, char const*) (../../common/agent/core/ThreadManager.cpp:291)
  7: jdwp::ThreadManager::RunAgentThread(JNIEnv_External*, void (*)(jvmtiEnv_struct*, JNIEnv_External*,
void*), void const*, int, char const*, _jobject*) (../../common/agent/core/ThreadManager.cpp:254)
  8: jdwp::EventDispatcher::Start(JNIEnv_External*) (../../common/agent/core/EventDispatcher.cpp:119)
  9: jdwp::AgentManager::Start(jvmtiEnv_struct*, JNIEnv_External*) (../../common/agent/core/AgentManager.cpp:88)
 10: jdwp::RequestManager::HandleException(jvmtiEnv_struct*, JNIEnv_External*, _jobject*,
_jmethodID*, long long, _jobject*, _jmethodID*, long long) (../../common/agent/core/RequestManager.cpp:992)
 11: jvmti_send_exception_event (.../trunk/working_vm/vm/vmcore/src/jvmti/jvmti_event.cpp:1421)
 12: jvmti_jit_exception_event_callback_call(ManagedObject*, JIT*, Method*, void*, JIT*, Method*,
void*) (.../trunk/working_vm/vm/vmcore/src/jvmti/jvmti_event.cpp:1531)
 13: exn_propagate_exception (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:404)
 14: exn_throw_for_JIT(ManagedObject*, Class*, Method*, unsigned char*, jvalue*) (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:470)
 15: exn_athrow(ManagedObject*, Class*, Method*, unsigned char*) (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:505)
 16: ?? (??:-1)
 17: TestUncought.main([Ljava/lang/String;)V (TestUncought.java:4)
<end of stack trace>
Aborted
 

> [drlvm][jvmti] JNI function NewStringUTF() invoked from Exception callback throws assertion
`!is_unwindable()'
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4338
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4338
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Windows/x86, Linux/x86, harmony-jdk-r551077
>            Reporter: Ivan Popov
>         Attachments: HY-4338.zip
>
>
> With patch for HARMONY-2892 JDWP agent is able to defer initialization until exception
is thrown and launch debugger on demand. patched agent works well on top on Sun JVM (even
with -Xcheck:jni), but fails with DRLVM. The problem is that JNI function NewStringUTF() throws
assertion `!is_unwindable()' when it is invoked from Exception callback while agent performs
deferred initialization. Here is stack trace:
> java: .../trunk/working_vm/vm/vmcore/src/util/vm_strings.cpp:345: _jobject* string_create_from_utf8_h(const
char*, unsigned int): Assertion `!is_unwindable()' failed.
> SIGABRT in VM code.
> Stack trace:
>   0: ?? (??:-1)
>   1: abort (??:-1)
>   2: __assert_fail (??:-1)
>   3: string_create_from_utf8_h(char const*, unsigned int) (.../trunk/working_vm/vm/vmcore/src/util/vm_strings.cpp:346)
>   4: NewStringUTF(JNIEnv_External*, char const*) (.../trunk/working_vm/vm/vmcore/src/jni/jni.cpp:1159)
>   5: JNIEnv_External::NewStringUTF(char const*) (.../trunk/working_vm/vm/include/jni.h:1441)
>   6: jdwp::ThreadManager::CreateAgentThread(JNIEnv_External*, char const*) (../../common/agent/core/ThreadManager.cpp:291)
>   7: jdwp::ThreadManager::RunAgentThread(JNIEnv_External*, void (*)(jvmtiEnv_struct*,
JNIEnv_External*, void*), void const*, int, char const*, _jobject*) (../../common/agent/core/ThreadManager.cpp:254)
>   8: jdwp::EventDispatcher::Start(JNIEnv_External*) (../../common/agent/core/EventDispatcher.cpp:119)
>   9: jdwp::AgentManager::Start(jvmtiEnv_struct*, JNIEnv_External*) (../../common/agent/core/AgentManager.cpp:88)
>  10: jdwp::RequestManager::HandleException(jvmtiEnv_struct*, JNIEnv_External*, _jobject*,
_jmethodID*, long long, _jobject*, _jmethodID*, long long) (../../common/agent/core/RequestManager.cpp:953)
>  11: jvmti_send_exception_event (.../trunk/working_vm/vm/vmcore/src/jvmti/jvmti_event.cpp:1421)
>  12: jvmti_jit_exception_event_callback_call(ManagedObject*, JIT*, Method*, void*, JIT*,
Method*, void*) (.../trunk/working_vm/vm/vmcore/src/jvmti/jvmti_event.cpp:1531)
>  13: exn_propagate_exception (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:404)
>  14: exn_throw_for_JIT(ManagedObject*, Class*, Method*, unsigned char*, jvalue*) (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:470)
>  15: exn_athrow(ManagedObject*, Class*, Method*, unsigned char*) (.../trunk/working_vm/vm/vmcore/src/exception/exceptions_jit.cpp:505)
>  16: ?? (??:-1)
>  17: HelloException.main([Ljava/lang/String;)V (HelloException.java:4)
> <end of stack trace>
> Aborted
> To reproduce this bug see instructions in HARMONY-2892 how to launch JDWP agent in this
mode.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message