Thanks very much Allan for finding the bug and fixing it!<div><br></div><div>About checking for allocation failure, we should definitely not check at this place but in the allocator, and just die if the allocation fails. The previous code is a left-over of some attempts to cope with exception handling.</div>
<div><br></div><div>For the hash map of UTF8, you are right: we want to avoid creating an UTF8 in the map if it is not needed. The reason why we have this limitation is to implement class loader isolation, so that one class loader can not pollute the map of another class loader.</div>
<div><br></div><div>Nicolas</div><div><br><div class="gmail_quote">On Sun, Aug 8, 2010 at 8:59 AM, Allan Tong <span dir="ltr"><<a href="mailto:actong88@gmail.com">actong88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Attached patch fixes a regression caused by replacing alloca with<br>
ThreadAllocator.  The threadAllocator goes out of scope too early,<br>
causing the temporary UTF8 object to be freed prematurely before it<br>
has actually had a chance to be used.<br>
<br>
Note I also removed the allocation failure check, mostly because it<br>
doesn't seem to be possible for ThreadAllocator to return a NULL (or<br>
at least it'll segfault long before returning).  I'm not really sure<br>
what the strategy is for handling allocation failures.  It seems most<br>
of the code base simply ignores that possibility.  If you do choose to<br>
keep the allocation failure check, at the very least it should be<br>
moved ahead of the temp->size assignment.<br>
<br>
I had an earlier patch that simply replaced the whole thing with a<br>
call to asciizConstructUTF8, but I wasn't sure if that was correct<br>
since it would hash the name even if it couldn't find the class.  Is<br>
hashUTF8 only supposed to map strings of classes that are actually<br>
loaded?<br>
<font color="#888888"><br>
 - Allan<br>
</font><br>_______________________________________________<br>
vmkit-commits mailing list<br>
<a href="mailto:vmkit-commits@cs.uiuc.edu">vmkit-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits</a><br>
<br></blockquote></div><br></div>