On Thu, 12 Mar 2026 13:31:03 GMT, Christian Hagedorn <[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 This pull request has now been integrated. Changeset: db5c1873 Author: Christian Hagedorn <[email protected]> URL: https://git.openjdk.org/valhalla/commit/db5c1873025c0a9c4daf45cfa0e6c4ceec985061 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8379791: [lworld] C2: Blackhole wrongly treated as subclass of MemBar in NodeClasses enum Reviewed-by: qamai ------------- PR: https://git.openjdk.org/valhalla/pull/2220
