segfault in free #1

Open
opened 2025-12-13 05:46:29 +00:00 by thrieg · 0 comments
Owner

"else if (header->zone->type == E_SMALL)
{
header->occupied = false;
defrag_zone(header->zone);
}
else if (header->zone->type == E_TINY)
{
header->occupied = false;
defrag_zone(header->zone);
}
else
{
pthread_mutex_unlock(&g_mut);
return; // we didn't allocate this ptr
}"

defrag_zone can mummap the zone, so "else if (header->zone->type == E_TINY)" segfault (header not in user space anymore)

"else if (header->zone->type == E_SMALL) { header->occupied = false; defrag_zone(header->zone); } else if (header->zone->type == E_TINY) { header->occupied = false; defrag_zone(header->zone); } else { pthread_mutex_unlock(&g_mut); return; // we didn't allocate this ptr }" defrag_zone can mummap the zone, so "else if (header->zone->type == E_TINY)" segfault (header not in user space anymore)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: thrieg/ft_malloc#1
No description provided.