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