This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/22159] malloc: MALLOC_CHECK_ broken with --enable-tunables=no
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 17 Oct 2017 17:57:50 +0000
- Subject: [Bug malloc/22159] malloc: MALLOC_CHECK_ broken with --enable-tunables=no
- Auto-submitted: auto-generated
- References: <bug-22159-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=22159
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 3381be5cdef2e43949db12f66a5a3ec23b2c4c90 (commit)
from e956075a5a2044d05ce48b905b10270ed4a63e87 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3381be5cdef2e43949db12f66a5a3ec23b2c4c90
commit 3381be5cdef2e43949db12f66a5a3ec23b2c4c90
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date: Tue Oct 17 18:55:16 2017 +0100
Improve malloc initialization sequence
The current malloc initialization is quite convoluted. Instead of
sometimes calling malloc_consolidate from ptmalloc_init, call
malloc_init_state early so that the main_arena is always initialized.
The special initialization can now be removed from malloc_consolidate.
This also fixes BZ #22159.
Check all calls to malloc_consolidate and remove calls that are
redundant initialization after ptmalloc_init, like in int_mallinfo
and __libc_mallopt (but keep the latter as consolidation is required for
set_max_fast). Update comments to improve clarity.
Remove impossible initialization check from _int_malloc, fix assert
in do_check_malloc_state to ensure arena->top != 0. Fix the obvious bugs
in do_check_free_chunk and do_check_remalloced_chunk to enable single
threaded malloc debugging (do_check_malloc_state is not thread safe!).
[BZ #22159]
* malloc/arena.c (ptmalloc_init): Call malloc_init_state.
* malloc/malloc.c (do_check_free_chunk): Fix build bug.
(do_check_remalloced_chunk): Fix build bug.
(do_check_malloc_state): Add assert that checks arena->top.
(malloc_consolidate): Remove initialization.
(int_mallinfo): Remove call to malloc_consolidate.
(__libc_mallopt): Clarify why malloc_consolidate is needed.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 +++
malloc/arena.c | 13 +---
malloc/malloc.c | 197 ++++++++++++++++++++++++------------------------------
3 files changed, 103 insertions(+), 118 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.