<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 2024-03-14 09:49, Vitaly Provodin wrote:<br>
<blockquote type="cite" cite="mid:6C0488D6-45F2-4D88-84D4-994AC74746A2@jetbrains.com">
Stefan,
<div><br>
<blockquote type="cite">
<blockquote type="cite">With the patch the version string is
successfully printed - VM was not killed.<br>
</blockquote>
<br>
Did you run this on 14.4? Did you also run this on an AArch64
machine?<br>
</blockquote>
<div><br>
</div>
<div>Both questions: Yes</div>
</div>
</blockquote>
<br>
OK. Thanks.<br>
<br>
<blockquote type="cite" cite="mid:6C0488D6-45F2-4D88-84D4-994AC74746A2@jetbrains.com">
<div>
<div>I can recheck it again (if it is needed). There maybe
something wrong with my build...</div>
</div>
</blockquote>
<br>
I think we have enough information at this point, so I don't think
you need to dig further into this. Thanks for helping out.<br>
<br>
StefanK<br>
<br>
<blockquote type="cite" cite="mid:6C0488D6-45F2-4D88-84D4-994AC74746A2@jetbrains.com">
<div>
<div><br>
</div>
Vitaly</div>
<div><br>
<div><br>
<blockquote type="cite">
<div>On 13. Mar 2024, at 13:27, Stefan Karlsson
<a class="moz-txt-link-rfc2396E" href="mailto:stefan.karlsson@oracle.com"><stefan.karlsson@oracle.com></a> wrote:</div>
<br class="Apple-interchange-newline">
<div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Hi
Vitaly,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">On
2024-03-12 23:44, Vitaly Provodin wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Hi
Stefan, Maxim,<br>
<br>
With the patch the version string is successfully
printed - VM was not killed.<br>
</blockquote>
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Did
you run this on 14.4? Did you also run this on an
AArch64 machine?</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">FWIW,
I updated a machine to 14.4 and could reproduce the
reported problem with a patch similar to the one below.
I also managed to write a stand-alone C reproducer,
which I have added to the bug report.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Thanks,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">StefanK</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br>
Thanks,<br>
Vitaly<br>
<br>
<br>
<blockquote type="cite">On 12. Mar 2024, at 17:19,
Stefan Karlsson <a class="moz-txt-link-rfc2396E" href="mailto:stefan.karlsson@oracle.com"><stefan.karlsson@oracle.com></a>
wrote:<br>
<br>
Hi again,<br>
<br>
I just want to clarify that the change above just
removes *one* usage of SafeFetch. My guess is that all
other usages of SafeFetch is still affected by the
issue you are seeing.<br>
<br>
It would be interesting to see if you could verify
this problem by applying this patch:<br>
<br>
diff --git a/src/hotspot/share/memory/universe.cpp
b/src/hotspot/share/memory/universe.cpp<br>
index 2a3d532725f..b58c52e415b 100644<br>
--- a/src/hotspot/share/memory/universe.cpp<br>
+++ b/src/hotspot/share/memory/universe.cpp<br>
@@ -842,7 +842,14 @@ jint universe_init() {<br>
return JNI_OK;<br>
}<br>
<br>
+#include "runtime/safefetch.hpp"<br>
+<br>
jint Universe::initialize_heap() {<br>
+ char* mem = os::reserve_memory(16 * K, false,
mtGC);<br>
+ intptr_t value = SafeFetchN((intptr_t*)mem, 1);<br>
+<br>
+ log_info(gc)("Reserved memory read: " PTR_FORMAT "
" PTR_FORMAT, p2i(mem), value);<br>
+<br>
assert(_collectedHeap == nullptr, "Heap already
created");<br>
_collectedHeap =
GCConfig::arguments()->create_heap();<br>
<br>
<br>
and running:<br>
build/<config_path>/jdk/bin/java -version<br>
<br>
This works on 14.3.1, but it would be interesting to
see what happens on 14.4, and if that shuts down the
VM before it is printing the version string.<br>
<br>
StefanK<br>
<br>
On 2024-03-12 09:34, Stefan Karlsson wrote:<br>
<blockquote type="cite">Hi Maxim,<br>
<br>
On 2024-03-12 08:12, Maxim Kartashev wrote:<br>
<blockquote type="cite">Hello!<br>
<br>
This has been recently filed as
<a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8327860">https://bugs.openjdk.org/browse/JDK-8327860</a> but I
also wanted to check with the community if any
further info on the issue is available.<br>
<br>
It looks like in some cases SafeFetch is directed
to fetch something the OS really doesn't want it
to and, instead of promoting the error to a signal
and letting the application (JVM) deal with it,
immediately terminates the application. All we've
got is the OS crash report, not even the JVM's
fatal error log. This looks like an application
security precaution, which I am not at all
familiar with.<br>
<br>
The relevant pieces of the crash log are below. Is
anybody familiar with "Namespace GUARD"
termination reason and maybe other related
novelties of macOS 14.4? The error was not
reported before upgrading to 14.4<br>
</blockquote>
I don't have an answer for this, but a note below:<br>
<br>
<blockquote type="cite">Thanks in advance,<br>
<br>
Maxim.<br>
<br>
0 libjvm.dylib 0x1062d6ec0 _SafeFetchN_fault + 0<br>
1 libjvm.dylib 0x1062331a4
ObjectMonitor::TrySpin(JavaThread*) + 408<br>
2 libjvm.dylib 0x106232b44
ObjectMonitor::enter(JavaThread*) + 228<br>
3 libjvm.dylib 0x10637436c
ObjectSynchronizer::enter(Handle, BasicLock*,
JavaThread*) + 392<br>
</blockquote>
FYI: I think that this specific call to SafeFetch
was recently removed by:<br>
<a href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/commit/29397d29baac3b29083b1b5d6b2cb06e456af0c3__;!!ACWV5N9M2RV99hQ!MxH9PbSoMKT5I4e02Kkz2Sk1O3hStNxJuKBvsvK5GLi_k_rusbuYduHFzMUqPmzB5FZgTBpgdghtEhMW2QRCYe45o9VfzGctxA$" moz-do-not-send="true" class="moz-txt-link-freetext">https://urldefense.com/v3/__https://github.com/openjdk/jdk/commit/29397d29baac3b29083b1b5d6b2cb06e456af0c3__;!!ACWV5N9M2RV99hQ!MxH9PbSoMKT5I4e02Kkz2Sk1O3hStNxJuKBvsvK5GLi_k_rusbuYduHFzMUqPmzB5FZgTBpgdghtEhMW2QRCYe45o9VfzGctxA$</a><br>
<a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8320317">https://bugs.openjdk.org/browse/JDK-8320317</a><br>
<br>
Cheers,<br>
StefanK<br>
<br>
<br>
<blockquote type="cite">...<br>
<br>
Exception Type: EXC_BAD_ACCESS (SIGKILL)<br>
Exception Codes: KERN_PROTECTION_FAILURE at
0x00000001004f4000<br>
Exception Codes: 0x0000000000000002,
0x00000001004f4000<br>
<br>
Termination Reason: Namespace GUARD, Code 5<br>
<br>
VM Region Info: 0x1004f4000 is in
0x1004f4000-0x1004f8000; bytes after start: 0
bytes before end: 16383<br>
REGION TYPE START - END
[ VSIZE] PRT/MAX SHRMOD REGION DETAIL<br>
mapped file
1004e4000-1004f4000 [ 64K]
r--/r-- SM=COW Object_id=fa8d88e7<br>
---> VM_ALLOCATE
1004f4000-1004f8000 [ 16K]
---/rwx SM=NUL<br>
VM_ALLOCATE
1004f8000-1004fc000 [ 16K]
r--/rwx SM=PRV</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>