changeset 12309:7c695e0b87d0

8169551: Segfaults in error traces when module version is null Summary: Make sure module->version() is not null before dereferencing it. Reviewed-by: coleenp, gtriantafill, lfoltan
author hseigel
date Tue, 15 Nov 2016 08:34:56 -0500
parents cfd9e8c96d1d
children f6c1979096f3
files src/share/vm/runtime/frame.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/frame.cpp	Tue Nov 15 15:30:03 2016 +0300
+++ b/src/share/vm/runtime/frame.cpp	Tue Nov 15 08:34:56 2016 -0500
@@ -664,8 +664,10 @@
         if (module->is_named()) {
           module->name()->as_C_string(buf, buflen);
           st->print(" %s", buf);
-          module->version()->as_C_string(buf, buflen);
-          st->print("@%s", buf);
+          if (module->version() != NULL) {
+            module->version()->as_C_string(buf, buflen);
+            st->print("@%s", buf);
+          }
         }
       } else {
         st->print("j  " PTR_FORMAT, p2i(pc()));
@@ -694,8 +696,10 @@
         if (module->is_named()) {
           module->name()->as_C_string(buf, buflen);
           st->print(" %s", buf);
-          module->version()->as_C_string(buf, buflen);
-          st->print("@%s", buf);
+          if (module->version() != NULL) {
+            module->version()->as_C_string(buf, buflen);
+            st->print("@%s", buf);
+          }
         }
         st->print(" (%d bytes) @ " PTR_FORMAT " [" PTR_FORMAT "+" INTPTR_FORMAT "]",
                   m->code_size(), p2i(_pc), p2i(_cb->code_begin()), _pc - _cb->code_begin());