This is the mail archive of the
mailing list for the glibc project.
Re: Fix assertion in malloc.c:tcache_get
- From: DJ Delorie <dj at delorie dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: joseph at codesourcery dot com, libc-alpha at sourceware dot org
- Date: Wed, 06 Feb 2019 11:37:41 -0500
- Subject: Re: Fix assertion in malloc.c:tcache_get
"Carlos O'Donell" <firstname.lastname@example.org> writes:
> On 2/4/19 6:36 PM, DJ Delorie wrote:
>> Joseph Myers <email@example.com> writes:
>>> - assert (tcache->entries[tc_idx] > 0);
>>> + assert (tcache->counts[tc_idx] > 0);
>> Yes please :-)
> Did we backport this anywhere that needs this fix?
Amusingly, the code still kinda works correctly as long as pointers are
considered unsigned. The assert will only trigger if the pointer is
NULL, which would have caused a segfault a few lines later anyway.