From owner-freebsd-java Wed Mar 12 18: 6:19 2003 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2BE0D37B404 for ; Wed, 12 Mar 2003 18:06:14 -0800 (PST) Received: from titan.kgt.co.jp (titan.kgt.co.jp [210.141.246.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56EEF43FDD for ; Wed, 12 Mar 2003 18:06:12 -0800 (PST) (envelope-from haro@kgt.co.jp) Received: from navgw.tt.kgt.co.jp (navgw [210.141.246.71]) by titan.kgt.co.jp (Postfix) with ESMTP id 0DD0C4A297; Thu, 13 Mar 2003 11:06:11 +0900 (JST) Received: from tt.kgt.co.jp (pegasus [192.168.10.1]) by navgw.tt.kgt.co.jp (Postfix) with ESMTP id DE33A47711; Thu, 13 Mar 2003 11:06:10 +0900 (JST) Received: from localhost [192.168.17.108] by tt.kgt.co.jp with ESMTP (SMTPD32-7.12) id A8B579F0148; Thu, 13 Mar 2003 11:11:01 +0900 Date: Thu, 13 Mar 2003 11:05:35 +0900 (JST) Message-Id: <20030313.110535.74756888.haro@kgt.co.jp> To: phantom@FreeBSD.org.ua, glewis@eyesbeyond.com Cc: freebsd-java@FreeBSD.ORG, sugimura@jp.FreeBSD.org Subject: Re: core dumped JDK 1.4.1 demo From: Munehiro Matsuda In-Reply-To: <20030312170902.A2112@phantom.cris.net> References: <20030312.234832.730610244.sugimura@jp.FreeBSD.org> <20030312170902.A2112@phantom.cris.net> X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, From: Alexey Zelkin Date: Wed, 12 Mar 2003 17:09:02 +0200 ::> Yesterday I made JDK 1.4.1p3 successfully, ::> but I cannot execute JDK demos using AWT or Swing. ::> ::> How can I help you to solve this problem? :: ::1. Post backtrace of core file generated on this error. :: ::2. Try 'java_g' instead of 'java', if it fails too, post one more backtrace. This problem has been reported before, and can happen both in jdk1.4.1-p3 and jdk1.3.1-p8 (with/without hotspot). See my old posting: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=594060+0+archive/2003/freebsd-java/20030209.freebsd-java Here are the known workarounds: 1. Unset XMODIFIERS environment variable before starting application. and/or 2. Setup malloc.conf as 'aj'. I think the problem is in open-motif-2.2.2 with XIM handling. I have been looking into the problem, but it's taken long time due to lack of my time and lack of experience with X Window programming. :-( Following are what I have found, so far. 1. Related lines in j2sdk1.3.1/src/solaris/native/sun/awt/awt_MToolkit.c are: 1813 frame = XtAppCreateShell("AWTColors", "XApplication", ....... 1831 text = XmCreateText(panel, "awtTextColor", args, argc); ....... 1947 XtDestroyWidget(frame); 2. Executing allocation of frame Widget in line 1813, content of frame pointer looks like this: (gdb) print *(CompositeWidget)frame $2 = {core = {self = 0x81c8800, widget_class = 0x2a49fde0, parent = 0x0, xrm_name = 1262, being_destroyed = 0 '\0', destroy_callbacks = 0x81cc960, constraints = 0x0, x = 0, y = 0, width = 0, height = 0, border_width = 0, managed = 0 '\0', sensitive = 1 '\001', ancestor_sensitive = 1 '\001', event_table = 0x81cc920, tm = {translations = 0x0, proc_table = 0x0, current_state = 0x0, lastEventTime = 0}, accelerators = 0x0, border_pixel = 0, border_pixmap = 2, popup_list = 0x0, num_popups = 0, name = 0x841571f "AWTColors", screen = 0x820af00, colormap = 32, window = 0, depth = 24, background_pixel = 16777215, background_pixmap = 2, visible = 1 '\001', mapped_when_managed = 1 '\001'}, composite = {children = 0x81c78d0, num_children = 1, num_slots = 2, insert_position = 0}} ^^^^^^^^^^^^^^^^^ Note that, ((CompositeWidget)frame)->composite->num_children is set to "1". 3. After allocation of text widget in line 1831, things looks different with XMODIFIERS environment variable set. (gdb) print *(CompositeWidget)frame $4 = {core = {self = 0x81c8800, widget_class = 0x2a49fde0, parent = 0x0, xrm_name = 1262, being_destroyed = 0 '\0', destroy_callbacks = 0x81d95a0, ..... mapped_when_managed = 1 '\001'}, composite = {children = 0x81c78d0, num_children = 2, num_slots = 2, insert_position = 0}} ^^^^^^^^^^^^^^^^^ As you can see, num_children has increased to "2". If XMODIFIERS is not, num_children will stay as "1". The increased composite widget looks like following, where you can see the "xmim_wrapper" name which indicates that it was allocated with in XmIm.c from open-motif. (gdb) print *((CompositeWidget)frame)->composite->children[1] $5 = {core = {self = 0x81cf580, widget_class = 0x2a5007a0, parent = 0x81c8800, xrm_name = 1651, being_destroyed = 0 '\0', destroy_callbacks = 0x0, constraints = 0x0, x = 0, y = 0, width = 10, height = 10, border_width = 1, managed = 0 '\0', sensitive = 1 '\001', ancestor_sensitive = 1 '\001', event_table = 0x0, tm = { translations = 0x0, proc_table = 0x0, current_state = 0x0, lastEventTime = 0}, accelerators = 0x0, border_pixel = 0, border_pixmap = 2, popup_list = 0x0, num_popups = 0, name = 0x81d57ff "xmim_wrapper", screen = 0x820af00, colormap = 32, window = 0, depth = 24, background_pixel = 16777215, background_pixmap = 2, visible = 1 '\001', mapped_when_managed = 1 '\001'}} 4. If I continue on from here, it will eventually dump core, as reported. But if I force num_children value back to "1", before calling XtDestroyWidget(frame) on line 1947, things run smoothly. (gdb) set *((CompositeWidget)frame)->composite->num_children = 1 Which indicates that, something is not cleaning up the extra child composite correctly. I think, this matches with the workaround that malloc.conf needs to be 'aj'. This is how far I got. Hope this helps, Haro =------------------------------------------------------------------------------ _ _ Munehiro (haro) Matsuda -|- /_\ |_|_| Business Incubation Dept., Kubota Corp. /|\ |_| |_|_| 1-3 Nihonbashi-Muromachi 3-Chome Chuo-ku Tokyo 103-8310, Japan Tel: +81-3-3245-3318 Fax: +81-3-3245-3315 Email: haro@kgt.co.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message