RFR: 8297138: UB leading to crash in Amalloc with optimized builds

Coleen Phillimore coleenp at openjdk.org
Mon Nov 28 14:58:21 UTC 2022


On Wed, 23 Nov 2022 12:52:04 GMT, Afshin Zafari <duke at openjdk.org> wrote:

> 8297138: UB leading to crash in Amalloc with optimized builds

Ok, I've changed my mind.  UseMallocOnly is protected by #ifdef ASSERT in other places that are untouched by this change.  So the free_malloced_objects call should be under #ifdef ASSERT and the function definitions should be under #ifdef ASSERT (not PRODUCT).
It should use the capital DEBUG_ONLY though not the lower case DEBUG_ONLY.
Also Arena::malloc name should be changed to malloc_object just so it's not just malloc.

inline void Arena::free_all(char** start, char** end) {
Should be not a member of Arena, ie. should be static inline.

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

Changes requested by coleenp (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11320


More information about the hotspot-runtime-dev mailing list