RFR (XS) 8009026 [parfait] Null pointer deference in hotspot/src/share/vm/code/nmethod.cpp
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Mar 14 10:15:02 PDT 2013
This is incorrect.
You can't use guarantee() in CodeCache::allocate() because it is also
used for adapters allocation.
Can you put guarantee() into nmethod::operator new()?:
void* nmethod::operator new(size_t size, int nmethod_size) {
void* alloc = CodeCache::allocate(nmethod_size);
guarantee(alloc != NULL, "CodeCache should have enough space");
return alloc;
}
And add checks around "new(size) nmethod()" calls (3 cases) in nmethod.cpp:
if (CodeCache::largest_free_block() > (CodeCacheMinimumFreeSpace +
size)) {
Vladimir
On 3/14/13 8:18 AM, Morris Meyer wrote:
> Folks,
>
> Could I get a quick review for these fixes for parfait null pointer
> issues? This has been through JPRT.
>
> Thanks in advance,
>
> --morris meyer
>
> WEBREV - http://cr.openjdk.java.net/~morris/8009026.01
> JIRA - https://jbs.oracle.com/bugs/browse/JDK-8009026
>
More information about the hotspot-compiler-dev
mailing list