-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 17, 21, 22, 23
-
SELinux
-
b20
-
other
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8341022 | 21.0.6-oracle | Yagmur Eren | P4 | Resolved | Fixed | b01 |
JDK-8333550 | 21.0.5 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8341026 | 17.0.14-oracle | Yagmur Eren | P4 | Resolved | Fixed | b01 |
JDK-8333726 | 17.0.13 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8341034 | 11.0.26-oracle | Yagmur Eren | P4 | Resolved | Fixed | b01 |
JDK-8334039 | 11.0.25 | Aleksey Shipilev | P4 | Resolved | Fixed | b01 |
JDK-8341073 | 8u441 | Yagmur Eren | P4 | Resolved | Fixed | b01 |
The crash stack trace is as follows:
---
C [libc.so.6+0xf53cd] readdir+0x2d
V [libjvm.so+0x6d5a20] JfrOSInterface::initialize()+0xe0
V [libjvm.so+0x6e4a32] JfrRecorder::create_components()+0x1b2
V [libjvm.so+0x6e4b9d] JfrRecorder::create(bool)+0x1d
V [libjvm.so+0x6ce717] jfr_create_jfr+0x187
j jdk.jfr.internal.JVM.createJFR(Z)Z+0
j jdk.jfr.internal.JVM.createNativeJFR()V+3
j jdk.jfr.internal.PlatformRecorder.<init>()V+48
j jdk.jfr.FlightRecorder.getFlightRecorder()Ljdk/jfr/FlightRecorder;+25
j jdk.jfr.Recording.<init>(Ljava/util/Map;)V+4
j jdk.jfr.Recording.<init>()V+8
---
The crash is not specific to our profiler - any attempt to start JFR will trigger it.
The customer is using SELinux in a very restrictive setup. Eg. they deny access to `/proc` directory.
The issue is that in os_perf_linux.cpp (https://github.com/openjdk/jdk/blob/bab70193ddaae66a1f9039b0f1af1a0dc0e39cf9/src/hotspot/os/linux/os_perf_linux.cpp#L848) an attempt to open `/proc` dir is made but no error is expected.
Therefore, it that call fails, the `_dir` variable will be NULL and the subsequent call to `readdir(_dir)` (https://github.com/openjdk/jdk/blob/bab70193ddaae66a1f9039b0f1af1a0dc0e39cf9/src/hotspot/os/linux/os_perf_linux.cpp#L829) will crash.
- backported by
-
JDK-8333550 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8333726 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8334039 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8341022 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8341026 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8341034 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
-
JDK-8341073 Restricted access to `/proc` can cause JFR initialization to crash
-
- Resolved
-
- links to
-
Commit openjdk/jdk11u-dev/2ded016d
-
Commit openjdk/jdk17u-dev/a86a221d
-
Commit openjdk/jdk21u-dev/d87f5a39
-
Commit openjdk/jdk/a92ad039
-
Review openjdk/jdk11u-dev/2733
-
Review openjdk/jdk17u-dev/2516
-
Review openjdk/jdk21u-dev/634
-
Review openjdk/jdk/18775