You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by tingpeng wu <wu...@gmail.com> on 2008/03/25 15:29:06 UTC

[VMCore] assertation error in vm_shutdown_stop_java_threads()

Hi, all,
I have a question which needs your help. Method
vm_shutdown_stop_java_threads() has following statements:

    *jfieldID lock_field_id = jni_env->GetStaticFieldID(class_handle,
"lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
    assert(lock_field_id);*
**
Anyone can tell me the role of assertation statement here. If the
assertation error happens, what is the possible reason. Thanks.

Regards,
tingpeng

Re: [VMCore] assertation error in vm_shutdown_stop_java_threads()

Posted by tingpeng wu <wu...@gmail.com>.
Thanks for all your suggestion. We add some new process in JITrino, it has
some errors. Thougn we don't know the concrete reason, we have found the
error location in our added codes. Since it can run properly after
commenting some of our added codes. We will check our codes to find the
error. Thanks.

Regards,
tingpeng

2008/3/26, Ilya Berezhniuk <il...@gmail.com>:
>
> The reason of 'assert(lock_field_id)' assertion is checking the field
> presence in j.l.ThreadGroup class. It's done, for example, to prevent
> deleting the field from the Java source by mistake.
> I agree with Pavel, you probably use incorrect jar, thus ThreadGroup
> does not contain the 'lock' field.
>
> 2008/3/25, Pavel Pervov <pm...@gmail.com>:
> > It looks like you have invalid java/lang/ThreadGroup class in boot
> >  class path. Please, check that correct kernel.jar is available at
> >  jdk/jre/bin/default/kernel.jar.
> >
> >  Pavel.
> >
> >
> >  On 3/25/08, tingpeng wu <wu...@gmail.com> wrote:
> >  > Thanks, Alexei. The reason is (NULL !=
> >  > vm_thread->thread_exception.exc_object). Since we wasn't  familar
> with codes
> >  > here, maybe there are too many reasons which can cause exception. I
> wonder
> >  > if  we can infer something  from "lock" and
> >  >  "Ljava/lang/ThreadGroup$ThreadGroupLock" here, this way we can find
> the
> >  > reason with some direction.
> >  >
> >  > Regards,
> >  > tingpeng
> >  >
> >  > 2008/3/25, Alexei Fedotov <al...@gmail.com>:
> >  > >
> >  > > Hello, Ting Peng,
> >  > >
> >  > > You may find useful looking into jni/jni_field.cpp:87 [1]. The
> source
> >  > > for GetStaticFieldID shows that zero is returned when an exception
> is
> >  > > raised, field lookup failed, or the field is not static.
> >  > >
> >  > > Thanks.
> >  > >
> >  > > [1]
> >  > >
> http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?view=markup
> >  > >
> >  > > On Tue, Mar 25, 2008 at 5:29 PM, tingpeng wu <wutingpeng2@gmail.com
> >
> >  > > wrote:
> >  > > > Hi, all,
> >  > > >  I have a question which needs your help. Method
> >  > > >  vm_shutdown_stop_java_threads() has following statements:
> >  > > >
> >  > > >     *jfieldID lock_field_id =
> jni_env->GetStaticFieldID(class_handle,
> >  > > >  "lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
> >  > > >     assert(lock_field_id);*
> >  > > >  **
> >  > > >  Anyone can tell me the role of assertation statement here. If
> the
> >  > > >  assertation error happens, what is the possible reason. Thanks.
> >  > > >
> >  > > >  Regards,
> >  > > >  tingpeng
> >  > > >
> >  > >
> >  > >
> >  > >
> >  > > --
> >  > > With best regards,
> >  > > Alexei
> >  > >
> >  >
> >
> >
> >
> > --
> >  Pavel Pervov,
> >  Intel Enterprise Solutions Software Division
> >
>

Re: [VMCore] assertation error in vm_shutdown_stop_java_threads()

Posted by Ilya Berezhniuk <il...@gmail.com>.
The reason of 'assert(lock_field_id)' assertion is checking the field
presence in j.l.ThreadGroup class. It's done, for example, to prevent
deleting the field from the Java source by mistake.
I agree with Pavel, you probably use incorrect jar, thus ThreadGroup
does not contain the 'lock' field.

2008/3/25, Pavel Pervov <pm...@gmail.com>:
> It looks like you have invalid java/lang/ThreadGroup class in boot
>  class path. Please, check that correct kernel.jar is available at
>  jdk/jre/bin/default/kernel.jar.
>
>  Pavel.
>
>
>  On 3/25/08, tingpeng wu <wu...@gmail.com> wrote:
>  > Thanks, Alexei. The reason is (NULL !=
>  > vm_thread->thread_exception.exc_object). Since we wasn't  familar with codes
>  > here, maybe there are too many reasons which can cause exception. I wonder
>  > if  we can infer something  from "lock" and
>  >  "Ljava/lang/ThreadGroup$ThreadGroupLock" here, this way we can find the
>  > reason with some direction.
>  >
>  > Regards,
>  > tingpeng
>  >
>  > 2008/3/25, Alexei Fedotov <al...@gmail.com>:
>  > >
>  > > Hello, Ting Peng,
>  > >
>  > > You may find useful looking into jni/jni_field.cpp:87 [1]. The source
>  > > for GetStaticFieldID shows that zero is returned when an exception is
>  > > raised, field lookup failed, or the field is not static.
>  > >
>  > > Thanks.
>  > >
>  > > [1]
>  > > http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?view=markup
>  > >
>  > > On Tue, Mar 25, 2008 at 5:29 PM, tingpeng wu <wu...@gmail.com>
>  > > wrote:
>  > > > Hi, all,
>  > > >  I have a question which needs your help. Method
>  > > >  vm_shutdown_stop_java_threads() has following statements:
>  > > >
>  > > >     *jfieldID lock_field_id = jni_env->GetStaticFieldID(class_handle,
>  > > >  "lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
>  > > >     assert(lock_field_id);*
>  > > >  **
>  > > >  Anyone can tell me the role of assertation statement here. If the
>  > > >  assertation error happens, what is the possible reason. Thanks.
>  > > >
>  > > >  Regards,
>  > > >  tingpeng
>  > > >
>  > >
>  > >
>  > >
>  > > --
>  > > With best regards,
>  > > Alexei
>  > >
>  >
>
>
>
> --
>  Pavel Pervov,
>  Intel Enterprise Solutions Software Division
>

Re: [VMCore] assertation error in vm_shutdown_stop_java_threads()

Posted by Pavel Pervov <pm...@gmail.com>.
It looks like you have invalid java/lang/ThreadGroup class in boot
class path. Please, check that correct kernel.jar is available at
jdk/jre/bin/default/kernel.jar.

Pavel.

On 3/25/08, tingpeng wu <wu...@gmail.com> wrote:
> Thanks, Alexei. The reason is (NULL !=
> vm_thread->thread_exception.exc_object). Since we wasn't  familar with codes
> here, maybe there are too many reasons which can cause exception. I wonder
> if  we can infer something  from "lock" and
>  "Ljava/lang/ThreadGroup$ThreadGroupLock" here, this way we can find the
> reason with some direction.
>
> Regards,
> tingpeng
>
> 2008/3/25, Alexei Fedotov <al...@gmail.com>:
> >
> > Hello, Ting Peng,
> >
> > You may find useful looking into jni/jni_field.cpp:87 [1]. The source
> > for GetStaticFieldID shows that zero is returned when an exception is
> > raised, field lookup failed, or the field is not static.
> >
> > Thanks.
> >
> > [1]
> > http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?view=markup
> >
> > On Tue, Mar 25, 2008 at 5:29 PM, tingpeng wu <wu...@gmail.com>
> > wrote:
> > > Hi, all,
> > >  I have a question which needs your help. Method
> > >  vm_shutdown_stop_java_threads() has following statements:
> > >
> > >     *jfieldID lock_field_id = jni_env->GetStaticFieldID(class_handle,
> > >  "lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
> > >     assert(lock_field_id);*
> > >  **
> > >  Anyone can tell me the role of assertation statement here. If the
> > >  assertation error happens, what is the possible reason. Thanks.
> > >
> > >  Regards,
> > >  tingpeng
> > >
> >
> >
> >
> > --
> > With best regards,
> > Alexei
> >
>


-- 
Pavel Pervov,
Intel Enterprise Solutions Software Division

Re: [VMCore] assertation error in vm_shutdown_stop_java_threads()

Posted by tingpeng wu <wu...@gmail.com>.
Thanks, Alexei. The reason is (NULL !=
vm_thread->thread_exception.exc_object). Since we wasn't  familar with codes
here, maybe there are too many reasons which can cause exception. I wonder
if  we can infer something  from "lock" and
 "Ljava/lang/ThreadGroup$ThreadGroupLock" here, this way we can find the
reason with some direction.

Regards,
tingpeng

2008/3/25, Alexei Fedotov <al...@gmail.com>:
>
> Hello, Ting Peng,
>
> You may find useful looking into jni/jni_field.cpp:87 [1]. The source
> for GetStaticFieldID shows that zero is returned when an exception is
> raised, field lookup failed, or the field is not static.
>
> Thanks.
>
> [1]
> http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?view=markup
>
> On Tue, Mar 25, 2008 at 5:29 PM, tingpeng wu <wu...@gmail.com>
> wrote:
> > Hi, all,
> >  I have a question which needs your help. Method
> >  vm_shutdown_stop_java_threads() has following statements:
> >
> >     *jfieldID lock_field_id = jni_env->GetStaticFieldID(class_handle,
> >  "lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
> >     assert(lock_field_id);*
> >  **
> >  Anyone can tell me the role of assertation statement here. If the
> >  assertation error happens, what is the possible reason. Thanks.
> >
> >  Regards,
> >  tingpeng
> >
>
>
>
> --
> With best regards,
> Alexei
>

Re: [VMCore] assertation error in vm_shutdown_stop_java_threads()

Posted by Alexei Fedotov <al...@gmail.com>.
Hello, Ting Peng,

You may find useful looking into jni/jni_field.cpp:87 [1]. The source
for GetStaticFieldID shows that zero is returned when an exception is
raised, field lookup failed, or the field is not static.

Thanks.

[1] http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?view=markup

On Tue, Mar 25, 2008 at 5:29 PM, tingpeng wu <wu...@gmail.com> wrote:
> Hi, all,
>  I have a question which needs your help. Method
>  vm_shutdown_stop_java_threads() has following statements:
>
>     *jfieldID lock_field_id = jni_env->GetStaticFieldID(class_handle,
>  "lock", "Ljava/lang/ThreadGroup$ThreadGroupLock;");
>     assert(lock_field_id);*
>  **
>  Anyone can tell me the role of assertation statement here. If the
>  assertation error happens, what is the possible reason. Thanks.
>
>  Regards,
>  tingpeng
>



-- 
With best regards,
Alexei