RFR: 8352420: [ubsan] codeBuffer.cpp:984:27: runtime error: applying non-zero offset 18446744073709486080 to null pointer

Vladimir Kozlov kvn at openjdk.org
Thu Mar 20 18:03:09 UTC 2025


On Thu, 20 Mar 2025 17:56:23 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> This PR addresses undefined behavior in CodeBuffer by making `verify_section_allocation` return early for a partially initialized CodeBuffer.
>
> src/hotspot/share/asm/codeBuffer.hpp line 550:
> 
>> 548:     initialize_misc(name);
>> 549:     _total_start = 0;
>> 550:     _total_size  = 0;
> 
> May be we should move this initialization from `initialize()` to `initialize_misc()` so you don't need to do this here.

Otherwise following constructor also doesn't set them. `initialize(csize_t code_size, csize_t locs_size)` does not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24118#discussion_r2006181928


More information about the hotspot-compiler-dev mailing list