Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v6]

2023-04-06 Thread Johannes Bechberger
> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. > > Tested on my M1 mac. Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: Add comments - Changes: - all: https://git.openjdk.org/jdk/pull/

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-06 Thread Johannes Bechberger
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional commits since the last revision: > > - Fix

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-06 Thread Matthias Baesken
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional commits since the last revision: > > - Fix

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-04 Thread David Holmes
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional commits since the last revision: > > - Fix

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-04 Thread Johannes Bechberger
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional commits since the last revision: > > - Fix

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-04 Thread David Holmes
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by disabling PCDesc cache modifications when in ASGCT. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional commits since the last revision: > > - Fix

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-03 Thread David Holmes
On Mon, 3 Apr 2023 08:29:55 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additional

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v4]

2023-04-03 Thread Johannes Bechberger
On Fri, 24 Mar 2023 10:35:36 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v5]

2023-04-03 Thread Johannes Bechberger
> Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Johannes Bechberger has updated the pull request incrementally with two additional commits since the last revision: - Fix fix - Fix minor issues -

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v4]

2023-03-27 Thread David Holmes
On Fri, 24 Mar 2023 10:35:36 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with two > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v4]

2023-03-24 Thread Johannes Bechberger
> Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Johannes Bechberger has updated the pull request incrementally with two additional commits since the last revision: - Remove misc lines - Disable cachi

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-24 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-24 Thread Johannes Bechberger
On Fri, 24 Mar 2023 07:54:56 GMT, Thomas Stuefe wrote: > Not if they run the walker outside the sampled thread. Which would be much > safer in a lot of ways. Yes, it would, but it is not currently possible with ASGCT, albeit changing it would be quite simple (not changing existing use cases or

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-24 Thread Thomas Stuefe
On Fri, 24 Mar 2023 07:28:27 GMT, Jaroslav Bachorik wrote: > > Yes, but while JFR interrupts threads too, its sampler runs in its own > > thread, so the async-safety of the interrupted code should not matter, or? > > And this sampling approach is quite subpar when compared with the signal > b

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-24 Thread Jaroslav Bachorik
On Thu, 23 Mar 2023 12:45:27 GMT, Johannes Bechberger wrote: > Yes, but while JFR interrupts threads too, its sampler runs in its own > thread, so the async-safety of the interrupted code should not matter, or? And this sampling approach is quite subpar when compared with the signal based pro

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 12:43:38 GMT, Thomas Stuefe wrote: > Yes, but while JFR interrupts threads too, its sampler runs in its own > thread, so the async-safety of the interrupted code should not matter, or? You're right. > wrt info, just a little marker in the thread "AGCT was here", maybe with

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread David Holmes
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Thomas Stuefe
On Thu, 23 Mar 2023 12:00:33 GMT, Johannes Bechberger wrote: > > In particular, we do not know if AGCT did interrupt the crashing thread > > recently. Or do we? This would be valuable information. > > Yes. But it could indeed be helpful information when debugging problems. > Please don't forg

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread David Holmes
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread David Holmes
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 11:46:12 GMT, Thomas Stuefe wrote: > There are variants of this play, but my point is the resulting crashes may > happen after AGCT was invoked. I see the problem. Thanks for adding some clarification. We can all agree that my intended fix is not really a fix. >So all we s

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Thomas Stuefe
On Thu, 23 Mar 2023 08:36:59 GMT, Erik Österlund wrote: >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly only on Mac). > >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly o

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:36:59 GMT, Erik Österlund wrote: >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly only on Mac). > >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly o

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Thomas Stuefe
On Thu, 23 Mar 2023 08:36:59 GMT, Erik Österlund wrote: >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly only on Mac). > >> The best alternative to me is to take the perf hit and disable the caching >> when we're in forte (possibly o

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:36:59 GMT, Erik Österlund wrote: > > The best alternative to me is to take the perf hit and disable the caching > > when we're in forte (possibly only on Mac). > > Sounds like a plan. I'm going to write some code to check the performance impact of disabling it, on Mac a

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
> Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: Use raw_thread instead of Thread::cu

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Erik Österlund
On Thu, 23 Mar 2023 08:27:23 GMT, Johannes Bechberger wrote: > The best alternative to me is to take the perf hit and disable the caching > when we're in forte (possibly only on Mac). Sounds like a plan. - PR Comment: https://git.openjdk.org/jdk/pull/13144#issuecomment-1480784139

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Erik Österlund
On Thu, 23 Mar 2023 07:27:14 GMT, Johannes Bechberger wrote: > > You now effectively disable execution of generated code for the whole > > extend of AGCT? > > > > That's exactly what async-profiler does already > https://github.com/async-profiler/async-profiler/blob/c8de91df6b090af82e91a066

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v3]

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 08:20:18 GMT, Johannes Bechberger wrote: >> Fixes the issue by transitioning the thread into the WXWrite mode while >> walking the stack in AsyncGetCallTrace. >> >> Tested on my M1 mac. > > Johannes Bechberger has updated the pull request incrementally with one > additiona

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1 [v2]

2023-03-23 Thread Johannes Bechberger
> Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision: Make _wx_state volatile ---

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-23 Thread Johannes Bechberger
On Thu, 23 Mar 2023 07:03:04 GMT, Thomas Stuefe wrote: > You now effectively disable execution of generated code for the whole extend > of AGCT? That's exactly what async-profiler does already https://github.com/async-profiler/async-profiler/blob/c8de91df6b090af82e91a066deb81a3afb505331/src/pr

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-23 Thread Erik Österlund
On Wed, 22 Mar 2023 15:57:40 GMT, Johannes Bechberger wrote: > Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Drive by comment: how async safe is WX enabler? If a thread is in the middle of it and we

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-23 Thread Thomas Stuefe
On Thu, 23 Mar 2023 06:05:33 GMT, Johannes Bechberger wrote: >> Seems okay. But I am really over this game of whack-a-mole with >> ThreadWXEnable. > >> Seems okay. But I am really over this game of whack-a-mole with >> ThreadWXEnable. > > You're not the only one. > > Andrei Pangin added a w

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-23 Thread Thomas Stuefe
On Wed, 22 Mar 2023 15:57:40 GMT, Johannes Bechberger wrote: > Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Okay. Though the prospect of async profiler modifying the code cache by walking the stack

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-22 Thread Johannes Bechberger
On Thu, 23 Mar 2023 02:17:44 GMT, David Holmes wrote: > Seems okay. But I am really over this game of whack-a-mole with > ThreadWXEnable. You're not the only one. Andrei Pangin added a workaround to async-profiler, so nobody noticed the problem before. - PR Comment: https://git

Re: RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-22 Thread David Holmes
On Wed, 22 Mar 2023 15:57:40 GMT, Johannes Bechberger wrote: > Fixes the issue by transitioning the thread into the WXWrite mode while > walking the stack in AsyncGetCallTrace. > > Tested on my M1 mac. Seems okay. But I am really over this game of whack-a-mole with ThreadWXEnable. --

RFR: 8304725: AsyncGetCallTrace can cause SIGBUS on M1

2023-03-22 Thread Johannes Bechberger
Fixes the issue by transitioning the thread into the WXWrite mode while walking the stack in AsyncGetCallTrace. Tested on my M1 mac. - Commit messages: - Fix 8304725 Changes: https://git.openjdk.org/jdk/pull/13144/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13144&range