openj9
openj9 copied to clipboard
Avoid segfaults in j9vmem_testOverlappingSegments
Since the keepCycles
array is zero-initialized, if the test is aborted in the very first cycle (i == 0
) the cleanup procedure at the end cannot rely on the fact that keepCycles[j] >= i
implies that segment j
must be freed. Before these changes, such a scenario would cause the test to segfault during cleanup.
Fixes: https://github.com/eclipse-openj9/openj9/issues/19509