代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-1.8.0 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Date: Thu, 8 Jun 2023 20:47:32 +0800
Subject: [PATCH 33/59] 8211326: add OS user related information to hs_err file
Bug url: https://bugs.openjdk.org/browse/JDK-8211326
---
hotspot/src/os/posix/vm/os_posix.cpp | 33 ++++++++++++++++++++++
hotspot/src/os/posix/vm/os_posix.hpp | 3 ++
hotspot/src/share/vm/utilities/vmError.cpp | 8 ++++++
3 files changed, 44 insertions(+)
diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp
index 678a1059f..189c8b411 100644
--- a/hotspot/src/os/posix/vm/os_posix.cpp
+++ b/hotspot/src/os/posix/vm/os_posix.cpp
@@ -33,6 +33,8 @@
#include <unistd.h>
#include <sys/resource.h>
#include <sys/utsname.h>
+#include <grp.h>
+#include <pwd.h>
#include <pthread.h>
#include <signal.h>
@@ -233,6 +235,37 @@ void os::Posix::print_uname_info(outputStream* st) {
st->cr();
}
+void os::Posix::print_umask(outputStream* st, mode_t umsk) {
+ st->print((umsk & S_IRUSR) ? "r" : "-");
+ st->print((umsk & S_IWUSR) ? "w" : "-");
+ st->print((umsk & S_IXUSR) ? "x" : "-");
+ st->print((umsk & S_IRGRP) ? "r" : "-");
+ st->print((umsk & S_IWGRP) ? "w" : "-");
+ st->print((umsk & S_IXGRP) ? "x" : "-");
+ st->print((umsk & S_IROTH) ? "r" : "-");
+ st->print((umsk & S_IWOTH) ? "w" : "-");
+ st->print((umsk & S_IXOTH) ? "x" : "-");
+}
+
+void os::Posix::print_user_info(outputStream* st) {
+ unsigned id = (unsigned) ::getuid();
+ st->print("uid : %u ", id);
+ id = (unsigned) ::geteuid();
+ st->print("euid : %u ", id);
+ id = (unsigned) ::getgid();
+ st->print("gid : %u ", id);
+ id = (unsigned) ::getegid();
+ st->print_cr("egid : %u", id);
+ st->cr();
+
+ mode_t umsk = ::umask(0);
+ (void)::umask(umsk);
+ st->print("umask: %04o (", (unsigned) umsk);
+ print_umask(st, umsk);
+ st->print_cr(")");
+ st->cr();
+}
+
bool os::has_allocatable_memory_limit(julong* limit) {
struct rlimit rlim;
int getrlimit_res = getrlimit(RLIMIT_AS, &rlim);
diff --git a/hotspot/src/os/posix/vm/os_posix.hpp b/hotspot/src/os/posix/vm/os_posix.hpp
index d3e55d020..0d29bfbaf 100644
--- a/hotspot/src/os/posix/vm/os_posix.hpp
+++ b/hotspot/src/os/posix/vm/os_posix.hpp
@@ -69,6 +69,9 @@ public:
// effective gid, or if given uid is root.
static bool matches_effective_uid_and_gid_or_root(uid_t uid, gid_t gid);
+ static void print_umask(outputStream* st, mode_t umsk);
+
+ static void print_user_info(outputStream* st);
};
/*
diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp
index 351c21200..44562fe36 100644
--- a/hotspot/src/share/vm/utilities/vmError.cpp
+++ b/hotspot/src/share/vm/utilities/vmError.cpp
@@ -713,6 +713,14 @@ void VMError::report(outputStream* st) {
st->cr();
}
+#ifndef _WIN32
+ STEP(165, "(printing user info)" )
+
+ if (ExtensiveErrorReports && _verbose) {
+ os::Posix::print_user_info(st);
+ }
+#endif
+
STEP(170, "(printing all threads)" )
// all threads
--
2.22.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。