From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.emacs.bugs Subject: bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid malloc patch for elf systems Date: Sun, 20 Dec 2015 21:51:17 -0500 Message-ID: <20151221025117.GV238@brightrain.aerifal.cx> References: <85poynxvgy.fsf@iznogoud.viz> <567120C0.6080803@cs.ucla.edu> <85h9jhdxl2.fsf@iznogoud.viz> <56772CB2.8060004@cs.ucla.edu> <20151221015952.GU238@brightrain.aerifal.cx> <567765EF.80401@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1450666339 21472 80.91.229.3 (21 Dec 2015 02:52:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Dec 2015 02:52:19 +0000 (UTC) Cc: Wolfgang Jenkner , 22086@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 21 03:52:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aAqa1-0001Zc-FE for geb-bug-gnu-emacs@m.gmane.org; Mon, 21 Dec 2015 03:52:09 +0100 Original-Received: from localhost ([::1]:42839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAqa0-0001Bi-TS for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2015 21:52:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAqZx-0001BU-Je for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:52:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAqZu-0001Ln-D6 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:52:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAqZu-0001Lg-9w for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aAqZu-00075K-3E for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2015 21:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rich Felker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Dec 2015 02:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22086-submit@debbugs.gnu.org id=B22086.145066628327131 (code B ref 22086); Mon, 21 Dec 2015 02:52:02 +0000 Original-Received: (at 22086) by debbugs.gnu.org; 21 Dec 2015 02:51:23 +0000 Original-Received: from localhost ([127.0.0.1]:58440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAqZG-00073W-Qo for submit@debbugs.gnu.org; Sun, 20 Dec 2015 21:51:22 -0500 Original-Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:42173 helo=brightrain.aerifal.cx) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aAqZF-00073P-Of for 22086@debbugs.gnu.org; Sun, 20 Dec 2015 21:51:22 -0500 Original-Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1aAqZB-0004xK-00; Mon, 21 Dec 2015 02:51:17 +0000 Content-Disposition: inline In-Reply-To: <567765EF.80401@cs.ucla.edu> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:110226 Archived-At: On Sun, Dec 20, 2015 at 06:37:35PM -0800, Paul Eggert wrote: > Rich Felker wrote: > >I don't object to this change if you can reliably ensure that nothing > >in the pre-dump emacs will call malloc. > > We can't reliably ensure that, I'm afraid, as Emacs might call some > library function that in turn calls malloc. It might be a 3rd-party > library that Emacs has no control over. > > Why can't pre-dump emacs call malloc? Is it a performance thing or a > correctness thing? If a performance thing it shouldn't be much of a > problem, as we can arrange for Emacs to never directly call malloc, > and that should be the vast majority of the calls. It's a correctness thing. The dumper can only dump the brk heap that's contiguous with .data/.bss (and even that's not contiguous on modern hardened kernels). This is why fake brk in static storage has to be used by hybrid malloc. But even if the system malloc did guarantee contiguity, it's not valid to keep using heap data structures from one instance of the allocator with a new instance of the allocator, and there are different failure modes for static and dynamic linking, but both are bad. In practice it _might_ work to varying degrees, but it's fundamentally fragile and wrong. Rich