You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Geir Magnusson Jr <ge...@pobox.com> on 2006/08/05 14:23:31 UTC

[drlvm] HARMONY-956 - problem w/ DRLVM classloader

Anyone interested? :)

geir

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Gregory Shimansky <gs...@gmail.com>.
On Monday 07 August 2006 22:10 Gregory Shimansky wrote:
> On Monday 07 August 2006 21:22 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 <init>()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
>
> I checked Java class file format spec [1] and it states in 4.7.3 that:
>
> --------------------------------------------------------
> start_pc, end_pc
>     The values of the two items start_pc and end_pc indicate the ranges in
> the code array at which the exception handler is active. The value of
> start_pc must be a valid index into the code array of the opcode of an
> instruction. The value of end_pc either must be a valid index into the code
> array of the opcode of an instruction or must be equal to code_length, the
> length of the code array. The value of start_pc must be less than the value
> of end_pc.
>
>     The start_pc is inclusive and end_pc is exclusive; that is, the
> exception handler must be active while the program counter is within the
> interval [start_pc, end_pc).
> --------------------------------------------------------
>
> In this case the code length is 103 and end_pc is 103. It looks to be a
> legal exception handler entry so I agree with your correction to verifier
> code.

I forgot to place a link in footnote [1]

[1] http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Gregory Shimansky <gs...@gmail.com>.
On Monday 07 August 2006 21:22 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
> <init>()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

I checked Java class file format spec [1] and it states in 4.7.3 that:

--------------------------------------------------------
start_pc, end_pc
    The values of the two items start_pc and end_pc indicate the ranges in the 
code array at which the exception handler is active. The value of start_pc 
must be a valid index into the code array of the opcode of an instruction. 
The value of end_pc either must be a valid index into the code array of the 
opcode of an instruction or must be equal to code_length, the length of the 
code array. The value of start_pc must be less than the value of end_pc.

    The start_pc is inclusive and end_pc is exclusive; that is, the exception 
handler must be active while the program counter is within the interval 
[start_pc, end_pc).
--------------------------------------------------------

In this case the code length is 103 and end_pc is 103. It looks to be a legal 
exception handler entry so I agree with your correction to verifier code.

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
Sorry - the bug is not reproduced on the latest build. Someone has
fixed it during the weekend :)

On 8/14/06, Anton Luht <an...@gmail.com> wrote:
> Hello,
>
> I've found another issue trying to run activemq: HARMONY-1177 . I
> think it's important - try/catch/return works incorrectly.
>
> On 8/14/06, Geir Magnusson Jr <ge...@pobox.com> 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.
> >
> > Odd.  even with that switch, I get a crash.  Of course, it's not the
> > verifier.  Seems like ActiveMQ is a good app to focus on to get running
> >
> > geir
> >
> > >
> > > On 8/8/06, Geir Magnusson Jr <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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
> >
> >
>
>
> --
> Regards,
> Anton Luht,
> Intel Middleware Products Division
>


-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
Hello,

I've found another issue trying to run activemq: HARMONY-1177 . I
think it's important - try/catch/return works incorrectly.

On 8/14/06, Geir Magnusson Jr <ge...@pobox.com> 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.
>
> Odd.  even with that switch, I get a crash.  Of course, it's not the
> verifier.  Seems like ActiveMQ is a good app to focus on to get running
>
> geir
>
> >
> > On 8/8/06, Geir Magnusson Jr <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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
>
>


-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.

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.

Odd.  even with that switch, I get a crash.  Of course, it's not the
verifier.  Seems like ActiveMQ is a good app to focus on to get running

geir

> 
> On 8/8/06, Geir Magnusson Jr <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.
Nice.  Have a patch? :)

geir

