Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 57358 invoked from network); 11 Aug 2006 14:03:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Aug 2006 14:03:44 -0000 Received: (qmail 98551 invoked by uid 500); 11 Aug 2006 14:03:38 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 98500 invoked by uid 500); 11 Aug 2006 14:03:38 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 98483 invoked by uid 99); 11 Aug 2006 14:03:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 07:03:38 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of gshimansky@gmail.com designates 66.249.82.230 as permitted sender) Received: from [66.249.82.230] (HELO wx-out-0506.google.com) (66.249.82.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 07:03:37 -0700 Received: by wx-out-0506.google.com with SMTP id s13so699540wxc for ; Fri, 11 Aug 2006 07:03:16 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=tKhn/P9EeJhM0MffYVnK21/rl8uhrh1jCw4BJ46/APz93LmNUGlj5yDMlFcIElYM3oGh8ezgTmAP3DXQ/IJ43Pk/DlCeYUc7oMVgUke/VTYZX1Tfhbkfd3xuKo8UyHjQO+RJQ+Ogjz+LKir/aa4+clIUwY648dD0E1cozRS62Po= Received: by 10.70.50.18 with SMTP id x18mr5185958wxx; Fri, 11 Aug 2006 07:03:15 -0700 (PDT) Received: by 10.70.21.3 with HTTP; Fri, 11 Aug 2006 07:03:14 -0700 (PDT) Message-ID: <208da7a50608110703s54802354xbd5841c6e60e5c5@mail.gmail.com> Date: Fri, 11 Aug 2006 18:03:14 +0400 From: "Gregory Shimansky" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader In-Reply-To: <7273946b0608102131r6a7ae4b9r8f3a5c0766fb9009@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_43595_28551770.1155304994475" References: <44D48DC3.6070206@pobox.com> <44D79C19.2080700@pobox.com> <200608080129.47724.gshimansky@gmail.com> <44D7B854.4090900@pobox.com> <44DB5B51.5010909@pobox.com> <7273946b0608102131r6a7ae4b9r8f3a5c0766fb9009@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_43595_28551770.1155304994475 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I think I've fixed this a few days ago and attached the patch to JIRA. See my emails in this thread. Does it fix the problem with verifier for you? The problem with verifier is only the first one with activemq. After I fixed the exception problem the app still didn't start up. 2006/8/11, Vladimir Ivanov : > > Seems, that drlvm rejects valid code when 'end_pc' value for exception > handler is equal to code array length. > At least, when I update value for 'end_pc' in my simple class it was > rejected by drlvm and accepted by RI. > > Thanks, Vladimir > > More details: > 2 class attached: test.class.ref - generated by javac, > test.class - updated (line 108 for file belove was updated: 8 -> 10) > ------------------------- test.code------------------------ > > /** > * Generated ccode file > * @author VMTT (Virtual Machine Testing Tools) > * @version 1.0 > * @lastmod: Fri Aug 11 11:20:30 NOVST 2006 > */ > > magic = xCAFEBABE > > minor_version = 0 > > major_version = 48 > > constant_pool_count = 18 > > constant_pool { > /* #1 */ Method = #5 #14 > /* #2 */ Class = #15 > /* #3 */ Method = #2 #14 > /* #4 */ Class = #16 > /* #5 */ Class = #17 > /* #6 */ UTF8 = "" > /* #7 */ UTF8 = "()V" > /* #8 */ UTF8 = "Code" > /* #9 */ UTF8 = "LineNumberTable" > /* #10 */ UTF8 = "main" > /* #11 */ UTF8 = "([Ljava/lang/String;)V" > /* #12 */ UTF8 = "SourceFile" > /* #13 */ UTF8 = "test.java" > /* #14 */ NameAndType = #6 #7 > /* #15 */ UTF8 = "java/lang/Exception" > /* #16 */ UTF8 = "test" > /* #17 */ UTF8 = "java/lang/Object" > } > > access_flags = PUBLIC SUPER // x21 > > this_class = #4 // "test" > > super_class = #5 // "java/lang/Object" > > interfaces_count = 0 > > interfaces { > } > > fields_count = 0 > > methods_count = 2 > > methods { > method { > access_flag = PUBLIC // x01 > name_index = #6 // "" > descriptor_index = #7 // "()V" > attributes_count = 1 > attributes { > attribute Code { > attribute_name_index = #8 // "Code" > attribute_length = 29 > max_stack = 1 > max_locals = 1 > code_length = 5 > code asm { > 0: aload_0 > 1: invokespecial #1 // "java/lang/Object" "" "()V" > 4: return > } > exception_table_length = 0 > attributes_count = 1 > attributes { > attribute LineNumberTable { > attribute_name_index = #9 // "LineNumberTable" > attribute_length = 6 > line_number_table_length = 1 > line_number_table { > // start_pc line_number > 0 1 > } > } > } > } > } > } > method { > access_flag = PUBLIC STATIC // x09 > name_index = #10 // "main" > descriptor_index = #11 // "([Ljava/lang/String;)V" > attributes_count = 1 > attributes { > attribute Code { > attribute_name_index = #8 // "Code" > attribute_length = 50 > max_stack = 2 > max_locals = 2 > code_length = 10 > code asm { > 0: new #2 // "java/lang/Exception" > 3: dup > 4: invokespecial #3 // "java/lang/Exception" "" "()V" > 7: athrow > 8: astore_1 > 9: return > } > exception_table_length = 1 > exception_table { > // start_pc end_pc handler_pc catch_type > 0 10 8 2 > } > attributes_count = 1 > attributes { > attribute LineNumberTable { > attribute_name_index = #9 // "LineNumberTable" > attribute_length = 14 > line_number_table_length = 3 > line_number_table { > // start_pc line_number > 0 4 > 8 5 > 9 7 > } > } > } > } > } > } > } > > attributes_count = 1 > attributes { > attribute SourceFile { > attribute_name_index = #12 // "SourceFile" > attribute_length = 2 > sourcefile_index = #13 // "test.java" > } > } > --------------------------------------------------------------- > > Output: > > C:\tmp\vm_tool>java -showversion test > java version "1.4.2_10" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03) > Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode) > > > C:\tmp\vm_tool>C:\jdk1.5.0_06\bin\java -showversion test > java version "1.5.0_06" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) > Java HotSpot(TM) Client VM (build 1.5.0_06-b05 , mixed mode) > > > C:\tmp\vm_tool>C:\harmony\drlvm1.5\build\win_ia32_msvc_debug\deploy\jre\bin\java > -Dvm.assert_dialog=false -cp . -showversion test > java version "1.5.0" > pre-alpha : not complete or compatible > svn = r430643, (Aug 11 2006), Windows/ia32/msvc 1310, debug build > > http://incubator.apache.org/harmony > vf_debug: VerifyError: (class: test, method: main([Ljava/lang/String;)V) > Handler pc is out of range > java.lang.VerifyError: (class: test, method: main([Ljava/lang/String;)V) > Handler pc is out of range > at java.lang.VMClassRegistry.defineClass() > at java.lang.ClassLoader.defineClass() > at java.security.SecureClassLoader.defineClass( > SecureClassLoader.java:68) > at java.net.URLClassLoader.findClassImpl (URLClassLoader.java > :1130) > at java.net.URLClassLoader$4.run(URLClassLoader.java:617) > at java.net.URLClassLoader$4.run(URLClassLoader.java:616) > at java.security.AccessController.doPrivilegedImpl () > at java.security.AccessController.doPrivileged() > at java.net.URLClassLoader.findClass(URLClassLoader.java:614) > at java.lang.ClassLoader.loadClass() > at java.net.URLClassLoader$SubURLClassLoader.loadClass ( > URLClassLoader.java:116) > > C:\tmp\vm_tool>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . > -showversion test > java version 1.5 (subset) > > (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, > as applicable. > > C:\tmp\vm_tool> > > > On 8/10/06, Geir Magnusson Jr wrote: > > > > > > > > Anton Luht wrote: > > > Hello, > > > > > > DRLVM has an (undocumented?) option to switch off verifier > > > -Dvm.use_verifier=false . With this option activemq starts without > > > crash. Verifier seem to be the blocker. > > > > Aw... I was hoping you'd tell us what the problem was. Any clue? > > > > geir > > > > > > > > On 8/8/06, Geir Magnusson Jr wrote: > > >> > > >> > > >> Gregory Shimansky wrote: > > >> > On Tuesday 08 August 2006 00:01 Geir Magnusson Jr wrote: > > >> >> Ok - I made that fix and still seem to have a problem, even after > > a > > >> >> clean rebuild. I guess I should figure out how to turn on the > > >> trace... > > >> > > > >> > The problem is that class loader does not chain VerifyError to > > >> > NoClassDefFoundError so debugging such problems is diffucult > > without > > >> tracing. > > >> > I think this is a place for improvement in drlvm. > > >> > > > >> > I tried to fix the problem and found out that verifier just doesn't > > > > >> understand > > >> > exception handlers which point to the code length address (code end > > > > >> + 1). It > > >> > is a surprise that this problem didn't appear earlier. > > >> > > >> App-oriented testing... :) > > >> > > >> > > > >> > My patch attached to JIRA attempts to fix the problem in verifier > > >> only, the > > >> > application still fails to start. In default mode it exits > > silently, > > >> I didn't > > >> > find any exception logs or something. When using interpreter -Xint > > >> it fails > > >> > with ArrayStoreException still without any stack trace. I'll try to > > >> find out > > >> > what is happening. > > >> > > >> Nice work. Thanks for doing this... > > >> > > >> geir > > >> > > >> > > > >> >> Anton Luht wrote: > > >> >>> Hello, > > >> >>> > > >> >>> The problem is with verifier. > > >> >>> > > >> >>> The code in Verifier.cpp: > > >> >>> > > >> >>> if( ( start_pc >= len ) || ( end_pc >= len ) || ( > > >> handler_pc >= > > >> >>> len ) ) > > >> >>> ... > > >> >>> > > >> >>> result = VER_ErrorHandler; > > >> >>> > > >> >>> I've modified error logging a bit to log values of start_pc, > > end_pc, > > >> >>> handler_pc and len and that's the output: > > >> >>> > > >> >>> > > >> >>> Loading message broker from: xbean:activemq.xml > > >> >>> vf_debug: VerifyError: (class: > > >> >>> edu/emory/mathcs/backport/java/util/concurrent/lo > > >> >>> cks/ReentrantLock$NonfairSync, method: lockInterruptibly()V, len: > > >> 103, > > >> >>> start_pc: > > >> >>> 87, end_pc: 103, handler_pc: 21) Handler pc is out of range > > >> >>> vf_debug: verifying class > > >> >>> edu/emory/mathcs/backport/java/util/concurrent/locks/R > > >> >>> eentrantLock (method ()V) couldn't load class > > >> >>> "edu/emory/mathcs/backport/j > > >> >>> ava/util/concurrent/locks/ReentrantLock$NonfairSync" > > >> >>> vf_debug: VerifyError: > > >> >>> edu/emory/mathcs/backport/java/util/concurrent/locks/Reen > > >> >>> trantLock$NonfairSync > > >> >>> Failed to execute main task. Reason: > > java.lang.NoClassDefFoundError: > > >> >>> edu/emory/m > > >> >>> > > athcs/backport/java/util/concurrent/locks/ReentrantLock$NonfairSync > > >> >>> > > >> >>> I'm not an expert in verification but seems like > > >> >>> > > >> >>> end_pc >= len > > >> >>> should be replaced with > > >> >>> end_pc > len > > >> >>> > > >> >>> On 8/5/06, Geir Magnusson Jr wrote: > > >> >>>> Anyone interested? :) > > >> > > > >> > > >> --------------------------------------------------------------------- > > >> Terms of use : http://incubator.apache.org/harmony/mailing.html > > >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > >> > > >> > > > > > > > > > > > > --------------------------------------------------------------------- > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > -- Gregory Shimansky, Intel Middleware Products Division ------=_Part_43595_28551770.1155304994475--