From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36649: 27.0.50; pure space and pdumper Date: Sun, 14 Jul 2019 14:26:06 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="243704"; mail-complaints-to="usenet@blaine.gmane.org" To: 36649@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 16:27:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmfT8-0011Cm-2h for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 16:27:14 +0200 Original-Received: from localhost ([::1]:60812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmfT0-0004Pm-Jr for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 10:27:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48577) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmfSw-0004P7-VZ for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:27:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmfSv-0002dR-W4 for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36751) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmfSv-0002dN-SI for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmfSv-0000OJ-O2 for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 14:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36649 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15631144071479 (code B ref -1); Sun, 14 Jul 2019 14:27:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2019 14:26:47 +0000 Original-Received: from localhost ([127.0.0.1]:45572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmfSg-0000Nm-LZ for submit@debbugs.gnu.org; Sun, 14 Jul 2019 10:26:46 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmfSe-0000Nf-UV for submit@debbugs.gnu.org; Sun, 14 Jul 2019 10:26:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48493) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmfSe-0004Ob-0Q for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:26:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmfSd-0002UV-2Y for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:26:43 -0400 Original-Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]:33169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmfSc-0002Tx-TV for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 10:26:43 -0400 Original-Received: by mail-ot1-x336.google.com with SMTP id q20so14221574otl.0 for ; Sun, 14 Jul 2019 07:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uECDt1XErh/ygfl3ZznBBxBSXpZhBMMpJayEV/QQRg0=; b=pK2sU8Pa+lHe2FYjwvKoP2UEC5P5qYQESUhqRDpKq4q80hSKN0Iba1GvvsJn+cxK6F wUTHeEJNrfj0ioOxIql2Xs0vS4CZJg5damp9CI152hcLA1wlfnsbFnC8Geqq3XiAOtfv Y7pQFjCfxRa72GnJ6HJOxzsqBOAuu7I5EZQLRARDZ3LiK6hXabiu4axQtyNOKT91b67i V4qMNuXTTjS9lTL3dCOEGXmRULnB5KRNatPog5uyweF4C9aD4dEtk9DzfloGBEeEmkay iYQri4YRROIMG7oj+zYIHJM1HE2OTixdaMIVEtbBPSo/mzeGheCj3Pg04t9UEcKQ9ZVJ vITA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uECDt1XErh/ygfl3ZznBBxBSXpZhBMMpJayEV/QQRg0=; b=CO7q6YwtgAFBYpPompfOmHSGFNIqxVIC/iZ2HWPhSjYUWfAGTNaQd19xZJVkjSqnLb nrWkFjQAWUxzvT5gCeCp8fAbyR17b6VFRDXTpMmO4k7wkmnVLVCKduM1yw0/yn4DnZ7k 50XD9bw3TCaq9lTHJ0/vuTNAUhNNOGMOXYkRkRQEjabegWQhONmIUNKB9Z94Nmh4B2mq b+++7FdYZ1X/WCc0kL+G49pq0hQQVv25n5afhne4+K3rnz15xPjzSCyl6qkN+g/O+IfL PSNZJQWAbfStyZbvpmL67yTPZTPu/VhF5N2gy0iWihNU4rNLgJ6PchoyaXkpYiVddsTW 1jBA== X-Gm-Message-State: APjAAAWjh0mmyKO70zlVDkZ8TXFOcjTdhatXoTJnUTC/EHB0W62vh/j+ iBbOxf5LVOObn9TsvI8Y+b0519cbIiLvSIwP4sT3H8aq X-Google-Smtp-Source: APXvYqx3tryQ+bsP1sgxrf1tHGu9Uyt1yLf43DKvrLMhRUctcTCTQkDeBIlcpRbVXmXfujLfOL4l1jB9C61oAn73wNo= X-Received: by 2002:a9d:744f:: with SMTP id p15mr16945889otk.287.1563114401868; Sun, 14 Jul 2019 07:26:41 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:162987 Archived-At: This is a follow-up to bug #36447, which has been fixed and closed. Currently, pure space is wasted when using pdumper, and CHECK_IMPURE does nothing at run time. The current situation when using pdumper is this: - pure space is put into the initial emacs executable as an all-zero area with a single 1 in it, which is used to prevent the area being placed into BSS - before dump, data is placed into the pure space by purecopy - before dump, PURE_P returns true for pure data, and CHECK_IMPURE dies for pure arguments - when dumping, pure data is indiscriminately mixed with impure data and placed in the pdumper file without special treatment of any kind - when launching the real emacs, pure space is also initialized from the executable, as an all-zero area - all data from the pdumper file is restored to heap memory, without distinguishing formerly-pure data from formerly-impure data - PURE_P is never called with a pure space pointer, it essentially always returns false - CHECK_IMPURE does nothing except waste a few cycles That situation is unsatisfactory. We fail to catch modification of formerly-pure data after loading the dump, and we waste several megabytes of executable image size on zeroed data. I think we have the following options: 1. remove pure space entirely 2. remove pure space, but leave PURE_P and CHECK_IMPURE as reminders to do something about it. 3. move pure space to BSS 4. xmalloc() pure space, only when needed 5. modify pdumper to mark and recognize pure objects 6. do nothing and accept the wastefulness I prefer (2), for this reason: CHECK_IMPURE is useful, and should be extended to something like CHECK_MUTABLE, which checks for objects including: 1. pure data 2. data read with `read' 3. data explicitly marked as immutable (That would mean code like (defconst list-a (nconc '(a b c) list-b)) would cease to be valid, and that's one of the problems I'm running into with code I'm playing around with.)