RFR: 6294277 java -Xdebug crashes on SourceDebugExtension attribute larger than 64K

Coleen Phillimore coleen.phillimore at oracle.com
Fri Jul 6 06:49:36 PDT 2012

Fred, This looks good.  I had one question

in jvmtiEnvi.cpp you allocate the source_debug_extension with:

+      *source_debug_extension_ptr = (char *) jvmtiMalloc(strlen(sde)+1);

But in instanceKlass.cpp you deallocate it with:

+  if (_source_debug_extension != NULL) FREE_C_HEAP_ARRAY(u1, _source_debug_extension, mtClass);

In classFileParser, cpp you set the field by pointing to the classfile 

    u1* sde_buffer = cfs->get_u1_buffer();

I don't know if the first two are consistent wrt native memory tracking, 
but the last one seems dangerous if you unload that class.   I think 
they should be allocated all the same with NEW_C_HEAP_ARRAY() so you can 
deallocate it that way in release_C_heap_structures.

The rest looks good.


On 7/5/2012 8:22 AM, Frederic Parain wrote:
> Greetings,
> The bug is described in details in the CR below.
> CR: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6294277
> Webrev: http://cr.openjdk.java.net/~fparain/6294277/webrev.00/
> Tested with JPRT, sajdi and quick-jvmti.
> Thanks,
> Fred

More information about the hotspot-runtime-dev mailing list