Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v4]

2021-07-16 Thread David Holmes
On Fri, 16 Jul 2021 14:38:35 GMT, Jorn Vernee wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the same s

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-16 Thread Jorn Vernee
On Thu, 15 Jul 2021 15:54:50 GMT, Jorn Vernee wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the same s

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v4]

2021-07-16 Thread Jorn Vernee
> This patch rewrites the prologue and epilogue of panama upcalls, in order to > fix the test failure from the title. > > Previously, we did a call to potentially attach the current thread to the VM, > and then afterwards did the same suspend and stack reguard checks that we do > on the back-ed

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-16 Thread Jorn Vernee
On Thu, 15 Jul 2021 23:43:38 GMT, Vladimir Kozlov wrote: >> Sorry, I sent the wrong godbolt link: https://godbolt.org/z/1665fWzff > > @JornVernee I have small correct to your comment. We use simple inheritance > for Thread subclasses. Their instances have **one** vtbl pointer at the same > offs

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-16 Thread Jorn Vernee
On Fri, 16 Jul 2021 02:12:20 GMT, David Holmes wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Address David's review comments > > src/hotspot/share/prims/universalUpcallHandler.cpp line 62: > >> 60: guarantee(

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-15 Thread David Holmes
On Thu, 15 Jul 2021 15:54:50 GMT, Jorn Vernee wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the same s

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread David Holmes
On Thu, 15 Jul 2021 10:47:17 GMT, Jorn Vernee wrote: >> src/hotspot/share/prims/universalUpcallHandler.cpp line 121: >> >>> 119: } >>> 120: >>> 121: MACOS_AARCH64_ONLY(thread->enable_wx(WXExec)); >> >> Not clear why this is needed? JavaCallWrapper doesn't use it. > > I took this from JavaC

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Vladimir Kozlov
On Thu, 15 Jul 2021 12:44:23 GMT, Jorn Vernee wrote: >> Thanks. >> >> I've been careful here to return a `Thread*` since the result is stored in >> `r15_thread` and I thought converting between sub and super types could >> potentially result in different pointers due to the way super types are

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-15 Thread David Holmes
On Thu, 15 Jul 2021 11:02:21 GMT, Jorn Vernee wrote: >> How does native code reach a safepoint polling point? > > The stack trace looks like this: > > > Current thread (0x02a2489f0b50): JavaThread "Thread-4551" > [_thread_in_Java, id=24920, stack(0x00d9e050,0x00d9e060)] >

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-15 Thread Jorn Vernee
On Thu, 15 Jul 2021 15:54:50 GMT, Jorn Vernee wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the same s

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v3]

