From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.comp.lib.glibc.alpha,gmane.emacs.devel Subject: Re: Removal of unexec support from glibc malloc Date: Sat, 23 Jan 2016 09:00:56 +0200 Message-ID: <83r3h86aqf.fsf@gnu.org> References: <569CDB81.6040600@redhat.com> <569D3BE0.6050103@cs.ucla.edu> <569D4207.4060209@cs.ucla.edu> <569D6AE6.1060008@redhat.com> <83bn8icjqu.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1453532458 14155 80.91.229.3 (23 Jan 2016 07:00:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jan 2016 07:00:58 +0000 (UTC) Cc: emacs-devel@gnu.org, libc-alpha@sourceware.org To: Stefan Monnier Original-X-From: libc-alpha-return-66530-glibc-alpha=m.gmane.org@sourceware.org Sat Jan 23 08:00:52 2016 Return-path: Envelope-to: glibc-alpha@plane.gmane.org Original-Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aMsBm-0000pV-NQ for glibc-alpha@plane.gmane.org; Sat, 23 Jan 2016 08:00:51 +0100 DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:cc:in-reply-to:subject :reply-to:references; q=dns; s=default; b=yTlqfnz2+kzl4RxYEqYdW+ 0XBNZJNyhjPudPIA/eROOUbX3GjKxnmctOxC10hhLhFAgIWscV4eqbpPcVhJeF9M w4PiNRb6OwrVw2BgJqfXbbBaK+z7OJj4x/puxWGWUPvLsXpdk5WWn24UdUzsYHt/ ZICd7bhl0EU8+2BBzYYLc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:cc:in-reply-to:subject :reply-to:references; s=default; bh=Xs+OrRIyIwbFJMiTxfhrX5GkksA=; b= Y1kJtva7SlQWp/UNE8Iru3oauSO6Fv66XnSgFEzGH3BmLCPfTtgz0nExEshuKyl3 sO6VEfnhmWGf+OTA4+7bUlESvG5//7tfyFtMuUL0lhODaIjCSllZB87TukAjkyZa JipYuZcX9+rxPqSgdrUfEhlf39LUmipBRLg9U8GT5Yg= Original-Received: (qmail 26753 invoked by alias); 23 Jan 2016 07:00:46 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Original-Received: (qmail 26730 invoked by uid 89); 23 Jan 2016 07:00:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:946, frozen, HX-Received-From:134, HX-Received-From:4830 X-HELO: eggs.gnu.org In-reply-to: (message from Stefan Monnier on Sat, 23 Jan 2016 00:49:02 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e Xref: news.gmane.org gmane.comp.lib.glibc.alpha:58814 gmane.emacs.devel:198618 Archived-At: > From: Stefan Monnier > Date: Sat, 23 Jan 2016 00:49:02 -0500 > Cc: libc-alpha@sourceware.org > > >> This is less of a problem if Emacs never frees a pointer after dump that > >> it has allocated before dump. But I think this can happen (otherwise, > >> all this would be quite easy to address). > > Yes, it can and does happen, although not much. > > Indeed. This said, it'd make sense to try and avoid doing it. AFAICS, it happens due to the following: . We call regex.c functions, which reuse an allocated buffer, extending it (via realloc) as needed; that buffer gets frozen with malloc arena used during dumping . We delete the terminal frame used by temacs and free its resources . Not 100% sure, but I think we also release/reallocate some font-related stuff It's easy to catch all those cases by setting a breakpoint on realloc and free during startup.