[Bug malloc/24903] New: malloc/tst-mxfast fails on i386

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] New: malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

            Bug ID: 24903
           Summary: malloc/tst-mxfast fails on i386
           Product: glibc
           Version: 2.31
            Status: NEW
          Severity: minor
          Priority: P3
         Component: malloc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
            Target: i686-linux-gnu
             Flags: security-

The test fails like this (also when run by the harness):

GLIBC_TUNABLES=glibc.malloc.tcache_count=0:glibc.malloc.mxfast=0 bash
testrun.sh malloc/tst-mxfast
tst-mxfast: tst-mxfast.c:42: do_test: Assertion `m.smblks == 0' failed.
Didn't expect signal from child: got `Aborted'

The assert is incorrect too, it should be TEST_VERIFY.  Furthermore, the
copyright date on the file is wrong (it was committed in 2019).  mallinfo() is
a format glitch, too.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=24906

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
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.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
(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.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

--- Comment #3 from Carlos O'Donell <carlos at redhat dot com> ---
Patch posted to fix this:
https://www.sourceware.org/ml/libc-alpha/2019-10/msg00952.html

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |dj at redhat dot com

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by DJ Delorie <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ff12e0fb91b9072800f031cb21fb2651ee7b6251

commit ff12e0fb91b9072800f031cb21fb2651ee7b6251
Author: DJ Delorie <[hidden email]>
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.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

dj at redhat dot com <dj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #5 from dj at redhat dot com <dj at redhat dot com> ---
I fixed the cause of the bug but not the details in the test case itself,
leaving open for that purpose.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

dj at redhat dot com <dj at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from dj at redhat dot com <dj at redhat dot com> ---
The test itself was fixed in commit f9769a239784772453d595bc2f4bed8739810e06
(2019-08-15)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.28/master branch has been updated by Arjun Shankar
<[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f144981490bd2ab13189d85902ca74beecb307e4

commit f144981490bd2ab13189d85902ca74beecb307e4
Author: DJ Delorie <[hidden email]>
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)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

--- Comment #8 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.29/master branch has been updated by Arjun Shankar
<[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a683450f261d7e79abc543481f7f473abdb9b406

commit a683450f261d7e79abc543481f7f473abdb9b406
Author: DJ Delorie <[hidden email]>
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)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

glaubitz at physik dot fu-berlin.de
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.30/master branch has been updated by Arjun Shankar
<[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=919af705eef416f4469341dfdf4ca23450f30236

commit 919af705eef416f4469341dfdf4ca23450f30236
Author: DJ Delorie <[hidden email]>
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)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug malloc/24903] malloc/tst-mxfast fails on i386

Sourceware - glibc-bugs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=24903

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.31

--
You are receiving this mail because:
You are on the CC list for the bug.