From owner-freebsd-java Thu May 18 21:25:10 2000 Delivered-To: freebsd-java@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id B824D37BDE1 for ; Thu, 18 May 2000 21:25:02 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id WAA25319; Thu, 18 May 2000 22:25:01 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id WAA28735; Thu, 18 May 2000 22:25:00 -0600 (MDT) (envelope-from nate) Date: Thu, 18 May 2000 22:25:00 -0600 (MDT) Message-Id: <200005190425.WAA28735@nomad.yogotech.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Sean Reilly Cc: freebsd-java@FreeBSD.ORG Subject: Re: problem in 1.1.8 In-Reply-To: References: X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I'm running into a problem on 4.0-RELEASE with the 1.1.8 JDK port. My > program freezes shortly after startup while trying to load an image as a > splash window. Hitting Ctrl-\ results in the thread dump below. Is the > X11Graphics.finalize supposed to be called from within String. or am > I reading this wrong? "finalize" should *NEVER* be called from external threads, and is the domain of the GC thread. Are you calling finalize by hand? > Any insight as to how I can avoid this is appreciated. See above. How are you loading the image? Can you give a bit more details as to what exactly the program is doing. > ^\SIGQUIT 3* quit > > Full thread dump: > sun.awt.AWTFinalizer.run(AWTFinalizer.java:40) > "Image Animator 0" (TID:0x2869aab0, sys_thread_t:0x29507f00, state:MW) > prio=3 > sun.awt.image.ImageDecoder.close(ImageDecoder.java:163) Image Animator 0 is callig close and is waiting on the monitor. > "main" (TID:0x2866f0b0, sys_thread_t:0x8124a00, state:MW) prio=5 > sun.awt.motif.X11Graphics.finalize(X11Graphics.java:109) > java.lang.String.(String.java) > java.io.DataInputStream.readUTF(DataInputStream.java) > java.io.DataInputStream.readUTF(DataInputStream.java) And the main thread is calling finalize, which is weird. > sun.awt.image.GifImageDecoder@2869AE78/286FB0E8: owner "Image Animator > 0" (0x29507f00, 1 entry) > sun.awt.motif.MToolkit@286900B0/286DDD28: > Waiting to be notified: > "AWT-Motif" (0x294e4f00) > java.lang.Class@28699CD0/286F5140: owner "AWT-EventQueue-0" > (0x294a2f00, 1 entry) > java.lang.Class@2869AE80/286FB070: owner "Image Animator 0" > (0x29507f00, 1 entry) > java.lang.Class@28699EB8/286F58C8: owner "main" (0x8124a00, 1 entry) > sun.awt.AWTFinalizer@2869AFC8/286DE6B0: > Waiting to be notified: > "AWT-Finalizer" (0x29528f00) > (0x29452f00): > Waiting to be notified: > "Async Garbage Collector" (0x29452f00) Interesting. Why is readObject() calling the GC? You're not making any explicity calls to the garbage collector, are you? > Registered Monitor Dump: > Thread queue lock: > Name and type hash table lock: > String intern lock: > JNI pinning lock: > JNI global reference lock: > BinClass lock: > Class loading lock: owner "AWT-EventQueue-0" (0x294a2f00, 1 entry) > Waiting to enter: > "main" (0x8124a00) > "Image Animator 0" (0x29507f00) Ahh, this is a clue. It turns out that there are races in the Java imaging code (which is a complete mess), and you may have stumbled on them. Sometimes moving the code around and/or adding sleeps in places causes the races to go away. *ESPECIALLY* when dealing with object serialization. You aren't using any static class locks by chance are you? ie; class foo { static synchronized void foo() { // Do something in here. } Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message