Older blog entries for twisti (starting at number 8)

5 Sep 2007 (updated 23 Jul 2008 at 07:37 UTC) »
HotSpot's verifier not verifying

Yesterday I found the problem why we get a VerifyError when running Eclipse with CACAO-OpenJDK, while HotSpot does not. It's again the MagicAccessorImpl class.

Snippet from sun/reflect/MagicAccessorImpl.java (I overlooked that when debugging the access-check bug):


    The bug fix for 4486457 also necessitated disabling
    verification for this class and all subclasses, as
opposed to just
    SerializationConstructorAccessorImpl and subclasses, to
avoid
    having to indicate to the VM which of these
dynamically-generated
    stub classes were known to be able to pass the verifier. 

Finding these magics is really a pain...

IcedTea completely built and running on PowerPC

Today I finally made it to build a complete j2sdk-image on powerpc. As IcedTea has support for FreeType, I could run my first GUI application:

This is soooo cool and exciting, I hope I can sleep now :-)

OpenJDK on s390

Peter Molnar got OpenJDK running on s390. This is exciting :-)

OpenJDK: Eclipse

No comment.

OpenJDK: Getting closer to a full build

On friday I found the bug why Boehm always crashed with OpenJDK's wrappers. The problem is that the wrappers create a thread which then runs the VM. Boehm doesn't like that. But it can simply be removed:


Index: j2se/src/share/bin/java.c
===================================================================
--- j2se/src/share/bin/java.c   (revision 244)
+++ j2se/src/share/bin/java.c   (working copy)
@@ -367,7 +367,8 @@ main(int argc, char ** argv)
       args.classname = classname;
       args.ifn = ifn;
 
-      return ContinueInNewThread(JavaMain, threadStackSize,
(void*)&args, ret);
+/*       return ContinueInNewThread(JavaMain,
threadStackSize, (void*)&args, ret); */
+      return JavaMain((void*)&args);
     }
 }
 

With that patch we can use OpenJDK's wrappers with CACAO's libjvm:


$ java -version
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=HUP
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=INT
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_FindSignal: name=TERM
LOG: [0x30021b70] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30021b70] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
openjdk version "1.7.0-internal-fastdebug"
OpenJDK Runtime Environment (build
1.7.0-internal-fastdebug-twisti_29_jul_2007_18_33-b00)
CACAO (build 0.98+svn, JIT mode)

WOOHOO! :-)

That means we can build OpenJDK with its own tools, by providing a CACAO-Sun build to OpenJDK with ALT_HOTSPOT_IMPORT_PATH. Then CACAO's libjvm gets imported and all tools like javac, javah or rmic are called from the currently builing OpenJDK.

With some small patches and the help of IcedTea I get a fully compiled and working j2re-image on my powerpc-linux box!!!

That is _really_ cool!

j2sdk-image is currently failing because of missing annotations support. But the student working on CACAO's annotations support already has a working implementation for OpenJDK and it will be (hopefully) commited tomorrow. That probably means a new blog soon...

Wanna Eclipse on s390?

Peter Molnar, a student of the Vienna University of Technology who is doing his thesis on CACAO, did the undoable. But see for yourself.

Portable OpenJDK

Here is another output of the prop testcase:


$ cacao prop
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008a0f0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008aa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008cc30, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008c690, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094d20, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094a50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x1008aa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10094870, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100944b0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100942d0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x10046690, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=HUP
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=INT
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_FindSignal: name=TERM
LOG: [0x30020bd0] JVM_RegisterSignal: sig=0, handler=0x2,
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100aaa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100acf00, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ad4b0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ad3c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100b03c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100baa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100baa50, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ba3c0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100ba0f0, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100cc960, IMPLEMENT ME!
LOG: [0x30020bd0] JVM_DesiredAssertionStatus:
cls=0x100d0c30, IMPLEMENT ME!
#all properties:
#Fri Jun 22 12:30:16 GMT+01:00 2007
java.runtime.name=OpenJDK Runtime Environment
sun.boot.library.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/lib/ppc/
java.vm.version=0.98+svn
java.vm.vendor=CACAO Team
java.vendor.url=http\://java.sun.com/
path.separator=\:
java.vm.name=CACAO
file.encoding.pkg=sun.io
user.country=US
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/twisti/cacao/cacao-sun/tests
java.runtime.version=1.7.0-internal-fastdebug-twisti_21_jun_2007_21_30-b00
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
os.arch=ppc
java.io.tmpdir=/tmp
line.separator=\n
java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.jnu.encoding=ANSI_X3.4-1968
java.specification.name=Java Platform API Specification
java.class.version=50.0
os.version=2.6.18-4-powerpc
user.home=/home/twisti
user.timezone=GMT+01\:00
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=ANSI_X3.4-1968
java.specification.version=1.7
java.class.path=.
user.name=twisti
java.vm.specification.version=1.0
sun.arch.data.model=32
java.home=/home/twisti/tmp/cacao-sun/jre
user.language=en
java.specification.vendor=Sun Microsystems Inc.
java.version=1.7.0-internal-fastdebug
sun.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/classes/
java.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-ppc-fastdebug/classes/
java.vendor=Sun Microsystems Inc.
file.separator=/
java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding=UnicodeBig
sun.cpu.endian=big
sun.desktop=gnome
sun.cpu.isalist=

