Skip to content

Commit d4e3e69

Browse files
committed
8293344: JDK-8242181 broke stack printing for non-attached threads
Reviewed-by: chagedorn, mdoerr
1 parent 2c61efe commit d4e3e69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/hotspot/share/utilities/elfFile.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "jvm_io.h"
3535
#include "logging/log.hpp"
3636
#include "memory/allocation.inline.hpp"
37-
#include "memory/resourceArea.hpp"
3837
#include "utilities/decoder.hpp"
3938
#include "utilities/elfFile.hpp"
4039
#include "utilities/elfFuncDescTable.hpp"
@@ -260,7 +259,7 @@ int ElfFile::section_by_name(const char* name, Elf_Shdr& hdr) {
260259
assert(name != NULL, "No section name");
261260
size_t len = strlen(name) + 1;
262261
ResourceMark rm;
263-
char* buf = NEW_RESOURCE_ARRAY(char, len);
262+
char* buf = (char*)os::malloc(len, mtInternal);
264263
if (buf == NULL) {
265264
return -1;
266265
}
@@ -282,6 +281,9 @@ int ElfFile::section_by_name(const char* name, Elf_Shdr& hdr) {
282281
}
283282
}
284283
}
284+
285+
os::free(buf);
286+
285287
return sect_index;
286288
}
287289
#endif
@@ -350,7 +352,6 @@ ElfStringTable* ElfFile::get_string_table(int index) {
350352
// Use unified logging to report errors rather than assert() throughout this method as this code is already part of the error reporting
351353
// and the debug symbols might be in an unsupported DWARF version or wrong format.
352354
bool ElfFile::get_source_info(const uint32_t offset_in_library, char* filename, const size_t filename_len, int* line, bool is_pc_after_call) {
353-
ResourceMark rm;
354355
if (!load_dwarf_file()) {
355356
// Some ELF libraries do not provide separate .debuginfo files. Check if the current ELF file has the required
356357
// DWARF sections. If so, treat the current ELF file as DWARF file.

0 commit comments

Comments
 (0)