RFR: 8360942: [ubsan] aotCache tests trigger runtime error: applying non-zero offset 16 to null pointer in CodeBlob::relocation_end()

Matthias Baesken mbaesken at openjdk.org
Tue Jul 8 12:34:38 UTC 2025


On Mon, 7 Jul 2025 23:48:03 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> `CodeBlob::relocation_size()` is calculated as `(_mutable_data + _relocation_size - _mutable_data)`. `CodeBlob::relocation_size()` is called during AOT code loading before we allocate space for mutable data (the size is used to find how big space should be allocated). The expression at that point is `(NULL + _relocation_size - NULL)` which returns correct result. But we should just return `_relocation_size` which is recorded anyway in AOT data.
> 
> Added missing  `_mutable_data = blob_end();` initialization when we restore AOT code blob.
> 
> Fixed embarrassing typo in asserts.
> 
> Tested: tier1-6,8,10,xcomp,stress

Marked as reviewed by mbaesken (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/26175#pullrequestreview-2997443455


More information about the hotspot-compiler-dev mailing list