Vladimir Ivanov wrote:
> 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 = "<init>"
>  /* #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  // "<init>"
>    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" "<init>" "()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" "<init>" "()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 <ge...@pobox.com> 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 <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
Geir,

> can you please add that patch to the JIRA entry?

It's not a patch, but a bug workaround or better to say - dirty hack.
I'd better try to solve the core problem and provide the proper patch
in few days.

--
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.
can you please add that patch to the JIRA entry?

Anton Luht wrote:
> Hello,
> 
> Yes, the problem with verifier is partly solved but problems in verifier
> remain.
> 
> method vf_resolve_class( name, true, ctex ) from ver_utils.cpp
> sometimes returns null when vf_resolve_class( name, false, ctex )
> returns non-null  for same class name. This method is for looking up
> classes, if I understand correctly, 'true' means load class if not
> loaded and 'false' - just take from cache anything that is there,
> don't try to load. The situation when class is in cache and 'deep'
> load can't find it shouldn't happen.
> 
> Temp workaround for this bug before deep investigation can be:
> 
> Index: ver_utils.cpp
> ===================================================================
> --- ver_utils.cpp       (revision 430763)
> +++ ver_utils.cpp       (working copy)
> @@ -1391,6 +1391,9 @@
> 
>     // get stack reference class
>     class_handler source = vf_resolve_class( constraint->source, true,
> ctex );
> +    if(source == NULL)  {
> +       source = vf_resolve_class( constraint->source, false, ctex );
> +    }
>     if( !source ) {
>         VERIFY_DEBUG( "verifying class " << class_get_name( ctex->m_class )
>             << " (method " << method_get_name( constraint->method )
> 
> 
> after that the activemq start fails with message:
> 
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
> java.la
> ng.ArrayStoreException
> 
> To be continued.
> 
> On 8/11/06, Gregory Shimansky <gs...@gmail.com> wrote:
>> 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.
>>
> 

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
Hello,

Yes, the problem with verifier is partly solved but problems in verifier remain.

method vf_resolve_class( name, true, ctex ) from ver_utils.cpp
sometimes returns null when vf_resolve_class( name, false, ctex )
returns non-null  for same class name. This method is for looking up
classes, if I understand correctly, 'true' means load class if not
loaded and 'false' - just take from cache anything that is there,
don't try to load. The situation when class is in cache and 'deep'
load can't find it shouldn't happen.

Temp workaround for this bug before deep investigation can be:

Index: ver_utils.cpp
===================================================================
--- ver_utils.cpp       (revision 430763)
+++ ver_utils.cpp       (working copy)
@@ -1391,6 +1391,9 @@

     // get stack reference class
     class_handler source = vf_resolve_class( constraint->source, true, ctex );
+    if(source == NULL)  {
+       source = vf_resolve_class( constraint->source, false, ctex );
+    }
     if( !source ) {
         VERIFY_DEBUG( "verifying class " << class_get_name( ctex->m_class )
             << " (method " << method_get_name( constraint->method )


after that the activemq start fails with message:

ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: java.la
ng.ArrayStoreException

To be continued.

On 8/11/06, Gregory Shimansky <gs...@gmail.com> wrote:
> 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.
>

-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Gregory Shimansky <gs...@gmail.com>.
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 <iv...@gmail.com>:
>
> 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 = "<init>"
>   /* #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  // "<init>"
>     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" "<init>" "()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" "<init>" "()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 <ge...@pobox.com> 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 <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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

Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Vladimir Ivanov <iv...@gmail.com>.
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 = "<init>"
  /* #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  // "<init>"
    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" "<init>" "()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" "<init>" "()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 <ge...@pobox.com> 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 <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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
>
>

Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.

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 <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
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.

On 8/8/06, Geir Magnusson Jr <ge...@pobox.com> 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 <init>()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 <ge...@pobox.com> 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
>
>


-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.

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 <init>()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 <ge...@pobox.com> 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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Gregory Shimansky <gs...@gmail.com>.
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.

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.

> 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 <init>()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 <ge...@pobox.com> wrote:
> >> Anyone interested? :)

-- 
Gregory Shimansky, Intel Middleware Products Division

---------------------------------------------------------------------
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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Geir Magnusson Jr <ge...@pobox.com>.
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...

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 <init>()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 <ge...@pobox.com> wrote:
>> Anyone interested? :)
>>
>> geir
>>
>> ---------------------------------------------------------------------
>> 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


Re: [drlvm] HARMONY-956 - problem w/ DRLVM classloader

Posted by Anton Luht <an...@gmail.com>.
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 <init>()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 <ge...@pobox.com> wrote:
> Anyone interested? :)
>
> geir
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Regards,
Anton Luht,
Intel Middleware Products Division

---------------------------------------------------------------------
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