On Thu, 12 Mar 2026 13:36:10 GMT, Quan Anh Mai <[email protected]> wrote:
>> When blackhole support was added for inline types with >> [JDK-8267791](https://bugs.openjdk.org/browse/JDK-8267791), we wanted to be >> able to call `is/as_Blackhole()` and added an entry to the `NodeClasses` >> enum. But it accidentally ended up being defined as subclass of `MemBar` >> (subclassing `MultiNode`) even though `Blackhole` is directly subclassing >> `MultiNode`. >> >> This was not noticed until running UBSAN with blackhole tests which failed >> here: >> >> https://github.com/openjdk/valhalla/blob/80c30478fd8d272b233082e3e9ebb0ff2771d2d3/src/hotspot/share/opto/compile.cpp#L3850-L3852 >> >> In the crash, `n` is a `Blackhole` and due to the wrong definition, >> `n->as_Membar()` succeeded. We then call `mb->trailing_store()` which reads >> the `MemBar::_kind` enum which is just some garbage for a `Blackhole`. UBSAN >> reported that the found value is (obviously) not a valid value for that enum. >> >> The fix is straight forward to move the definition in `NodeClasses` to the >> proper place under `MultiNode`. >> >> Thanks, >> Christian > > Looks good to me. Thanks @merykitty for your review! ------------- PR Comment: https://git.openjdk.org/valhalla/pull/2220#issuecomment-4050628226