For those who are saying now: "Hey! That's the same output as the last one with the same unimplemented functions!", look at the output again! (hint: os.arch!!!).

I built the OpenJDK completely with CACAO and free GNU Classpath tools. But the build is not complete, there is still some stuff missing and I need to figure out why it does not work. But it's enough to run a bunch of programs on Java 1.7 on PowerPC (and maybe other architectures, will try that) :-)

I will write down more detailed information about how to build this whole thing here.

CACAO and OpenJDK: The marriage

Since a week or two I'm trying to get CACAO running on OpenJDK's libraries and it's very promising:


$ cacao prop
LOG: [0x00002ba1dc8ee0a0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x690c00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x686000, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x690400, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x692800, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x69d600, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x69d000, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x686000, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x69ec00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x69e400, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x69e000, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x649c00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_FindSignal: name=HUP
LOG: [0x00002ba1dc8ee0a0] JVM_RegisterSignal: sig=0,
handler=0x2, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_FindSignal: name=INT
LOG: [0x00002ba1dc8ee0a0] JVM_RegisterSignal: sig=0,
handler=0x2, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_FindSignal: name=TERM
LOG: [0x00002ba1dc8ee0a0] JVM_RegisterSignal: sig=0,
handler=0x2, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6b7e00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6b8400, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6bfa00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6bf800, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6c5600, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_GetStackAccessControlContext:
IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6da200, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6da200, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6db200, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6e4c00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6eda00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6f8c00, IMPLEMENT ME!
LOG: [0x00002ba1dc8ee0a0] JVM_DesiredAssertionStatus:
cls=0x6f8200, IMPLEMENT ME!
#all properties:
#Thu Jun 14 11:23:34 GMT+01:00 2007
java.runtime.name=OpenJDK Runtime Environment
sun.boot.library.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-amd64/lib/amd64/
java.vm.version=0.98+svn
java.vm.vendor=CACAO Team
java.vendor.url=http\://java.sun.com/
path.separator=\:
java.vm.name=CACAO
file.encoding.pkg=sun.io
user.country=US
sun.os.patch.level=unknown
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/twisti/cacao/cacao/tests
java.runtime.version=1.7.0-internal-twisti_09_may_2007_15_45-b00
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
os.arch=amd64
java.io.tmpdir=/tmp
line.separator=\n
java.vm.specification.vendor=Sun Microsystems Inc.
os.name=Linux
sun.jnu.encoding=ANSI_X3.4-1968
java.specification.name=Java Platform API Specification
java.class.version=50.0
os.version=2.6.21-1-amd64
user.home=/home/twisti
user.timezone=GMT+01\:00
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=ANSI_X3.4-1968
java.specification.version=1.7
java.class.path=.
user.name=twisti
java.vm.specification.version=1.0
sun.arch.data.model=64
java.home=/home/twisti/tmp/cacao/jre
user.language=en
java.specification.vendor=Sun Microsystems Inc.
java.version=1.7.0-internal
sun.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-amd64/j2sdk-image/jre/lib/rt.jar
java.boot.class.path=/home/twisti/cacao/sun/openjdk/jdk/control/build/linux-amd64/j2sdk-image/jre/lib/rt.jar
java.vendor=Sun Microsystems Inc.
file.separator=/
java.vendor.url.bug=http\://java.sun.com/cgi-bin/bugreport.cgi
sun.io.unicode.encoding=UnicodeLittle
sun.cpu.endian=little
sun.desktop=gnome
sun.cpu.isalist=

I still have a problem with resources and I don't know where the problem is. I suspect some string-issues. I have to add some debugging code into OpenJDK's native zip code.

When javac works (it does not because of the resouce problem I mentioned above), the next thing will be to replace HotSpot's libjvm.so by CACAO's and try to build it on some architectures that are not supported by HotSpot, like PowerPC.

Finally I got a blog! Damn, this internet is hip...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!