[PATCH] javac kjc 2.1A compilation fix was: Re: VerifyError in PushbackReader

2002-03-18 Thread Dalibor Topic

On Sunday 17 March 2002 18:01, Ito Kazumitsu wrote:
 Now KJC 2.1A has been released.  But when I tried to rebuild
 Klasses.jar with KJC 2.1A, I got the following message:

 /bin/sh ./rebuildLib
 Compiling classes ...
 java/util/Hashtable.java:169: error:Class Entry is not accessible [JLS
 6.6.1] java/util/Hashtable.java:201: error:Class Entry is not accessible
 [JLS 6.6.1] make: *** [lib/stamp] Error 1

the attached patch solves that problem  javac compilation problems for me. 
could you give it a try?

cheers,

dalibor topic

* libraries/javalib/java/util/HashMap.java :
(getTableLength) new method.
* libraries/javalib/java/util/Hashtable.java :
(writeDefaultObject) Use getTableLength instead of accesing
table directly.
(writeObject) same.


--- kaffe/libraries/javalib/java/util/Hashtable.java	Fri Nov 23 00:38:12 2001
+++ patched-kaffe/libraries/javalib/java/util/Hashtable.java	Mon Mar 18 19:33:57 2002
 -166,7 +166,7 
 
 	private void writeDefaultObject() {
 		loadFactor = map.loadFactor;
-		threshold = (int)(map.table.length * loadFactor);
+		threshold = (int)(map.getTableLength() * loadFactor);
 	}
 
 	}
 -198,7 +198,7 
 		stream.defaultWriteObject();
 
 		// remember how many buckets there were
-		stream.writeInt(map.table.length);
+		stream.writeInt(map.getTableLength());
 		stream.writeInt(map.size());
 
 		Iterator i = map.entrySet().iterator();
--- kaffe/libraries/javalib/java/util/HashMap.java	Mon Dec  3 13:11:41 2001
+++ patched-kaffe/libraries/javalib/java/util/HashMap.java	Mon Mar 18 19:33:18 2002
 -101,6 +101,10 
 		return e == null ? null : e.value;
 	}
 
