Line CHECK_GE(Sci->Stats.PoppedBlocks, Sci->Stats.PushedBlocks);may FAIL when PoppedBlocks crosses UINT32_MAX while PushedBlocks not.
Problem reproduction
std::list<void*> g_list;
while (true)
{
g_list.clear();
for (int i = 0; i < 10000; ++i)
{
void *p = malloc(1600);
g_list.push_back(p);
}
for (auto i : g_list)
{
free(i);
}
}
If malloc executes for about UINT32_MAX times, then CHECK_GE will fail.
Version
This problem occurs with scudo version in 2019(the specific version number not known).
The newest version(2023.12.18) has change CHECK_GE to DCHECK_GE, but this problem still exists.
This should be fixed as we move to a single primary.h instead of two. The primary64.h, which will be the new base, does not appear to have this same issue.
scudo/CHECK_GE failed
Crash outputs
Location
file: primary32.h
lines:
Line
CHECK_GE(Sci->Stats.PoppedBlocks, Sci->Stats.PushedBlocks);
may FAIL when PoppedBlocks crossesUINT32_MAX
whilePushedBlocks
not.Problem reproduction
If
malloc
executes for aboutUINT32_MAX
times, thenCHECK_GE
will fail.Version
This problem occurs with scudo version in 2019(the specific version number not known). The newest version(2023.12.18) has change
CHECK_GE
toDCHECK_GE
, but this problem still exists.