JVM crashes when adding more than 2 methods to java.lang.Object

Guillaume Pothier gpothier at gmail.com
Wed Apr 28 12:12:22 PDT 2010


Thanks a lot for your reply. I forgot to mention that I'm adding the
methods either through instrumentation using a native JVMTI agent, or
by providing the modified Object class file using the
-Xbootclasspath/p command line option (both techniques yielding the
same results). Wouldn't that count as occurring before JVM bootstrap?
I'll ask on serviceability-dev, but in the mean time any insight would
be appreciated.
Yours,
g


On Wed, Apr 28, 2010 at 2:09 PM, Tom Rodriguez <tom.rodriguez at oracle.com> wrote:
> I didn't think we supporting redefining Object and adding public methods after JVM bootstrap.  Adding methods to classes which are already loaded with subclasses means that you have to generate new vtables for all subclasses and as far as I know we don't do that.  You might get more answer over on serviceability-dev.
>
> tom
>
> On Apr 24, 2010, at 1:30 PM, Guillaume Pothier wrote:
>
>> Hi,
>> First of all I hope it is appropriate to ask this kind of question in
>> this list, otherwise what would be the correct forum?
>> Here is my problem: I'm adding public, non-native methods to the
>> Object class through instrumentation, and it seems that adding more
>> than 2 such methods causes the JVM to crash. I get different kinds of
>> crashes depending on the number of methods I add. With 3 and 4 methods
>> I get a SIGSEGV; with more methods I get an NPE during VM
>> initialization (in String.charAt). For testing purposes, all added
>> methods take no arguments and return void, and have an empty body
>> (only the RETURN bytecode).
>> Is that expected behavior? Is there something I can do about it?
>> Kind regards,
>> Guillaume Pothier
>> PhD student, University of Chile
>
>


More information about the hotspot-dev mailing list