sablevm-developer Mailing List for SableVM (Page 4)
Brought to you by:
egagnon
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(27) |
Aug
(22) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(69) |
Sep
(10) |
Oct
(31) |
Nov
(15) |
Dec
(58) |
2003 |
Jan
(33) |
Feb
(81) |
Mar
(85) |
Apr
(24) |
May
(15) |
Jun
(14) |
Jul
(6) |
Aug
(9) |
Sep
(101) |
Oct
(59) |
Nov
(142) |
Dec
(34) |
2004 |
Jan
(107) |
Feb
(164) |
Mar
(181) |
Apr
(96) |
May
(81) |
Jun
(71) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Laurent M. <la...@ao...> - 2004-05-29 11:37:28
|
Thanks for your help. -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Etienne G. <gag...@uq...> - 2004-05-21 21:38:19
|
OK. I found the bug. SableVM does depend on classes being prepared before you can use them in operations such as "instanceof". To this end, I have modified SableVM to be a little more eager in linking classes (this is *NOT* initialization, if you care about details such as Chapter 5 of the JVM spec.). The problem was that the System class loader (gnu.java.lang.SystemClassLoader) called java.lang.ClassLoader.defineClass() but not resolveClass(). I could have modified the System class loader to also call resolveClass, but this would have not been a robust fix. defineClass() documentation say: Converts an array of bytes into an instance of class Class. Before the Class can be used it must be resolved. But, I think this can make a VM quite fragile. As the JVM spec allows for it, I have modified SableVM "link" the class in defineClass. I also made sure that no reference to java.lang.Class instances escape to java code before the related class is linked. This should make the VM more robust in face of weaker java code. Laurent, you can try the staging snapshot (staging+2298) in: http://www.info.uqam.ca/~egagnon/staging and report your findings. :-) Thanks a lot for the bug report! Etienne Etienne Gagnon wrote: > Hmmm... > > Laurent Martelli wrote: > >> It's not really a small test case since it relies on Jetty, but it >> triggers ... > > > Somehow, the isAssignableFrom is called at a time when OutputStreamLogSink > is not yet *prepared* (this is even before initialization!). As > preparation > is where the appropriate structures are created for doing constant-time > instanceof checks, it explains why the check fails (as the data used for > the check is invalid). > > So, some code lets a Class reference escape prior to preparation! This > must > be fixed... This will require some hunting. > > Feel free to help. To do so, reconfigure and recompile sablevm: > > $ cd sablevm-staging-... > $ ./configure --enable-debugging-features # then any other option use > previously used > $ make clean > $ make > $ make install > > then, I recommend that you use ddd to debug sablevm: > > $ ddd path-to../bin/sablevm & > > [on Debian, you simply: > $ apt-get install ddd > ] > > Have fun! > > Etienne > -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: David <db...@cs...> - 2004-05-21 21:02:54
|
On Fri, May 21, 2004 at 01:36:07PM -0400, Etienne Gagnon wrote: > I wonder... >=20 > David B=E9langer wrote: > >>- if (isPrimitive() || isArray() || isInterface()) > >>+ if (isPrimitive() || isArray()) > > > >This is the correct fix and will make it in SableVM/staging version. >=20 > Wouldn't the following be the correct fix? >=20 > - if (isPrimitive() || isArray() || isInterface()) > + if (isPrimitive()) >=20 > Arrays inherit from java.lang.Object, so they have methods, isn't it? >=20 Yes, but getDeclaredMethods returns only methods declared by the type, not all methods inherited. Arrays do not declare them and the spec says it should return an empty array of Methods if it is an array type. If getMethods() is called (for all methods), it should correctly figure out that the superclass of the array type is Object and collect them. David --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Etienne G. <gag...@uq...> - 2004-05-21 19:52:18
|
Hmmm... Laurent Martelli wrote: > It's not really a small test case since it relies on Jetty, but it > triggers >... Somehow, the isAssignableFrom is called at a time when OutputStreamLogSink is not yet *prepared* (this is even before initialization!). As preparation is where the appropriate structures are created for doing constant-time instanceof checks, it explains why the check fails (as the data used for the check is invalid). So, some code lets a Class reference escape prior to preparation! This must be fixed... This will require some hunting. Feel free to help. To do so, reconfigure and recompile sablevm: $ cd sablevm-staging-... $ ./configure --enable-debugging-features # then any other option use previously used $ make clean $ make $ make install then, I recommend that you use ddd to debug sablevm: $ ddd path-to../bin/sablevm & [on Debian, you simply: $ apt-get install ddd ] Have fun! Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Laurent M. <la...@ao...> - 2004-05-21 18:44:31
|
>>>>> "Laurent" == Laurent Martelli <la...@ao...> writes: [...] Laurent> I suspect it's classloader related because this small test Laurent> is passed Or maybe not. I've put some traces in Jetty and it turns that the class loader of both classes is gnu.java.lang.SystemClassLoader@14944. Anyway, the location of the problem in Jetty is org.mortbay..util.Log line 96. -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Laurent M. <la...@ao...> - 2004-05-21 18:10:59
|
I suspect it's classloader related because this small test is passed (it's a copy of the jetty code that triggers the above bug): |
From: Etienne G. <gag...@uq...> - 2004-05-21 17:46:58
|
I wonder... David B=E9langer wrote: >>- if (isPrimitive() || isArray() || isInterface()) >>+ if (isPrimitive() || isArray()) >=20 > This is the correct fix and will make it in SableVM/staging version. Wouldn't the following be the correct fix? - if (isPrimitive() || isArray() || isInterface()) + if (isPrimitive()) Arrays inherit from java.lang.Object, so they have methods, isn't it? Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Laurent M. <la...@ao...> - 2004-05-21 17:40:29
|
laurent@stan:~/tmp$ sablevm -Y Loader java/lang/Integer.class -> null laurent@stan:~/tmp$ java Loader java/lang/Integer.class -> java.util.zip.ZipFile$ZipFileInputStream@14fe5c -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Etienne G. <gag...@uq...> - 2004-05-21 16:28:37
|
Laurent Martelli wrote: > I think java.lang.Class.getDeclaredMethods() should rather look like this: > > Method[] getDeclaredMethods (boolean publicOnly) > { > - if (isPrimitive() || isArray() || isInterface()) > + if (isPrimitive() || isArray()) > { > return new Method[] { }; > } > else > { > return VMClass.getDeclaredMethods(this, publicOnly); > } > } This makes sense. I have checked that code in staging, but it would be nice if you could actually test it. I have put packages for you to test on: http://www.info.uqam.ca/~egagnon/sablevm/ Please let us know it it works. Thanks! Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: David <db...@cs...> - 2004-05-21 16:25:28
|
On Fri, May 21, 2004 at 12:21:25PM +0200, Laurent Martelli wrote: > >>>>> "Grzegorz" =3D=3D Grzegorz B Prokopski <ga...@de...> writes: >=20 > Grzegorz> On (19/05/04 14:19), Laurent Martelli wrote: > >> Hello, > >>=20 > >> java.lang.Class.getMethods() returns an empty for interfaces with > >> sablevm 1.1.4. Is it a known bug/limitation ? >=20 > Grzegorz> I have looked at the code of Classpath and functions > Grzegorz> called into the VM and it seems that this should be > Grzegorz> handled. I presume it's a bug then. >=20 > Grzegorz> Could somebody more insightful take a look at that? >=20 > I think java.lang.Class.getDeclaredMethods() should rather look like th= is: >=20 > Method[] getDeclaredMethods (boolean publicOnly) > { > - if (isPrimitive() || isArray() || isInterface()) > + if (isPrimitive() || isArray()) > { > return new Method[] { }; > } > else > { > return VMClass.getDeclaredMethods(this, publicOnly); > } > } Hi Laurent, This is the correct fix and will make it in SableVM/staging version. Thanks, David --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |
From: Etienne G. <gag...@UQ...> - 2004-05-21 16:13:19
|
Hi Laurent, Laurent Martelli wrote: > I think the following implementation of > java.lang.isAssignableFrom(Class) should be OK for primitive types too: > > public boolean isAssignableFrom(Class c) > { > if (c == null) { > throw new NullPointerException(); > } else if (this.isPrimitive() || c.isPrimitive()) { > return this == c; > } else { > return VMClass.isAssignableFrom (this, c); > } > } Applied in staging. Thanks! Little request for future patches... Usually, the preferred form of patches is what is called "unified diffs". You get such a thing by running diff with the -u option, e.g.: diff -u original_file modified_file Thanks, Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Etienne G. <gag...@UQ...> - 2004-05-21 16:13:16
|
Hi Laurent, Laurent Martelli wrote: > I've just tried it and have a problem: > java.lang.ClassLoader.getResourceAsStream("gnu/java/io/decode/Decoder8859_1.class") > returns null. I encounter this because my application has custom class > loader. I can work around it, but I think it's a bug anyway. Again, could you provide a simple test program that exhibits the bug. (e.g. a Test.java file that can be compiled and run exhibiting the bug). Thanks, Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Etienne G. <gag...@uq...> - 2004-05-21 16:02:56
|
Laurent Martelli wrote: > I have a framework (http://jac.objectweb.org/) which uses Jetty to > provide a web frontend for applications (via servlets). I almost have > this running with sablevm but I have these exception: >... > Our framework use a custom classloader, so my guess is that problems > may arise from this in java.lang.Class.isAssignableFrom(). Could you provide a small test case that fails, to help us identify the bug? Thanks, Etienne -- Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Laurent M. <la...@ao...> - 2004-05-21 15:36:12
|
>>>>> "Chris" == Chris Pickett <chr...@ma...> writes: Chris> Chris Pickett wrote: >> Laurent Martelli wrote: >>> I think java.lang.Class.getDeclaredMethods() should rather look >>> like this: >>> >>> Method[] getDeclaredMethods (boolean publicOnly) { - if >>> (isPrimitive() || isArray() || isInterface()) + if >>> (isPrimitive() || isArray()) { return new Method[] { }; >>> } >>> else { return VMClass.getDeclaredMethods(this, publicOnly); >>> } >>> } >> In the meantime, for the above, you can take a look at >> VMClass.getDeclaredMethods() in >> sablevm/src/libsablevm/java_lang_VMClass.c and maybe you'll find >> the problem. Chris> That's a silly answer from me, because you're suggesting the Chris> problem is with GNU Classpath, not SableVM. Does it work for Chris> you if you make the above change to Classpath? Yes it does. -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Chris P. <chr...@ma...> - 2004-05-21 14:24:54
|
Chris Pickett wrote: > Laurent Martelli wrote: >> >>I think java.lang.Class.getDeclaredMethods() should rather look like this: >> >> Method[] getDeclaredMethods (boolean publicOnly) >> { >>- if (isPrimitive() || isArray() || isInterface()) >>+ if (isPrimitive() || isArray()) >> { >> return new Method[] { }; >> } >> else >> { >> return VMClass.getDeclaredMethods(this, publicOnly); >> } >> } > > In the meantime, for the above, you can take a look at > VMClass.getDeclaredMethods() in > sablevm/src/libsablevm/java_lang_VMClass.c and maybe you'll find the > problem. That's a silly answer from me, because you're suggesting the problem is with GNU Classpath, not SableVM. Does it work for you if you make the above change to Classpath? Cheers, Chris |
From: Chris P. <chr...@ma...> - 2004-05-21 13:54:31
|
Laurent Martelli wrote: >>>>>>"Grzegorz" == Grzegorz B Prokopski <ga...@de...> writes: > > > Grzegorz> On (19/05/04 14:19), Laurent Martelli wrote: > >> Hello, > >> > >> java.lang.Class.getMethods() returns an empty for interfaces with > >> sablevm 1.1.4. Is it a known bug/limitation ? > > Grzegorz> I have looked at the code of Classpath and functions > Grzegorz> called into the VM and it seems that this should be > Grzegorz> handled. I presume it's a bug then. > > Grzegorz> Could somebody more insightful take a look at that? > > I think java.lang.Class.getDeclaredMethods() should rather look like this: > > Method[] getDeclaredMethods (boolean publicOnly) > { > - if (isPrimitive() || isArray() || isInterface()) > + if (isPrimitive() || isArray()) > { > return new Method[] { }; > } > else > { > return VMClass.getDeclaredMethods(this, publicOnly); > } > } > > I though I had already sen this to the list, but I've been using gmane > and there seems to be a delay. Hi Laurent, I never got this java.lang.getDeclaredMethods() patch before and I'm subscribed to sab...@li.... I did however get a suggestion for java.lang.isAssignableFrom(). I'm not a Classpath hacker, so you'll need to wait for a response from Etienne or David about that. In the meantime, for the above, you can take a look at VMClass.getDeclaredMethods() in sablevm/src/libsablevm/java_lang_VMClass.c and maybe you'll find the problem. Also, if you want to get a recent "staging" branch of both sablevm and sablevm-classpath (this is the first-level shared developer branch), you can follow the instructions here: http://devel.sablevm.org/wiki/Getting Cheers, Chris |
From: Laurent M. <la...@ao...> - 2004-05-21 10:21:32
|
>>>>> "Grzegorz" == Grzegorz B Prokopski <ga...@de...> writes: Grzegorz> On (19/05/04 14:19), Laurent Martelli wrote: >> Hello, >> >> java.lang.Class.getMethods() returns an empty for interfaces with >> sablevm 1.1.4. Is it a known bug/limitation ? Grzegorz> I have looked at the code of Classpath and functions Grzegorz> called into the VM and it seems that this should be Grzegorz> handled. I presume it's a bug then. Grzegorz> Could somebody more insightful take a look at that? I think java.lang.Class.getDeclaredMethods() should rather look like this: Method[] getDeclaredMethods (boolean publicOnly) { - if (isPrimitive() || isArray() || isInterface()) + if (isPrimitive() || isArray()) { return new Method[] { }; } else { return VMClass.getDeclaredMethods(this, publicOnly); } } I though I had already sen this to the list, but I've been using gmane and there seems to be a delay. -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Grzegorz B. P. <ga...@de...> - 2004-05-21 03:54:53
|
On (19/05/04 14:19), Laurent Martelli wrote: > Hello, > > java.lang.Class.getMethods() returns an empty for interfaces with > sablevm 1.1.4. Is it a known bug/limitation ? I have looked at the code of Classpath and functions called into the VM and it seems that this should be handled. I presume it's a bug then. Could somebody more insightful take a look at that? GBP PS: I am not of much help these days, but it'll change RSN. -- Grzegorz B. Prokopski <ga...@de...> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Why SableVM ?!? http://devel.sablevm.org/wiki/WhySableVM |
From: Chris P. <chr...@ma...> - 2004-05-20 20:13:21
|
Hi, Currently I have all of my types declared inside #ifdef ... #endif pairs. However, it would be nice if I could use the m4 macros to manage memory and splay trees (and possibly others too). What is the best way to do this? Create my own versions of the necessary files? Or remove the restriction that everything belonging to me be inside an #ifdef ... #endif pair, as long as VM functionality does not change? Cheers, Chris |
From: Laurent M. <la...@ao...> - 2004-05-19 14:59:43
|
I have a framework (http://jac.objectweb.org/) which uses Jetty to provide a web frontend for applications (via servlets). I almost have this running with sablevm but I have these exception: class org.mortbay.util.OutputStreamLogSink is not a org.mortbay.util.LogSink 1084973010357: EVENT ,Starting Jetty/4.2.x,[Main-1]org.mortbay.util.Log.event(Log.java:248) 1084973010512: EVENT ,Started HttpContext[/jac/resources],[Main-1]org.mortbay.util.Log.event(Log.java:248) 1084973010542: EVENT ,Started SocketListener on 0.0.0.0:8088,[Main-1]org.mortbay.util.Log.event(Log.java:248) 2004-05-19 13:23:30,554 ERROR gui.display: Failed to start webgui : org.mortbay.util.MultiException[java.lang.IllegalStateException: Servlet class org.objectweb.jac.aspects.gui.web.JacLocalServlet is not a javax.servlet.Servlet] 2004-05-19 13:23:30,562 ERROR gui.display: Check that another server is not running on port 8088 Our framework use a custom classloader, so my guess is that problems may arise from this in java.lang.Class.isAssignableFrom(). -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Laurent M. <la...@ao...> - 2004-05-19 13:20:44
|
Hi, I think the following implementation of java.lang.isAssignableFrom(Class) should be OK for primitive types too: public boolean isAssignableFrom(Class c) { if (c == null) { throw new NullPointerException(); } else if (this.isPrimitive() || c.isPrimitive()) { return this == c; } else { return VMClass.isAssignableFrom (this, c); } } -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Laurent M. <la...@ao...> - 2004-05-19 12:19:34
|
Hello, java.lang.Class.getMethods() returns an empty for interfaces with sablevm 1.1.4. Is it a known bug/limitation ? -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Laurent M. <la...@ao...> - 2004-05-19 10:30:46
|
>>>>> "Etienne" == Etienne Gagnon <gag...@uq...> writes: Etienne> The developers of the SableVM Project are proud to announce Etienne> the official release of SableVM 1.1.4. SableVM is a Etienne> liberally licensed Free Java Virtual Machine. See the Etienne> "About SableVM" section below for more informations about Etienne> SableVM. I've just tried it and have a problem: java.lang.ClassLoader.getResourceAsStream("gnu/java/io/decode/Decoder8859_1.class") returns null. I encounter this because my application has custom class loader. I can work around it, but I think it's a bug anyway. Regards, Laurent -- Laurent Martelli la...@ao... Java Aspect Components http://www.aopsys.com/ http://jac.objectweb.org |
From: Etienne G. <gag...@uq...> - 2004-05-17 03:37:30
|
David B=E9langer wrote: > The recent CP --disable-java "fix" prevents the installation of java > classes as both if condition in the lib/Makefile.am are not both true > for SableVM. So, I screwed up... > Could not really figure out how the BUILD_GLIBJ_ZIP is used to disable > java, it is unused in that Makefile.am. This variable makes no sense; it should probably be INSTALL_GLIB_ZIP. Anyway, as sablevm does not yet support zip files, I simple disabled CLASSPATH_WITH_GLIBJ, and directly set INSTALL_CLASS_FILES appropriately.= Please let me know if something's still wrong. Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: David <db...@cs...> - 2004-05-17 01:21:22
|
Hi, The recent CP --disable-java "fix" prevents the installation of java classes as both if condition in the lib/Makefile.am are not both true for SableVM. Could not really figure out how the BUILD_GLIBJ_ZIP is used to disable java, it is unused in that Makefile.am. David --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |