# HG changeset patch # User mbaesken # Date 1538119246 -7200 # Node ID 1d12935177ed681de91d9b79ec6e678645427992 # Parent 0f7d0bb6cfe26bfd396f485988999c00988e5cec 8210964: add more ld preloading related info to hs_error file on Linux Reviewed-by: clanger, stuefe diff -r 0f7d0bb6cfe2 -r 1d12935177ed src/hotspot/os/linux/os_linux.cpp --- a/src/hotspot/os/linux/os_linux.cpp Thu Sep 27 15:56:40 2018 -0700 +++ b/src/hotspot/os/linux/os_linux.cpp Fri Sep 28 09:20:46 2018 +0200 @@ -1877,12 +1877,16 @@ return (void*)::dlopen(NULL, RTLD_LAZY); } -static bool _print_ascii_file(const char* filename, outputStream* st) { +static bool _print_ascii_file(const char* filename, outputStream* st, const char* hdr = NULL) { int fd = ::open(filename, O_RDONLY); if (fd == -1) { return false; } + if (hdr != NULL) { + st->print_cr("%s", hdr); + } + char buf[33]; int bytes; buf[32] = '\0'; @@ -1975,6 +1979,8 @@ os::Linux::print_proc_sys_info(st); + os::Linux::print_ld_preload_file(st); + os::Linux::print_container_info(st); } @@ -2133,6 +2139,11 @@ st->cr(); } +void os::Linux::print_ld_preload_file(outputStream* st) { + _print_ascii_file("/etc/ld.so.preload", st, "\n/etc/ld.so.preload:"); + st->cr(); +} + void os::Linux::print_container_info(outputStream* st) { if (!OSContainer::is_containerized()) { return; diff -r 0f7d0bb6cfe2 -r 1d12935177ed src/hotspot/os/linux/os_linux.hpp --- a/src/hotspot/os/linux/os_linux.hpp Thu Sep 27 15:56:40 2018 -0700 +++ b/src/hotspot/os/linux/os_linux.hpp Fri Sep 28 09:20:46 2018 +0200 @@ -114,6 +114,7 @@ static void print_distro_info(outputStream* st); static void print_libversion_info(outputStream* st); static void print_proc_sys_info(outputStream* st); + static void print_ld_preload_file(outputStream* st); public: static bool _stack_is_executable;