8194246: JVM crashes when calling getStackTrace if stack contains a method that is a member of a very large class

Use unsigned short to save method_id in stack trace.

Reviewed-by: mchung, hseigel
This commit is contained in:
Coleen Phillimore 2018-01-29 11:55:40 -05:00
parent b2609808df
commit 5672dfedd4
2 changed files with 151 additions and 2 deletions

View file

@ -1702,7 +1702,7 @@ class BacktraceBuilder: public StackObj {
method = mhandle();
}
_methods->short_at_put(_index, method->orig_method_idnum());
_methods->ushort_at_put(_index, method->orig_method_idnum());
_bcis->int_at_put(_index, Backtrace::merge_bci_and_version(bci, method->constants()->version()));
// Note:this doesn't leak symbols because the mirror in the backtrace keeps the
@ -1756,7 +1756,7 @@ class BacktraceIterator : public StackObj {
BacktraceElement next(Thread* thread) {
BacktraceElement e (Handle(thread, _mirrors->obj_at(_index)),
_methods->short_at(_index),
_methods->ushort_at(_index),
Backtrace::version_at(_bcis->int_at(_index)),
Backtrace::bci_at(_bcis->int_at(_index)),
_names->symbol_at(_index));