GNU bug report logs - #36649
27.0.50; pure space and pdumper

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> gmail.com>

Date: Sun, 14 Jul 2019 14:27:01 UTC

Severity: wishlist

Tags: patch

Found in version 27.0.50

Done: Pip Cet <pipcet <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pip Cet <pipcet <at> protonmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#36649: closed (27.0.50; pure space and pdumper)
Date: Wed, 05 Feb 2025 09:23:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 05 Feb 2025 09:22:10 +0000
with message-id <874j18u4pr.fsf <at> protonmail.com>
and subject line bug#36649: 27.0.50; pure space and pdumper
has caused the debbugs.gnu.org bug report #36649,
regarding 27.0.50; pure space and pdumper
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
36649: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36649
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pip Cet <pipcet <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; pure space and pdumper
Date: Sun, 14 Jul 2019 14:26:06 +0000
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.)


[Message part 3 (message/rfc822, inline)]
From: Pip Cet <pipcet <at> protonmail.com>
To: 36649-done <at> debbugs.gnu.org
Subject: bug#36649: 27.0.50; pure space and pdumper
Date: Wed, 05 Feb 2025 09:22:10 +0000
Commit bf97946d7dc460b7d3c3ce03193041b891b51faf removed purespace,
so I'm closing this bug.



This bug report was last modified 199 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.