Using -XX:+PrintNMethods -XX:+PrintRelocations crashes the VM.
If we're running with "PrintNMethods" (which is as debug option) a call to Relocation::code() in Relocation::method_value() may return NULL. We must check this and handle it appropriatly.
Also, if running with "-XX:+WizardMode", RelocIterator::print_current() calls oop->print_value_on() without checking if oop is actually a valid oop. This can be easily fixed by calling oop->is_oop() before calling oop->print_value_on().
If we're running with "PrintNMethods" (which is as debug option) a call to Relocation::code() in Relocation::method_value() may return NULL. We must check this and handle it appropriatly.
Also, if running with "-XX:+WizardMode", RelocIterator::print_current() calls oop->print_value_on() without checking if oop is actually a valid oop. This can be easily fixed by calling oop->is_oop() before calling oop->print_value_on().