From syan at openjdk.org Sat Nov 1 02:08:19 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 1 Nov 2025 02:08:19 GMT Subject: RFR: 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests [v9] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 03:04:48 GMT, SendaoYan wrote: >> Hi all, >> >> This PR use `WhiteBox.getWhiteBox().fullGC()` instead of 'ClassUnloader.eatMemory()' to provoking gc for several test/hotspot/jtreg/vmTestbase/nsk/jvmti tests, It is the fast and robust way to trigger Full GC without risks hitting OOME, and will make test run finish more quicker on machine with huge physical memory. >> >> Change has been verified locally, test-fix only, no risk. >> >> >> grep VmRSS /proc/`ps -ef | grep -w java | grep vmsqe.aod.AppId | awk '{print $2}'`/status > > SendaoYan has updated the pull request incrementally with one additional commit since the last revision: > > Add log.display("Provoking GC"); Thanks for the suggestions and reviews @https://github.com/lmesnik @https://github.com/plummercj @https://github.com/sspitsyn ------------- PR Comment: https://git.openjdk.org/jdk/pull/28011#issuecomment-3475438561 From syan at openjdk.org Sat Nov 1 02:08:20 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 1 Nov 2025 02:08:20 GMT Subject: Integrated: 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 06:22:14 GMT, SendaoYan wrote: > Hi all, > > This PR use `WhiteBox.getWhiteBox().fullGC()` instead of 'ClassUnloader.eatMemory()' to provoking gc for several test/hotspot/jtreg/vmTestbase/nsk/jvmti tests, It is the fast and robust way to trigger Full GC without risks hitting OOME, and will make test run finish more quicker on machine with huge physical memory. > > Change has been verified locally, test-fix only, no risk. > > > grep VmRSS /proc/`ps -ef | grep -w java | grep vmsqe.aod.AppId | awk '{print $2}'`/status This pull request has now been integrated. Changeset: 54fe5021 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/54fe50210efe9ae6fad225b815cfdeb16c868115 Stats: 299 lines in 27 files changed: 33 ins; 234 del; 32 mod 8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests Reviewed-by: cjplummer, lmesnik, sspitsyn ------------- PR: https://git.openjdk.org/jdk/pull/28011 From ysuenaga at openjdk.org Sat Nov 1 02:36:22 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:36:22 GMT Subject: RFR: 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call [v3] In-Reply-To: References: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> Message-ID: On Thu, 30 Oct 2025 13:32:46 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` with coredump cannot resolve function symbol which has `.cold` attribute. >> >> >> ----------------- 120485 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f50e4710735 __GI_abort + 0x8b >> 0x00007f50e1e01f33 ???????? >> >> >> 0x7f50e1e01f33 was `os::abort(bool, void const*, void const*) [clone .cold]` and I could see it in GDB. However it has `.cold` suffix, it means the code has been relocated as ["cold" function](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-cold-function-attribute). In GDB, we can see the code in another area from function body as following: >> >> >> (gdb) disas 0x7f50e1e01f2e, 0x7f50e1e01f34 >> Dump of assembler code from 0x7f50e1e01f2e to 0x7f50e1e01f34: >> 0x00007f50e1e01f2e <_ZN2os5abortEbPKvS1_.cold+0>: call 0x7f50e1e01010 >> => 0x00007f50e1e01f33: nop >> End of assembler dump. >> >> >> libsaproc.so checks address range to resolve symbol whether the address is in between `start` and `start + size - 1`. As you can see in assembler dump, the code in `.cold` section is `call` instruction, thus IP points next `nop`, thus we should allow address range between `start` and `start + size`. >> >> After this PR, you can see the right symbol as following: >> >> >> ----------------- 120485 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f50e4710735 __GI_abort + 0x8b >> 0x00007f50e1e01f33 os::abort(bool, void const*, void const*) [clone .cold] + 0x5 > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Clarify comment about RIP-1 fallback handling Thank you both for reviewing! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27846#issuecomment-3475467698 From ysuenaga at openjdk.org Sat Nov 1 02:36:23 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:36:23 GMT Subject: Integrated: 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call In-Reply-To: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> References: <3BfI3hqINcYqLrOYQ1ohvsdpUo6dqgznggJp9XWftqw=.c52178f3-c963-41cf-bd07-504de5982824@github.com> Message-ID: <75W6AM4vr_GlY8SLlZ_f85u_lWbkpf2d5ZkB2zWHpgM=.cceb0531-a01f-4eca-b2b0-3a5a6513457b@github.com> On Thu, 16 Oct 2025 13:32:28 GMT, Yasumasa Suenaga wrote: > `jhsdb jstack --mixed` with coredump cannot resolve function symbol which has `.cold` attribute. > > > ----------------- 120485 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f50e4710735 __GI_abort + 0x8b > 0x00007f50e1e01f33 ???????? > > > 0x7f50e1e01f33 was `os::abort(bool, void const*, void const*) [clone .cold]` and I could see it in GDB. However it has `.cold` suffix, it means the code has been relocated as ["cold" function](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-cold-function-attribute). In GDB, we can see the code in another area from function body as following: > > > (gdb) disas 0x7f50e1e01f2e, 0x7f50e1e01f34 > Dump of assembler code from 0x7f50e1e01f2e to 0x7f50e1e01f34: > 0x00007f50e1e01f2e <_ZN2os5abortEbPKvS1_.cold+0>: call 0x7f50e1e01010 > => 0x00007f50e1e01f33: nop > End of assembler dump. > > > libsaproc.so checks address range to resolve symbol whether the address is in between `start` and `start + size - 1`. As you can see in assembler dump, the code in `.cold` section is `call` instruction, thus IP points next `nop`, thus we should allow address range between `start` and `start + size`. > > After this PR, you can see the right symbol as following: > > > ----------------- 120485 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f50dc1aa7c0 nid=120485 waiting on condition [0x00007f50c0d1a000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f50e4710735 __GI_abort + 0x8b > 0x00007f50e1e01f33 os::abort(bool, void const*, void const*) [clone .cold] + 0x5 This pull request has now been integrated. Changeset: d2260236 Author: Yasumasa Suenaga URL: https://git.openjdk.org/jdk/commit/d226023643f90027a8980d161ec6d423887ae3ce Stats: 40 lines in 1 file changed: 26 ins; 4 del; 10 mod 8369994: Mixed mode jhsdb jstack cannot resolve symbol in function ending in call Reviewed-by: kevinw, cjplummer ------------- PR: https://git.openjdk.org/jdk/pull/27846 From ysuenaga at openjdk.org Sat Nov 1 02:39:52 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:39:52 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v11] In-Reply-To: References: Message-ID: > `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. > > It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. > > > ----------------- 646689 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 > 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c > 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 > 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f1cf218789f JVM_SleepNanos + 0x28f > 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > > > `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. > > > ----------------- 646841 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 > 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c > 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 > 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f4a0918789f JVM_SleepNanos + 0x28f > 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) > 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) > 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) > 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) > * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) > 0x00007f49ef3385fd > 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce > 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 > 0x00007f4a08fc31bb JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 0xab > 0x00007f4a091... Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: Improve comments in isValidFrame method ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27885/files - new: https://git.openjdk.org/jdk/pull/27885/files/3e0bfd09..ec5d0e2c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=09-10 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27885/head:pull/27885 PR: https://git.openjdk.org/jdk/pull/27885 From ysuenaga at openjdk.org Sat Nov 1 02:39:56 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 02:39:56 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v10] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 17:33:33 GMT, Kevin Walls wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Use stderrShouldBeEmptyIgnoreVMWarnings > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java line 97: > >> 95: >> 96: private boolean isValidFrame(Address nextCFA, boolean isNative) { >> 97: // CFA should not be null even if it is Java frame. > > This comment means a Java interpreter frame need not have a different CFA/frame pointer? > > "native" means we found DWARF. Non-native means Java interpreted or Java compiled. > Java frames just need a non-null CFA. > > // CFA should never be null. > // nextCFA must be greater than current CFA, if frame is native. > // Java interpreter frames can share the CFA (frame pointer). Exactly. I updated the comment. Thanks! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27885#discussion_r2483054834 From ysuenaga at openjdk.org Sat Nov 1 03:20:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 03:20:49 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v11] In-Reply-To: References: Message-ID: On Sat, 1 Nov 2025 02:39:52 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. >> >> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. >> >> >> ----------------- 646689 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 >> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c >> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f1cf218789f JVM_SleepNanos + 0x28f >> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> >> >> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. >> >> >> ----------------- 646841 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 >> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c >> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f4a0918789f JVM_SleepNanos + 0x28f >> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) >> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) >> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) >> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) >> * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) >> 0x00007f49ef3385fd >> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce >> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 >> 0x00007f4a08fc31bb JavaCalls::call_virtu... > > Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: > > Improve comments in isValidFrame method I resolved merge confliction, and it passed all of serviceability/sa tests on Linux AMD64. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27885#issuecomment-3475560622 From ysuenaga at openjdk.org Sat Nov 1 03:20:49 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sat, 1 Nov 2025 03:20:49 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v12] In-Reply-To: References: Message-ID: > `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. > > It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. > > > ----------------- 646689 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 > 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c > 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 > 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f1cf218789f JVM_SleepNanos + 0x28f > 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > > > `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. > > > ----------------- 646841 ----------------- > "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] > java.lang.Thread.State: TIMED_WAITING (sleeping) > JavaThread state: _thread_blocked > 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 > 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c > 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 > 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 > 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc > 0x00007f4a0918789f JVM_SleepNanos + 0x28f > 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) > 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) > 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) > 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) > 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) > * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) > 0x00007f49ef3385fd > 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce > 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 > 0x00007f4a08fc31bb JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*) + 0xab > 0x00007f4a091... Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: - Merge branch 'master' into jhsdb-jstack-bp - Improve comments in isValidFrame method - Use stderrShouldBeEmptyIgnoreVMWarnings - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only - Respect RSP to parse DWARF - Revert testcase changes - Fix imports - Update testcase - Update testcase - Add glibc version check to TestJhsdbJstackMixedWithXComp.java - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0 ------------- Changes: https://git.openjdk.org/jdk/pull/27885/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27885&range=11 Stats: 248 lines in 6 files changed: 182 ins; 10 del; 56 mod Patch: https://git.openjdk.org/jdk/pull/27885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27885/head:pull/27885 PR: https://git.openjdk.org/jdk/pull/27885 From kbarrett at openjdk.org Sat Nov 1 07:34:03 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sat, 1 Nov 2025 07:34:03 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: <4Yh4KeUItjdDYihe9d1u66tBROofb0pRLDKIdhw-XZo=.cf383363-c963-4871-941d-5e358f74c048@github.com> References: <6u0Ia6A2xQnv51Ti0Jchg6rnncfRRvtK5oGS963CeIA=.bc9c1481-60ad-443d-923b-dc86277dbb14@github.com> <4Yh4KeUItjdDYihe9d1u66tBROofb0pRLDKIdhw-XZo=.cf383363-c963-4871-941d-5e358f74c048@github.com> Message-ID: On Mon, 27 Oct 2025 08:24:41 GMT, Florian Weimer wrote: >> We (you and me, @fweimer-rh) discussed this a couple of years ago: >> https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/082324.html >> >> Quoting from here: >> https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/083142.html >> >> " >> Empirically, a recursive initialization attempt doesn't make any attempt to >> throw. Rather, it blocks forever waiting for a futex signal from a thread that >> succeeds in the initialization. Which of course will never come. >> >> And that makes sense, now that I've looked at the code. >> >> In __cxa_guard_acquire, with _GLIBCXX_USE_FUTEX, if the guard indicates >> initialization hasn't yet been completed, then it goes into a while loop. >> This while loop tries to claim initialization. Failing that, it checks >> whether initialization is complete. Failing that, it does a SYS_futex >> syscall, waiting for some other thread to perform the initialization. There's >> nothing there to check for recursion. >> >> throw_recursive_init_exception is only called if single-threaded (either by >> configuration or at runtime). >> " >> >> It doesn't look like there have been any relevant changes in that area since >> then. So I think there is still not a problem here. > > @kimbarrett Sorry, I forgot about the old thread. You can get the exception in a single-threaded scenario, something like this: > > > struct S { > S() { > static S s; > *this = s; > } > } global; > > > Maybe the actual rule is more like this? > >> Functions that may throw exceptions must not be used, unless individual calls ensure that these particular invocations cannot throw exceptions. Recursively entering a block-scoped static is undefined behavior. That some configurations of glibc might throw an exception in that situation (even despite the caller being compiled with exceptions disabled) seems like a mistake in glibc, and not really our concern. Our code should avoid such a situation because it's UB, regardless of whether the actual behavior involves exceptions or nasal demons. The exception only gets thrown when the application is single-threaded. But at least the common way to start java (via the launcher) is already multi-threaded on entry to Threads::create_vm(). So that case doesn't normally apply to us anyway. Also, I really don't think we want people trying to figure out whether a particular call might or might not throw (neither when writing nor when reading code). So no, I don't think the proposed rule should be changed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2483178071 From aph at openjdk.org Sat Nov 1 09:02:11 2025 From: aph at openjdk.org (Andrew Haley) Date: Sat, 1 Nov 2025 09:02:11 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v9] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Tue, 28 Oct 2025 23:18:48 GMT, Ruben wrote: >> The C2 exception handler stub code is only a trampoline to the generated exception handler blob. This change removes the extra step on the way to the generated blob. >> >> According to some comments in the source code, the exception handler stub code used to be patched upon deoptimization, however presumably these comments are outdated as the patching upon deoptimization happens for post-call NOPs only. > > Ruben has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains three new commits since the last revision: > > - Address review comments and fix a mistype > - Check for NOP and MOVK separately in NativePostCallNop > - Test for deoptimization in virtual threads > > Change-Id: I9ef51b426d34e9b44a3891f6a45307232f900e5a Marked as reviewed by aph (Reviewer). But I'm not going to push `SafeFetch` any further. I've said my piece. ------------- PR Review: https://git.openjdk.org/jdk/pull/26678#pullrequestreview-3407023975 PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3476011689 From aph at openjdk.org Sat Nov 1 09:05:08 2025 From: aph at openjdk.org (Andrew Haley) Date: Sat, 1 Nov 2025 09:05:08 GMT Subject: RFR: 8365047: Remove exception handler stub code in C2 [v9] In-Reply-To: References: <4R-933Vw15ku03kFonQY4msXdmzkNVnawVWFB7Uu4k0=.1653f2ec-79d1-4076-aa03-4bae566d74c2@github.com> Message-ID: On Thu, 30 Oct 2025 21:10:18 GMT, Dean Long wrote: > Re: SafeFetch, it is probably OK to make NativePostCallNop_at slightly slower for uses like make_deoptimized(), but the oopmap optimizations like CodeCache::find_blob_and_oopmap() were highly optimized to make loom/VirtualThread performance reasonable. Adding a SafeFetch here might cause a regression. Sure, but 2 things: Loom doesn't meed post-call NOPs as much as it used to. We could fairly easily make SafeFetch much faster than it is, if needs be. But anyway, I approved this patch. ------------- PR Comment: https://git.openjdk.org/jdk/pull/26678#issuecomment-3476017720 From kevinw at openjdk.org Sat Nov 1 09:59:03 2025 From: kevinw at openjdk.org (Kevin Walls) Date: Sat, 1 Nov 2025 09:59:03 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v12] In-Reply-To: References: Message-ID: On Sat, 1 Nov 2025 03:20:49 GMT, Yasumasa Suenaga wrote: >> `jhsdb jstack --mixed` would not work when attaches to the process runs with `-Xcomp`. >> >> It has been reported by @pchilano in #27728. You can reproduce the problem with [Test.java (attached JBS)](https://bugs.openjdk.org/secure/attachment/116551/Test.java). You can see following stack. >> >> >> ----------------- 646689 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f1cec18c890 nid=646689 waiting on condition [0x00007f1cd0158000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f1cf3b7f462 __syscall_cancel_arch + 0x32 >> 0x00007f1cf3b7375c __internal_syscall_cancel + 0x5c >> 0x00007f1cf3b766a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f1cf270e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f1cf2005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f1cf218789f JVM_SleepNanos + 0x28f >> 0x00007f1cdb95f299 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> >> >> `Thread.sleepNanos0` is the bottom stack, but actually it has more call frames. You can see them with `-XX:+PreserveFramePointer`. >> >> >> ----------------- 646841 ----------------- >> "Thread-0" #24 prio=5 tid=0x00007f4a0018c9e0 nid=646841 waiting on condition [0x00007f49e4fd7000] >> java.lang.Thread.State: TIMED_WAITING (sleeping) >> JavaThread state: _thread_blocked >> 0x00007f4a0aa29462 __syscall_cancel_arch + 0x32 >> 0x00007f4a0aa1d75c __internal_syscall_cancel + 0x5c >> 0x00007f4a0aa206a8 ___pthread_cond_timedwait + 0x178 >> 0x00007f4a0970e1e9 PlatformEvent::park_nanos(long) + 0x119 >> 0x00007f4a09005f4c JavaThread::sleep_nanos(long) + 0xfc >> 0x00007f4a0918789f JVM_SleepNanos + 0x28f >> 0x00007f49ef961099 java.lang.Thread.sleepNanos0(long) + 0x99 (Native method) >> 0x00007f49e7f477b4 * java.lang.Thread.sleepNanos(long) bci:33 line:509 (Compiled frame) >> 0x00007f49e7f41a64 * java.lang.Thread.sleep(long) bci:25 line:540 (Compiled frame) >> 0x00007f49e7f4037c * Test.run() bci:3 line:6 (Compiled frame) >> 0x00007f49ef943328 * java.lang.Thread.runWith(java.lang.Object, java.lang.Runnable) bci:5 line:1487 (Compiled frame) >> * java.lang.Thread.run() bci:19 line:1474 (Compiled frame) >> 0x00007f49ef3385fd >> 0x00007f4a08fc247e JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*) + 0x4ce >> 0x00007f4a08fc2bb3 JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*) + 0x2d3 >> 0x00007f4a08fc31bb JavaCalls::call_virtu... > > Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 16 commits: > > - Merge branch 'master' into jhsdb-jstack-bp > - Improve comments in isValidFrame method > - Use stderrShouldBeEmptyIgnoreVMWarnings > - TestJhsdbJstackMixedWithXComp.java should be run on Linux AMD64 only > - Respect RSP to parse DWARF > - Revert testcase changes > - Fix imports > - Update testcase > - Update testcase > - Add glibc version check to TestJhsdbJstackMixedWithXComp.java > - ... and 6 more: https://git.openjdk.org/jdk/compare/d2260236...eb2f0ab0 Thanks, spent quite a while going over this yesterday and think it's good. Yes was waiting for the conflict with 8369994, that looks like it merged in OK. 8-) ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27885#pullrequestreview-3407206806 From kvn at openjdk.org Sat Nov 1 15:06:06 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Sat, 1 Nov 2025 15:06:06 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Approved ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3407565447 From duke at openjdk.org Sat Nov 1 16:00:22 2025 From: duke at openjdk.org (duke) Date: Sat, 1 Nov 2025 16:00:22 GMT Subject: Withdrawn: 8366122: Shenandoah: Implement efficient support for object count after gc events In-Reply-To: <7KUQJooZsasGtVU-HaCj7h8_rMFBX13d4yW3T4PfpBw=.07a12734-af51-45cc-9bbb-d6573806478a@github.com> References: <7KUQJooZsasGtVU-HaCj7h8_rMFBX13d4yW3T4PfpBw=.07a12734-af51-45cc-9bbb-d6573806478a@github.com> Message-ID: On Thu, 28 Aug 2025 01:30:39 GMT, pf0n wrote: > ### Summary > > The new implementation of ObjectCountAfterGC for Shenandoah piggybacks off of the existing marking phases and records strongly marked objects in a histogram. If the event is disabled, the original marking closures are used. When enabled new mark-and-count closures are used by the worker threads. Each worker thread updates its local histogram as it marks an object. These local histograms are merged at the conclusion of the marking phase under a mutex. The event is emitted outside a safepoint. Because (most) Shenandoah's marking is done concurrently, so is the object counting work. > > ### Performance > The performance test were ran using the Extremem benchmark on a default and stress workload. (will edit this section to include data after average time and test for GenShen) > > #### Default workload: > ObjectCountAfterGC disabled (master branch): > `[807.216s][info][gc,stats ] Pause Init Mark (G) = 0.003 s (a = 264 us)` > `[807.216s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 91 us)` > `[807.216s][info][gc,stats ] Concurrent Mark Roots = 0.041 s (a = 4099 us)` > `[807.216s][info][gc,stats ] Concurrent Marking = 1.660 s (a = 166035 us)` > `[807.216s][info][gc,stats ] Pause Final Mark (G) = 0.004 s (a = 446 us) ` > `[807.216s][info][gc,stats ] Pause Final Mark (G) = 0.004 s (a = 446 us) ` > `[807.216s][info][gc,stats ] Pause Final Mark (N) = 0.004 s (a = 357 us)` > > ObjectCountAfterGC disabled (feature branch): > `[807.104s][info][gc,stats ] Pause Init Mark (G) = 0.003 s (a = 302 us)` > `[807.104s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 92 us) ` > `[807.104s][info][gc,stats ] Concurrent Mark Roots = 0.048 s (a = 4827 us)` > `[807.104s][info][gc,stats ] Concurrent Marking = 1.666 s (a = 166638 us) ` > `[807.104s][info][gc,stats ] Pause Final Mark (G) = 0.006 s (a = 603 us)` > `[807.104s][info][gc,stats ] Pause Final Mark (N) = 0.005 s (a = 516 us)` > > ObjectCountAfterGC enabled (feature branch) > `[807.299s][info][gc,stats ] Pause Init Mark (G) = 0.002 s (a = 227 us)` > `[807.299s][info][gc,stats ] Pause Init Mark (N) = 0.001 s (a = 89 us) ` > `[807.299s][info][gc,stats ] Concurrent Mark Roots = 0.053 s (a = 5279 us)` > `[807.299s][info][gc,st... This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/26977 From ysuenaga at openjdk.org Sun Nov 2 06:32:02 2025 From: ysuenaga at openjdk.org (Yasumasa Suenaga) Date: Sun, 2 Nov 2025 06:32:02 GMT Subject: RFR: 8370176: Mixed mode jhsdb jstack cannot unwind call stack with -Xcomp [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 21:00:22 GMT, Chris Plummer wrote: >> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision: >> >> Update testcase > > Changes look good. Thanks for fixing this. @plummercj Can you approve again this PR? Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27885#issuecomment-3477496462