From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26438 invoked by alias); 11 Mar 2006 21:26:16 -0000 Received: (qmail 26422 invoked by uid 22791); 11 Mar 2006 21:26:15 -0000 X-Spam-Check-By: sourceware.org Received: from smtp5-g19.free.fr (HELO smtp5-g19.free.fr) (212.27.42.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Mar 2006 21:26:14 +0000 Received: from [10.0.0.4] (pcedev.com [82.234.81.179]) by smtp5-g19.free.fr (Postfix) with ESMTP id C35B224857; Sat, 11 Mar 2006 22:26:11 +0100 (CET) Message-ID: <44134075.80902@pcedev.com> Date: Sat, 11 Mar 2006 21:26:00 -0000 From: Olivier Jolly User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051017) MIME-Version: 1.0 To: Jeroen Frijters CC: mauve-discuss@sources.redhat.com, Mauve Patch List Subject: Re: runFinalization in Classloader.initialize doesn't run on cacao References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact mauve-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: mauve-discuss-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00059.txt.bz2 Jeroen Frijters a écrit : >Olivier Jolly wrote: > > >> while wandering around with Classloaders, I found that the teslet >>gnu.testlet.java.lang.Classloader.initialize wasn't running >>with Cacao. >>It seems that in the beginning of the test method, it creates an >>anonymous Classloader and then call System.gc() and >>System.runFinalization() and expects the finalizer to be ran to set a >>singleton like variable holder. >> While this is ok in jamvm and sun jre 1.5.0, cacao doesn't run the >>finalizer since runFinalization only gives a hint and not a mandatory >>order, so it is compliant. >> My question is whether I'm missing something and this way of doing >>brings something in this test or it could be rewritten in a >>simpler way, more compliant with the various jvm. >> >> > >I'm obviously not aware of an easier (or more robust) way to do this, or >I would have used it. However, this is a very important test (from a >security pov), so it has to be in. If Cacao can't or won't support >System.runFinalization(), I suggest skipping this test. > > > Ok, I feared something like this. However, the way this test is written seems very obscure (to me at least). Could you advise me why is the class loader created with an exception thrown in the constructor and then the reference to the semi-created instance is retrieved in the finalizer. And then I wonder why it then raises SecurityException instead of ClassFormatError. I reread about the finalizer semantic and the ClassLoader api without finding a clue. Thanks a lot in advance >Regards, >Jeroen > > > Olivier