Integrated: 8356631: OopHandle replacement methods should not be called on empty handles
Aleksey Shipilev
shade at openjdk.org
Tue May 13 12:49:59 UTC 2025
On Fri, 9 May 2025 11:09:59 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> I noticed that in OopHandle/WeakHandle we have {replace,xchg,cmpxchg} methods that overwrite the handle. This is only safe to do when the handle is not empty -- i.e. when there is a storage allocated for it in relevant OopStorage. Otherwise we attempt the store to nullptr, and get a SEGV.
>
> Only OopHandle::replace does the assertion for this. We need to add these asserts everywhere else.
>
> Additional testing:
> - [x] Linux x86_64 server fastdebug, `all`
This pull request has now been integrated.
Changeset: de106447
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/de1064472180d06693d742a754a8fdc927d367f5
Stats: 4 lines in 2 files changed: 3 ins; 0 del; 1 mod
8356631: OopHandle replacement methods should not be called on empty handles
Reviewed-by: coleenp, eosterlund
-------------
PR: https://git.openjdk.org/jdk/pull/25139
More information about the hotspot-dev
mailing list