From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10135 invoked by alias); 18 Feb 2010 20:41:11 -0000 Received: (qmail 10118 invoked by uid 22791); 18 Feb 2010 20:41:09 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f209.google.com (HELO mail-ew0-f209.google.com) (209.85.219.209) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Feb 2010 20:41:05 +0000 Received: by ewy1 with SMTP id 1so126094ewy.16 for ; Thu, 18 Feb 2010 12:41:03 -0800 (PST) Received: by 10.213.1.15 with SMTP id 15mr23801ebd.42.1266525663156; Thu, 18 Feb 2010 12:41:03 -0800 (PST) Received: from ?192.168.2.99? (cpc2-cmbg8-0-0-cust61.cmbg.cable.ntl.com [82.6.108.62]) by mx.google.com with ESMTPS id 28sm24348111eyg.12.2010.02.18.12.41.01 (version=SSLv3 cipher=RC4-MD5); Thu, 18 Feb 2010 12:41:02 -0800 (PST) Message-ID: <4B7DA9FA.1020307@gmail.com> Date: Thu, 18 Feb 2010 20:41:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: GCC Java CC: Dave Korn Subject: Two quick GC questions [was Re: [REVIVED: PATCH PR42811,4.5 regression] java.lang.ExceptionInInitializerError in ecj1] References: <4B6C9B26.3010106@gmail.com> <4B6D0C67.5030500@gmail.com> <4B78BA6D.5000603@gmail.com> <7230133d1002150504r23738e28if92303426c349661@mail.gmail.com> <4B7CC61E.1050709@gmail.com> <4B7D631B.8030401@gmail.com> In-Reply-To: <4B7D631B.8030401@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00004.txt.bz2 On 18/02/2010 15:56, Dave Korn wrote: >>> Running /gnu/gcc/gcc/libjava/testsuite/libjava.loader/loader.exp ... >>> FAIL: /gnu/gcc/obj-pr42811-3/i686-pc-cygwin/libjava/testsuite/TestEarlyGC.exe output - /gnu/gcc/obj-pr42811-3/i686-pc-cygwin/libjava/testsuite/TestEarlyGC.exe >> *sigh*, and it turns out to be because some memory is getting released by the >> garbage collector when its still in use. I'm busy trying to learn how the GC >> works real fast so I can figure out what's going wrong. Well, it turns out to be fairly straightforward: there is no code to register the .data and .bss sections of the main executable as static data regions with the GC, so it has no idea there's a live pointer to an object(*) in there, and happily frees it up. This leads me to two quick questions about the GC: 1- There's no call to GC_INIT anywhere under libjava/, and I can't find anything in boehm.cc that even looks suitable for the purpose. Does anyone know how the main exe's data/bss sections are supposed to get registered on a posixy system? 2- Libgcj statically links its own personal private copy of boehm-gc, rather than using a shared library; does anyone know why it was designed this way? > I'm now very sure that the problem is a side-effect of the libgcj DLL being > rebased at runtime, and not related to the clearing of memory in > _Jv_GetJVMTIEnv (which isn't even called in this testcase). This remains the case, btw. cheers, DaveK -- (*) - The object in question happens to be the jstring "C" passed as a name to defineClass, and next time through the loop it's been replaced by a hashmap object and defineClass throws when it finds it has the wrong object type as an argument.