RFR: JDK-8282405: Make thread resource areas signal safe [v3]

Thomas Stuefe stuefe at openjdk.java.net
Thu Mar 3 06:42:04 UTC 2022


On Thu, 3 Mar 2022 06:16:30 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Maybe only error reporting (known to use the RA) should actually do this? It isn't obvious to me that UserHandler, SR_handler, or even AGCT are affected by this potential problem.

AGCT was affected by this. That was the original motivation for the patch. The patch was done by us downstream a while ago because we had sporadic crashes with corrupted RAs on the PPC port of the async profiler. The original variant of this patch did patch up AGCT directly, not the signal handler, and the crashes disappeared. So I would do this at least for AGCT too, and for error handling, and preferably for the regular "big" signal handler too.

About UserHandler and SR_handler, I agree. Those seem simple enough. Although switching the resource area does not really cost much. We also unblock error signals at each signal handler entry, and this feels like the same precaution.

Alternatively, if we think a signal handler should not use RA, I thought that we could add checks for this assumption. Temporarily forbidding RA access. But since that would incur cost on every RA allocation (you'd have to check every time) I would only do this for debug. Do you think this makes sense? But I would do this in a separate RFE, if at all.

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

PR: https://git.openjdk.java.net/jdk/pull/7624


More information about the hotspot-runtime-dev mailing list