Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JVM apparently hanging




Thanks again Greg....

I'd been running this a lot without the debugger, with the same hang, for quite a while before someone gave me the bright idea to try to attach the debugger (which happily worked), and gave me the good stack traces when I paused it.  Hadn't done a thread-dump though.

So I just did, no debugger involved.  Ran the program, it hung as it always has, did a kill -QUIT, and the stack I get is exactly the same as it was in the debugger.

So the question remains:  Why is java.lang.ClassLoader$NativeLibrary.load just sitting there?

Ongoing thanks for everyone's help...

-Eric


Greg Guerin <email@hidden>
Sent by: java-dev-bounces+eric_feigenson=email@hidden

05/02/2006 05:01 PM

To
email@hidden
cc
Subject
Re: JVM apparently hanging





Eric Feigenson wrote:

>And it actually worked.  I didn't think it would, only because the Java
>code is run via JNI calls, and the C/C++ program running everything
>generally traps signals.  But not SIGQUIT apparently.  Thank goodness.

It may be the JVM overrode a SIGQUIT handler previously installed.  It will
normally install several signal handlers, so it can catch TERM, INT, and
HUP to terminate properly (it triggers shutdown hooks).

The JVM option to suppress all these signal handlers is -Xrs.  In Terminal,
'java -X' by itself emits a brief summary.  For more info, read 'man java'
and look for the -Xrs option.  I also think there's some info in the JNI
reference guide about terminating a JVM cleanly when it doesn't have its
own signal handlers.


>So, the question now seems to be:  Why, in Thread-0, is
>java.lang.ClassLoader$NativeLibrary.load just sitting there (yes, I know
>it's shown as "suspended" in the stack trace, but that's just because it's
>paused in the debugger! Normally, it's running). What could it be waiting
>on?

It could just be waiting for you to hit "run" in the debugger.  Seriously.

I suggest running the program without the debugger, and without suspending
any threads.  If you still get a hang, then at that point you can still
issue 'kill -QUIT pid', which might then show you an actual deadlock.
Right now, the only deadlock I can see is self-induced because the debugger
has suspended a thread holding locks that other threads need to progress.

 -- GG

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: JVM apparently hanging (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.