When adding a RawPageSpace and doing many acquire() and release() calls, I sometimes get a crash because the following line in FreeListPageResource.freeContiguousChunk() fails, i.e., returns -1:
int tmp = freeList.alloc(Space.PAGES_IN_CHUNK, chunkStart); // then alloc the entire chunk
Many Log.write()s later
I think there may be a corner case in FreeListPageResource.releasePages() that needs slightly different handling. The attached patch eliminates the errors I was getting, but could an MMTk expert please check the change and verify that it's correct since I don't fully understand the code?
thanks,
Mike
Apologies for not looking at this earlier. Work on RVM-648 took me to the same bug :-/ I ended up refactoring and improving the code to make it a bit clearer.