RFR: 8329103: assert(!thread->in_asgct()) failed during multi-mode profiling

Andrei Pangin apangin at openjdk.org
Thu Mar 28 22:43:30 UTC 2024


On Thu, 28 Mar 2024 13:09:10 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> This fix makes `AsyncGetCallTrace` reentrant and async-signal-safe.
>> Reentrancy is required in the cases when two or more profiling engines are running at the same time, e.g., when CPU and Wall clock profilers work together and therefore one profiler may interrupt another in the middle of getting a stack trace.
>> 
>> Tested with async-profiler:
>> 
>> java -agentpath:/path/to/libasyncProfiler.so=start,event=cpu,interval=1ms,wall=1ms,file=profile.jfr
>
> I have my doubts as to whether AGCT is actually re-entrant in a general sense, but I can see that the `ThreadInAsgct` RAII object introduced a reentrancy constraint that did not exist prior, and so removing it should not make AGCT any less safe and should allow previous reentrancy cases to continue to work as before.

@dholmes-ora Thank you for the review. When looking at the AGCT code, nothing suspicious that could affect reentrancy caught my eye. Also, benchmarks (specJVM, Renaissance) now run fine with two profilers enabled.
So yes, while I don't have 100% proof that AGCT is async-signal-safe, the fix definitely improves the situation.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18504#issuecomment-2026255860


More information about the hotspot-runtime-dev mailing list