harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Rebriy (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-3927) [drlvm][verifier] DRLVM crashes or throw no error instead of throwing VerifyError if an instruction call has type inconsistency
Date Wed, 23 May 2007 05:19:16 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-3927?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Pavel Rebriy updated HARMONY-3927:
----------------------------------

    Attachment: verifier_3927.patch

The patch to fix the problem.
This is a regression after commit HARMONY-3720.

> [drlvm][verifier] DRLVM crashes or throw no error instead of throwing VerifyError if
an instruction call has type inconsistency
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3927
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3927
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: test.zip, verifier_3927.patch
>
>
> DRLVM crashes or throw no error instead of throwing VerifyError if an instruction call
has type inconsistency.
> This behavior is reproduces since Harmony-r539909 build, it looks like a regression in
verifier.
> Please, use the next test as reproducer: 
>  
> (It tests that if the type of class instance that is the target of a method invocation
instruction is not assignment compatible 
> with the class type specified in the instruction then VerifyError is thrown) 
>  
> --------------------------------- Test.java -------------------------------- 
> import java.lang.reflect.Method;
>  
> public class Test {
>  
>     public static void main(String[] args) {
>         try {
>             Method method = Invoke.class.getDeclaredMethod("test", new Class[] {}); 
>             method.invoke(new Invoke(), new Object[] {}); 
>             System.out.println("TEST FAILED: no error"); 
>         } catch(VerifyError e) {
>             System.out.println("TEST PASSED: " + e); 
>         } catch(Throwable e) {
>             System.out.println("TEST FAILED: unexpected " + e); 
>         }
>     }
> }
>  
> -------------------------------- Invoke.j ---------------------------------- 
> .class public Invoke
> .super java/lang/Object
>  
> .method public <init>()V
>    aload_0
>    invokespecial java/lang/Object/<init>()V
>    return
> .end method
>  
> ; test method
> .method public test()V
>    .limit stack 2
>    .limit locals 2
>    
>    ; push this
>    aload_0 
>    
>    ; invoke method of Throwable on the instance of Invoke class
>    invokevirtual java/lang/Throwable/getMessage()Ljava/lang/String; 
>  
>    return
> .end method
> ----------------------------------------------------------------------------
>  
> Steps to reproduce (test source is attached as test.zip): 
> 1) Compile Invoke class: java -jar jasmine.jar Invoke.j
> 2) Compile Test class
> 3) Run Test class on Harmony
>  
> Output on Harmony-r540035 msvc release build:
>  
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, 
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r540035, (May 21 2007), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony 
>  
> Windows reported exception: 0xc0000005
> Registers:
>     EAX: 0x00000000, EBX: 0x00000000, ECX: 0x0013cc24, EDX: 0x00000001
>     ESI: 0x0013cc74, EDI: 0x011af638, ESP: 0x0013cb34, EBP: 0x0013cb60
>     EIP: 0x00519640
> Stack trace:
>   0: std::operator<<<std::char_traits<char> > (c:\program files\microsoft
visual studio .net 2003\vc 
> 7\include\ostream:704)
>   1: vf_set_error (c:\bt\build\checkouts\drlvm\vm\vmcore\src\verifier\ver_utils.cpp:1040)

>   2: java/lang/ClassLoader.defineClass0(Ljava/lang/String;[BII)Ljava/lang/Class; (ClassLoader.java:-

> 2)
>   3: java/lang/ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/

> lang/Class; (ClassLoader.java:417)
>   4: java/security/SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Lj

> ava/lang/Class; (SecureClassLoader.java:70)
>   5: java/net/URLClassLoader.findClassImpl([Ljava/net/URL;Ljava/lang/String;)Ljava/lang/Class;
(URLC 
> lassLoader.java:1214)
>   6: java/net/URLClassLoader$4.run()Ljava/lang/Class; (URLClassLoader.java:625)
>   7: java/net/URLClassLoader$4.run()Ljava/lang/Object; (URLClassLoader.java:1)
>   8: java/security/AccessController.doPrivilegedImpl(Ljava/security/PrivilegedAction;Ljava/security/

> AccessControlContext;)Ljava/lang/Object; (AccessController.java:171)
>   9: java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/Acce

> ssControlContext;)Ljava/lang/Object; (AccessController.java:64)
>  10: java/net/URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; (URLClassLoader.java:627

> )
>  11: java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; (ClassLoader.java:554)

>  12: java/lang/ClassLoader$SystemClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;
(ClassL 
> oader.java:942)
>  13: java/lang/ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; (ClassLoader.java:311)

>  14: ?? (??:-1)
> <end of stack trace>
>  
> Output on Harmony-r539255 msvc release build:
>  
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, 
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r539255, (May 18 2007), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony 
>  
> TEST PASSED: java.lang.VerifyError: (class: Invoke, method: test()V) Incompatible argument
for function 
>  
> This bug causes failures of 26 tests from DRLVM Validation test suite (http://issues.apache.org/jira/browse/HARMONY-3206):
> vm.jvms.classFile.constraints.structural.constraint11.initialization06.initialization06

> vm.jvms.classFile.constraints.structural.constraint11.initialization08.initialization08

> vm.jvms.classFile.constraints.structural.constraint13.invocation01.invocation01
> vm.jvms.classFile.constraints.structural.constraint14.return03.return03
> vm.jvms.classFile.constraints.structural.constraint16.putfield01.putfield01
> vm.jvms.classFile.constraints.structural.constraint16.putfield02.putfield02
> vm.jvms.classFile.constraints.structural.constraint16.putfield04.putfield04
> vm.jvms.classFile.constraints.structural.constraint16.putfield06.putfield06
> vm.jvms.classFile.constraints.structural.constraint16.putfield07.putfield07
> vm.jvms.classFile.constraints.structural.constraint19.athrow01.athrow01
> vm.jvms.classFile.constraints.structural.constraint41.methods04.methods04
> vm.jvms.classFile.constraints.structural.constraint41.methods06.methods06
> vm.jvms.classFile.constraints.structural.constraint41.methods08.methods08
> vm.jvms.classFile.constraints.structural.constraint41.methods09.methods09
> vm.jvms.classFile.methods.accessFlags.accessFlags26.accessFlags26
> vm.jvms.classFile.verifier.bytecode.bytecode10.bytecode10
> vm.jvms.classFile.verifier.bytecode.bytecode13.bytecode13
> vm.jvms.classFile.verifier.bytecode.bytecode14.bytecode14
> vm.jvms.classFile.verifier.bytecode.bytecode18.bytecode18
> vm.jvms.classFile.attributes.code.code11.code11
> vm.jvms.instructions.exceptions.athrow.athrow03.athrow0301.athrow0301
> vm.jvms.instructions.invokeReturn.areturn.areturn04.areturn0405.areturn0405
> vm.jvms.instructions.invokeReturn.invokespecial.invokespecial17.invokespecial1701.invokespecial1701

> vm.jvms.instructions.reftypes.getfield.getfield21.getfield2101.getfield2101
> vm.jvms.instructions.reftypes.putfield.putfield22.putfield2206.putfield2206
> vm.jvms.instructions.reftypes.putstatic.putstatic25.putstatic2506.putstatic2506

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message