RFR: 8360942: [ubsan] aotCache tests trigger runtime error: applying non-zero offset 16 to null pointer in CodeBlob::relocation_end()
    Vladimir Kozlov 
    kvn at openjdk.org
       
    Mon Jul  7 23:55: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
@mbaesken, please verify that is passing ubsan testing now.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26175#issuecomment-3046865545
    
    
More information about the hotspot-compiler-dev
mailing list