8198845: Missing resource mark results disassembling generated code failure in hs error report
authorzgu
Sun, 04 Mar 2018 20:57:46 -0500
changeset 49334 aefee96e2b90
parent 49333 489f1dd40582
child 49335 3271310a6af7
8198845: Missing resource mark results disassembling generated code failure in hs error report Summary: Fixed secondary failure due to missing resource mark while disassembling nmethod Reviewed-by: coleenp, stuefe, dholmes
src/hotspot/share/utilities/vmError.cpp
--- a/src/hotspot/share/utilities/vmError.cpp	Sat Mar 03 23:56:08 2018 -0500
+++ b/src/hotspot/share/utilities/vmError.cpp	Sun Mar 04 20:57:46 2018 -0500
@@ -29,6 +29,7 @@
 #include "compiler/disassembler.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "logging/logConfiguration.hpp"
+#include "memory/resourceArea.hpp"
 #include "prims/whitebox.hpp"
 #include "runtime/arguments.hpp"
 #include "runtime/atomic.hpp"
@@ -773,7 +774,10 @@
            if (desc != NULL) {
              desc->print_on(st);
              Disassembler::decode(desc->begin(), desc->end(), st);
-           } else {
+           } else if (_thread != NULL) {
+             // Disassembling nmethod will incur resource memory allocation,
+             // only do so when thread is valid.
+             ResourceMark rm(_thread);
              Disassembler::decode(cb, st);
              st->cr();
            }