Summary: | malloc/tst-mxfast fails on i386 | ||
---|---|---|---|
Product: | glibc | Reporter: | Florian Weimer <fweimer> |
Component: | malloc | Assignee: | dj <dj> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | carlos |
Priority: | P3 | Flags: | fweimer:
security-
|
Version: | 2.31 | ||
Target Milestone: | 2.31 | ||
See Also: | https://sourceware.org/bugzilla/show_bug.cgi?id=24906 | ||
Host: | Target: | i686-linux-gnu | |
Build: | Last reconfirmed: |
Description
Florian Weimer
2019-08-13 15:16:52 UTC
This looks related to bug 24906 due to the way set_max_fast is defined: #define set_max_fast(s) \ global_max_fast = (((s) == 0) \ ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) On i386, set_max_fast (0) does not actually disable fastbins, I think. (In reply to Florian Weimer from comment #1) > This looks related to bug 24906 due to the way set_max_fast is defined: > > #define set_max_fast(s) \ > global_max_fast = (((s) == 0) \ > ? SMALLBIN_WIDTH : ((s + SIZE_SZ) & ~MALLOC_ALIGN_MASK)) > > On i386, set_max_fast (0) does not actually disable fastbins, I think. It should always set things to a smallbin width that is smaller than the allowed smallbin width. If it doesn't then it's a bug in the i686 support. Patch posted to fix this: https://www.sourceware.org/ml/libc-alpha/2019-10/msg00952.html The master branch has been updated by DJ Delorie <dj@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ff12e0fb91b9072800f031cb21fb2651ee7b6251 commit ff12e0fb91b9072800f031cb21fb2651ee7b6251 Author: DJ Delorie <dj@redhat.com> Date: Wed Oct 30 18:03:14 2019 -0400 Base max_fast on alignment, not width, of bins (Bug 24903) set_max_fast sets the "impossibly small" value based on, eventually, MALLOC_ALIGNMENT. The comparisons for the smallest chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 is the only platform where these are the same, so a smallest chunk *would* be put in a no-fastbins fastbin. This change calculates the "impossibly small" value based on MIN_CHUNK_SIZE instead, so that we can know it will always be impossibly small. I fixed the cause of the bug but not the details in the test case itself, leaving open for that purpose. The test itself was fixed in commit f9769a239784772453d595bc2f4bed8739810e06 (2019-08-15) The release/2.28/master branch has been updated by Arjun Shankar <arjun@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f144981490bd2ab13189d85902ca74beecb307e4 commit f144981490bd2ab13189d85902ca74beecb307e4 Author: DJ Delorie <dj@redhat.com> Date: Wed Oct 30 18:03:14 2019 -0400 Base max_fast on alignment, not width, of bins (Bug 24903) set_max_fast sets the "impossibly small" value based on, eventually, MALLOC_ALIGNMENT. The comparisons for the smallest chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 is the only platform where these are the same, so a smallest chunk *would* be put in a no-fastbins fastbin. This change calculates the "impossibly small" value based on MIN_CHUNK_SIZE instead, so that we can know it will always be impossibly small. (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251) The release/2.29/master branch has been updated by Arjun Shankar <arjun@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a683450f261d7e79abc543481f7f473abdb9b406 commit a683450f261d7e79abc543481f7f473abdb9b406 Author: DJ Delorie <dj@redhat.com> Date: Wed Oct 30 18:03:14 2019 -0400 Base max_fast on alignment, not width, of bins (Bug 24903) set_max_fast sets the "impossibly small" value based on, eventually, MALLOC_ALIGNMENT. The comparisons for the smallest chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 is the only platform where these are the same, so a smallest chunk *would* be put in a no-fastbins fastbin. This change calculates the "impossibly small" value based on MIN_CHUNK_SIZE instead, so that we can know it will always be impossibly small. (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251) The release/2.30/master branch has been updated by Arjun Shankar <arjun@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=919af705eef416f4469341dfdf4ca23450f30236 commit 919af705eef416f4469341dfdf4ca23450f30236 Author: DJ Delorie <dj@redhat.com> Date: Wed Oct 30 18:03:14 2019 -0400 Base max_fast on alignment, not width, of bins (Bug 24903) set_max_fast sets the "impossibly small" value based on, eventually, MALLOC_ALIGNMENT. The comparisons for the smallest chunk used is, eventually, MIN_CHUNK_SIZE. Note that i386 is the only platform where these are the same, so a smallest chunk *would* be put in a no-fastbins fastbin. This change calculates the "impossibly small" value based on MIN_CHUNK_SIZE instead, so that we can know it will always be impossibly small. (cherry picked from commit ff12e0fb91b9072800f031cb21fb2651ee7b6251) |