Bug 63591 - [1.5] VerifyError: Expecting stackmap frame
Summary: [1.5] VerifyError: Expecting stackmap frame
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 63988 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-23 13:09 EDT by Stefan Matthias Aust CLA
Modified: 2005-01-11 11:03 EST (History)
1 user (show)

See Also:


Attachments
Class file that causes the VerifyError (1.07 KB, application/octet-stream)
2004-05-24 13:07 EDT, Stefan Matthias Aust CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Matthias Aust CLA 2004-05-23 13:09:18 EDT
M9 + HEAD of 1_5 branch from CVS

Executing the code shown below raises the following VM exception:

java.lang.VerifyError: Expecting a stackmap frame at branch target 51 in method
qwo.Qwo.load(Ljava/lang/String;)Ljava/lang/String;
Exception in thread "main" 

public class Qwo {
	private static String load(String fileName) throws IOException {
		FileReader r = new FileReader(fileName);
		StringWriter w = new StringWriter(4096);
		char[] buf = new char[4096];
		int count = r.read(buf);
		while (count > 0) {
			w.write(buf, 0, count);
			count = r.read(buf);
		}
		return w.toString();
	}
	
	public static void main(String[] args) throws IOException {
		System.out.println(load("example.txt"));
	}
}
Comment 1 Philipe Mulet CLA 2004-05-23 18:15:10 EDT
Cannot reproduce. Given it has nothing specific to J2SE 1.5 support, can you 
reproduce it with plain M9 build ?

Also, can you describe the compiler settings you are using ? This could only 
occur in some given configuration.
Comment 2 Philipe Mulet CLA 2004-05-24 07:18:43 EDT
Please reopen once requested information is available.
Comment 3 Stefan Matthias Aust CLA 2004-05-24 13:05:45 EDT
I can easily reproduce the problem. I'm using M9. I downloaded the lastest 1_5
branch of jdt.core from CVS (just a few minutes ago).  I launched that as a
runtime workbench using JRE 1.4.2_03.  In that workbench, I changed the default
JRE to 1.5.0 beta1 and the compiler compliance level to 1.5.  I didn't change
anything else.  I created a test project with a test class (without package) and
entered the code posted earlier.

If I try to run it, I get the exception.  

If I switch the compiler compliance level back to 1.4, it works.  Therefore, I
assume that it has to do with cheetah.  The code also works without problem in a
naked M9.

I checked for a .log file but there's none.
Comment 4 Stefan Matthias Aust CLA 2004-05-24 13:07:02 EDT
Created attachment 11018 [details]
Class file that causes the VerifyError
Comment 5 Philipe Mulet CLA 2004-05-25 18:59:43 EDT
Disassembled classfile is:
D:\>javap -c -private Test
Compiled from "Test.java"
public class Test extends java.lang.Object{
public Test();
  Code:
   0:   aload_0
   1:   invokespecial   #9; //Method java/lang/Object."<init>":()V
   4:   return

private static java.lang.String load(java.lang.String)   throws 
java.io.IOException;
  Code:
   0:   new     #20; //class java/io/FileReader
   3:   dup
   4:   aload_0
   5:   invokespecial   #23; //Method java/io/FileReader."<init>":
(Ljava/lang/String;)V
   8:   astore_1
   9:   new     #25; //class java/io/StringWriter
   12:  dup
   13:  sipush  4096
   16:  invokespecial   #28; //Method java/io/StringWriter."<init>":(I)V
   19:  astore_2
   20:  sipush  4096
   23:  newarray char
   25:  astore_3
   26:  aload_1
   27:  aload_3
   28:  invokevirtual   #32; //Method java/io/FileReader.read:([C)I
   31:  istore  4
   33:  goto    51
   36:  aload_2
   37:  aload_3
   38:  iconst_0
   39:  iload   4
   41:  invokevirtual   #36; //Method java/io/StringWriter.write:([CII)V
   44:  aload_1
   45:  aload_3
   46:  invokevirtual   #32; //Method java/io/FileReader.read:([C)I
   49:  istore  4
   51:  iload   4
   53:  ifgt    36
   56:  aload_2
   57:  invokevirtual   #40; //Method java/io/StringWriter.toString:()
Ljava/lang/String;
   60:  areturn

public static void main(java.lang.String[])   throws java.io.IOException;
  Code:
   0:   getstatic       #58; //Field java/lang/System.out:Ljava/io/PrintStream;
   3:   ldc     #60; //String
   5:   invokestatic    #62; //Method load:(Ljava/lang/String;)
Ljava/lang/String;
   8:   invokevirtual   #67; //Method java/io/PrintStream.println:
(Ljava/lang/String;)V
   11:  return

}
Comment 6 Philipe Mulet CLA 2004-05-25 19:27:19 EDT
Still cannot reproduce. My generated file is strictly the same as yours, and 
mine is executed without any problem by 1.5 VM.
Comment 7 Stefan Matthias Aust CLA 2004-05-27 03:55:36 EDT
I think, I found the problem.  It's a bug related to 1.5.0-beta1-b31 (javalobby
alpha version).  I tried another computer where I've 1.5.0-beta1-b32c (official
beta1 I think) installed.  Now it works.  Time to upgrade my version...

You can close the bug.  Thanks for your patience :)
Comment 8 Philipe Mulet CLA 2004-05-27 06:14:32 EDT
Ok, thanks for letting us know. I was indeed trying to reproduce on b32c or 
better.
Comment 9 Philipe Mulet CLA 2004-05-27 06:32:36 EDT
*** Bug 63988 has been marked as a duplicate of this bug. ***