From: Steve B. (JIRA) <ji...@co...> - 2009-08-30 11:28:54
|
[ http://jira.codehaus.org/browse/RVM-851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=189108#action_189108 ] Steve Blackburn commented on RVM-851: ------------------------------------- Dingwen Yuan: Thanks, that is very helpful. Nice work. Daniel: Please see my posts above. I had already tested against head (and 3.0.1) and could not reproduce. Given Dingwen Yuan's experience, I have just gone and tested against 3.1.0 and I CAN reproduce the problem on 3.1.0. I then went and tested against the specific revision Andreas cited in his second post (15768). I do not see the problem. I looked further to narrow the window between the head and 3.1.0 and established that the problem disappears from r15717 onward. This is no co-incidence since this was Robin fixing a static initialization loop (see the commit message)! http://jikesrvm.svn.sourceforge.net/viewvc/jikesrvm?view=rev&revision=15717 So Andreas, you should either use Dingwen's work-around or use revisions subsequent to 15716 (I don't understand the experience you have for 15768---I can't reproduce that, see below). I am now closing the issue on account of Robin's pre-existing fix in 15717. ===================== Results ===================== Total Success Rate 11/11 Subversion Revision: 15768M =================================================== steveb@coyote:/tmp/jikesrvm$ svn diff Index: rvm/src/org/jikesrvm/compilers/baseline/ia32/BaselineCompilerImpl.java =================================================================== --- rvm/src/org/jikesrvm/compilers/baseline/ia32/BaselineCompilerImpl.java (revision 15768) +++ rvm/src/org/jikesrvm/compilers/baseline/ia32/BaselineCompilerImpl.java (working copy) @@ -3241,14 +3241,14 @@ int whichAllocator = MemoryManager.pickAllocator(typeRef, method); int align = ObjectModel.getAlignment(typeRef, false); int offset = ObjectModel.getOffsetForAlignment(typeRef, false); - int site = MemoryManager.getAllocationSite(true); + // int site = MemoryManager.getAllocationSite(true); asm.emitPUSH_Imm(instanceSize); asm.emitPUSH_Abs(Magic.getTocPointer().plus(tibOffset)); // put tib on stack asm.emitPUSH_Imm(typeRef.hasFinalizer() ? 1 : 0); // does the class have a finalizer? asm.emitPUSH_Imm(whichAllocator); asm.emitPUSH_Imm(align); asm.emitPUSH_Imm(offset); - asm.emitPUSH_Imm(site); + asm.emitPUSH_Imm(42); genParameterRegisterLoad(asm, 7); // pass 7 parameter words asm.emitCALL_Abs(Magic.getTocPointer().plus(Entrypoints.resolvedNewScalarMethod.getOffset())); asm.emitPUSH_Reg(T0); > MemoryManager.getAllocationSite: Bug waiting to happen > ------------------------------------------------------ > > Key: RVM-851 > URL: http://jira.codehaus.org/browse/RVM-851 > Project: RVM > Issue Type: Bug > Affects Versions: 3.1.0 > Environment: Jikes RVM 3.0.1 (r15707), ia32-linux, prototype-opt > Reporter: Andreas Sewe > Assignee: Steve Blackburn > Priority: Minor > Attachments: BaselineCompilerImpl.java.patch, rvm.patch > > > This is not yet a bug, but it certainly looks like a bug waiting to happen: If one removes the call to {{MemoryManager.getAllocationSite(true)}} in {{BaselineCompilerImpl}} (as the site ID is currently not used anyway) and instead passes a constant to the corresponding entrypoint method (we tested this with {{resolvedNewScalar}}), the RVM hangs upon the first allocation while still in {{finishBooting}}, throwing an {{OutOfMemoryException}}. > Exception in thread "Jikes_RBoot_Thread": java.lang.OutOfMemoryError > at java.lang.String.toCharArray(String.java:1742) > at java.lang.String.replace(String.java:1307) > at org.jikesrvm.VM.runClassInitializer(VM.java:527) > at org.jikesrvm.VM.finishBooting(VM.java:403) > at org.jikesrvm.VM.boot(VM.java:145) > The attached patch is a two line change that makes this bug occur. > My guess is that this method call, which the patch removes, implicitly encodes a dependency on {{Plan}} (the class which ultimately does the work for {{getAllocationSite}}). If this is the case, it should rather be made explicit, as it sooner or later will bite you -- just as it bit us. :-( -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |