RFR: 8346881: [ubsan] logSelection.cpp:154:24 / logSelectionList.cpp:72:94 : runtime error: applying non-zero offset 1 to null pointer

Christoph Langer clanger at openjdk.org
Thu Jan 2 14:15:36 UTC 2025


On Thu, 2 Jan 2025 13:46:23 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> src/hotspot/share/logging/logSelectionList.cpp line 96:
>> 
>>> 94:     if (comma_pos == nullptr) {
>>> 95:       break;
>>> 96:     }
>> 
>> I think this check is not necessary here since it is checked in the for loop condition already - or am I overlooking something?
>
> Unfortunately we still run into the issue , even with the existing loop condition.
> check the flowchart of the for loop 
> https://www.programiz.com/cpp-programming/for-loop
> the update condition is done after the body ; then we run into the issue.

Ah, right, I see. But in that case, we can/should remove the check for comma_pos != nullptr from the condition because we're explicitly doing it in the loop body then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22903#discussion_r1900917284


More information about the hotspot-runtime-dev mailing list