2021-07-15 Thread Jorn Vernee
> This patch rewrites the prologue and epilogue of panama upcalls, in order to > fix the test failure from the title. > > Previously, we did a call to potentially attach the current thread to the VM, > and then afterwards did the same suspend and stack reguard checks that we do > on the back-ed

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread David Holmes
On 15/07/2021 10:29 pm, Jorn Vernee wrote: On Wed, 14 Jul 2021 00:47:47 GMT, David Holmes wrote: Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision: Assert frame is correct type in frame_data_for_frame src/hotspot/share/prims/univer

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Jorn Vernee
On Thu, 15 Jul 2021 12:25:54 GMT, Jorn Vernee wrote: >> src/hotspot/share/prims/universalUpcallHandler.cpp line 76: >> >>> 74: >>> 75: // modelled after JavaCallWrapper::JavaCallWrapper >>> 76: Thread* >>> ProgrammableUpcallHandler::on_entry(OptimizedEntryBlob::FrameData* context) >>> { >> >

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Jorn Vernee
On Wed, 14 Jul 2021 00:58:38 GMT, David Holmes wrote: > The mapping to JavaCallWrapper seems reasonable but there are a few > differences that I'm now assuming stem from the fact upcalls start > _thread_in_native while JCW starts from _thread_in_vm? The main difference stems from the fact that

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Jorn Vernee
On Wed, 14 Jul 2021 00:47:47 GMT, David Holmes wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Assert frame is correct type in frame_data_for_frame > > src/hotspot/share/prims/universalUpcallHandler.cpp line 76: >

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Jorn Vernee
On Wed, 14 Jul 2021 00:50:44 GMT, David Holmes wrote: >> src/hotspot/share/runtime/safepoint.cpp line 931: >> >>> 929: // See if return type is an oop. >>> 930: bool return_oop = nm->method()->is_returning_oop(); >>> 931: HandleMark hm(self); >> >> I was seeing an `assert(_handle_ma

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-15 Thread Jorn Vernee
On Wed, 14 Jul 2021 00:24:38 GMT, David Holmes wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Assert frame is correct type in frame_data_for_frame > > src/hotspot/share/prims/universalUpcallHandler.cpp line 86: >

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-13 Thread David Holmes
On Fri, 25 Jun 2021 21:04:27 GMT, Jorn Vernee wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Assert frame is correct type in frame_data_for_frame > > src/hotspot/share/runtime/safepoint.cpp line 931: > >> 929:

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-13 Thread David Holmes
On Tue, 13 Jul 2021 15:16:26 GMT, Jorn Vernee wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the same s

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-13 Thread Vladimir Ivanov
On Tue, 13 Jul 2021 17:05:25 GMT, Vladimir Ivanov wrote: >> Thanks for the suggestion. I'd like to keep it the way it is though, so that >> the assert message contains the `has_last_frame` & `java_call_counter` >> values. (this was one of the reason I did this refactor as well, since the >> as

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-13 Thread Vladimir Ivanov
On Tue, 13 Jul 2021 14:59:07 GMT, Jorn Vernee wrote: >> src/hotspot/share/runtime/thread.hpp line 1128: >> >>> 1126: >>> 1127: private: >>> 1128: DEBUG_ONLY(void verify_frame_info();) >> >> If you declare `verify_frame_info` as returning a `bool` (and just put a >> `return true;` at the en

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC [v2]

2021-07-13 Thread Jorn Vernee
> This patch rewrites the prologue and epilogue of panama upcalls, in order to > fix the test failure from the title. > > Previously, we did a call to potentially attach the current thread to the VM, > and then afterwards did the same suspend and stack reguard checks that we do > on the back-ed

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC

2021-07-13 Thread Jorn Vernee
On Tue, 13 Jul 2021 13:52:18 GMT, Vladimir Ivanov wrote: >> This patch rewrites the prologue and epilogue of panama upcalls, in order to >> fix the test failure from the title. >> >> Previously, we did a call to potentially attach the current thread to the >> VM, and then afterwards did the sa

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC

2021-07-13 Thread Vladimir Ivanov
On Fri, 25 Jun 2021 17:38:32 GMT, Jorn Vernee wrote: > This patch rewrites the prologue and epilogue of panama upcalls, in order to > fix the test failure from the title. > > Previously, we did a call to potentially attach the current thread to the VM, > and then afterwards did the same suspen

Re: [jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC

2021-06-28 Thread Jorn Vernee
On Fri, 25 Jun 2021 17:38:32 GMT, Jorn Vernee wrote: > This patch rewrites the prologue and epilogue of panama upcalls, in order to > fix the test failure from the title. > > Previously, we did a call to potentially attach the current thread to the VM, > and then afterwards did the same suspen

[jdk17] RFR: 8269240: java/foreign/stackwalk/TestAsyncStackWalk.java test failed with concurrent GC

2021-06-28 Thread Jorn Vernee
This patch rewrites the prologue and epilogue of panama upcalls, in order to fix the test failure from the title. Previously, we did a call to potentially attach the current thread to the VM, and then afterwards did the same suspend and stack reguard checks that we do on the back-edge of a nati