+	int getTableLength() {
+		return table.length;
+	}
+
 	public Object put(Object key, Object val) {
 
 		// See if key already exists



Re: VerifyError in PushbackReader

2002-03-17 Thread Chris Gray


On Sun, 17 Mar 2002, Oskar Sandberg wrote:

 
 On Sat, Mar 16, 2002 at 05:27:05PM -0800, Archie Cobbs wrote:
  
  Erik Corry writes:
   Whenever I try to run a program (javac, HelloWorld, appletviewer)
   I get the same error:
   
   java.lang.VerifyError: at pc 5 sp 7 not in range [4, 6]
[...]
  
  I'm pretty sure it's a verifier problem. I've seen this before,
  and when I sent the classfile to the jikes people, they said it
  looked fine to them.
 
 With earlier versions of jikes, I would get verify errors like this
 whenever there was a private or protected constructor (rather than
 public) on an internal class. PushbackReader has that on the
 PushbackBuffer class, so that might be worth checking out.
 
 With jikes 1.14 this seems to have been fixed, but jikes 1.15 is
 completely broken as far as I know and produces verify errors all over
 the place.

Yes, jikes 1.15 produces bad code: this is not specific to kaffe.
(Jikes 1.15b is said to be better, but we haven't tried it out yet).

-- 

  Chris Gray[EMAIL PROTECTED][EMAIL PROTECTED]



Re: VerifyError in PushbackReader

2002-03-17 Thread Erik Corry


On Sat, Mar 16, 2002 at 05:27:05PM -0800, Archie Cobbs wrote:
 
 Erik Corry writes:
  Whenever I try to run a program (javac, HelloWorld, appletviewer)
  I get the same error:
  
  java.lang.VerifyError: at pc 5 sp 7 not in range [4, 6]
  at java.io.PushbackReader.init(PushbackReader.java:32)
  at at.dms.compiler.tools.antlr.extra.InputBuffer.init(InputBuffer.java:68)
  at at.dms.compiler.tools.antlr.extra.InputBuffer.init(InputBuffer.java:81)
  at at.dms.kjc.Main.parseFile(Main.java:278)
  at at.dms.kjc.Main.run(Main.java:116)
  at at.dms.kjc.Main.compile(Main.java:68)
  at at.dms.kjc.Main.main(Main.java:59)
 
 I'm pretty sure it's a verifier problem. I've seen this before,
 and when I sent the classfile to the jikes people, they said it
 looked fine to them.
 
 You might try rebuilding Klasses.jar with jikes or kjc (whichever
 wasn't used before) as a possible workaround..

Anyone know what was used before?  I have jikes 1.13 installed.
How do I rebuild Klasses.jar?

If it's a compiler problem, then the error message is very misleading.
I just compiled with -DDEBUG, and the error message went away, but
now all programs terminate 'normally' without doing anything.  Here's
the last part of the output of HelloWorld, running with

  export KAFFE_VMDEBUG=JARFILES,ELOOKUP,CLASSFILE

http://www.arbat.com/erik/error.txt 

-- 
Erik Corry [EMAIL PROTECTED]
Citér kun det nødvendige.  Slet denne signature.  Svar under det citerede.



Re: VerifyError in PushbackReader

2002-03-17 Thread Ito Kazumitsu


 : == Archie Cobbs [EMAIL PROTECTED] writes:

: You might try rebuilding Klasses.jar with jikes or kjc (whichever
: wasn't used before) as a possible workaround..

I experienced a similar problem and tried to rebuild Klasses.jar
but failed.  I heard in the KOPI users mailing list that KJC 1.5B,
which is currently used as Kaffe's kjc.jar,  had bugs seemingly
related to this problem.

Now KJC 2.1A has been released.  But when I tried to rebuild 
Klasses.jar with KJC 2.1A, I got the following message:

/bin/sh ./rebuildLib
Compiling classes ...
java/util/Hashtable.java:169: error:Class Entry is not accessible [JLS 6.6.1]
java/util/Hashtable.java:201: error:Class Entry is not accessible [JLS 6.6.1]
make: *** [lib/stamp] Error 1

As I see it, the viable choice is to downdrade KJC to KJC 1.5A.

***
Ito Kazumitsu



Re: VerifyError in PushbackReader

2002-03-17 Thread Carlos Valiente


 (Jikes 1.15b is said to be better, but we haven't tried it out yet).

I couldn't find jikes-1.15b in
http://oss.software.ibm.com/developerworks/project/showfiles.php?group_id=10

Is it available somewhere else?




Re: VerifyError in PushbackReader

2002-03-17 Thread Mark Wielaard


Hi,

On Sun, 2002-03-17 at 18:07, Carlos Valiente wrote: 
 I couldn't find jikes-1.15b in
 http://oss.software.ibm.com/developerworks/project/showfiles.php?group_id=10
 
 Is it available somewhere else?

It was a special release made by Eric Blake when we tested the GNU
Classpath 0.03 release (we observed the same sort of verification
errors). From the INSTALL file:

- IBM jikes 1.15b+.  You may have success with 1.13, but other
  versions will fail.  Until jikes 1.16 is released, you will
  have to use CVS access and build jikes 1.15b yourself:
  cvs -d :pserver:[EMAIL PROTECTED]:/usr/cvs/jikes login
(password anoncvs)
  cvs co -r v1-15b jikes

If you are running Debian GNU/Linux unstable/sid then you can also just
do an apt-get install jikes. Otherwise download a binary package from
http://packages.debian.org/jikes

Cheers,

Mark



Re: VerifyError in PushbackReader

2002-03-17 Thread Erik Corry


On Sun, Mar 17, 2002 at 02:17:46PM +, Chris Gray wrote:
  
  With earlier versions of jikes, I would get verify errors like this
  whenever there was a private or protected constructor (rather than
  public) on an internal class. PushbackReader has that on the
  PushbackBuffer class, so that might be worth checking out.
  
  With jikes 1.14 this seems to have been fixed, but jikes 1.15 is
  completely broken as far as I know and produces verify errors all over
  the place.
 
 Yes, jikes 1.15 produces bad code: this is not specific to kaffe.
 (Jikes 1.15b is said to be better, but we haven't tried it out yet).

OK, I recompiled with jikes-1.13 (jikes-1.13-1 from RedHat 7.1) and
now I don't have the problem.  The way the problem came and went
depending on the time of day, and whether I stopped the program in
the debugger makes me think that it was caused by uninitialised
data on the stack.  The verifier files are filled with variables
that are not initialised when they are declared, though none of them
are obvious problems.

At any rate I have a workaround now, so I am happy.  I didn't try
with jikes-1.14, because I already deinstalled it.  It crashes
on many of the files in GNU ClassPath (actually the Sable version),
so I didn't trust it.

If someone recompiles with 1.15b then I can try the resulting .jar
file to see if it works for me.  It would be nice to have a version
of Klasses.jar in CVS that doesn't show the problem.

-- 
Erik Corry [EMAIL PROTECTED]



Re: VerifyError in PushbackReader

2002-03-16 Thread Archie Cobbs


Erik Corry writes:
 Whenever I try to run a program (javac, HelloWorld, appletviewer)
 I get the same error:
 
 java.lang.VerifyError: at pc 5 sp 7 not in range [4, 6]
 at java.io.PushbackReader.init(PushbackReader.java:32)
 at at.dms.compiler.tools.antlr.extra.InputBuffer.init(InputBuffer.java:68)
 at at.dms.compiler.tools.antlr.extra.InputBuffer.init(InputBuffer.java:81)
 at at.dms.kjc.Main.parseFile(Main.java:278)
 at at.dms.kjc.Main.run(Main.java:116)
 at at.dms.kjc.Main.compile(Main.java:68)
 at at.dms.kjc.Main.main(Main.java:59)

I'm pretty sure it's a verifier problem. I've seen this before,
and when I sent the classfile to the jikes people, they said it
looked fine to them.

You might try rebuilding Klasses.jar with jikes or kjc (whichever
wasn't used before) as a possible workaround..

I don't know who knows about the verifier but it needs a
review apparently...

-Archie

__
Archie Cobbs * Packet Design * http://www.packetdesign.com