From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#38492: 27.0.50; Warn pdumper users when pure space has been overflowed Date: Wed, 04 Dec 2019 20:02:12 +0100 Message-ID: <87o8wnj4nf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="213438"; mail-complaints-to="usenet@blaine.gmane.org" To: 38492@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 04 20:03:21 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 1icZvj-000tN1-EF for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 20:03:20 +0100 Original-Received: from localhost ([::1]:46006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icZvi-0001AT-8R for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2019 14:03:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50169) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icZvT-0001AL-Vj for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:03:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icZvS-0001S3-7p for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:03:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icZvS-0001Rr-3X for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1icZvR-0000VX-VG for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Dec 2019 19:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38492 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.15754861491896 (code B ref -1); Wed, 04 Dec 2019 19:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Dec 2019 19:02:29 +0000 Original-Received: from localhost ([127.0.0.1]:42685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icZuu-0000UV-OB for submit@debbugs.gnu.org; Wed, 04 Dec 2019 14:02:29 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:58297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1icZus-0000UL-TX for submit@debbugs.gnu.org; Wed, 04 Dec 2019 14:02:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50093) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1icZur-0000vq-3B for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:02:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1icZun-0000xv-Ja for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:02:24 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1icZul-0000v9-Pg for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2019 14:02:21 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id d16so463548wre.10 for ; Wed, 04 Dec 2019 11:02:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=G9uCAk3iTWnFuSHw/VNpI5xEXC+t2fOozyZO7TUr38Y=; b=Dr9rvUsQbnPr5xyyEmOoddXjC4vMxmbf0UKBgEEp3vBFoiHcRcGdiYQ6dLpnfCuIys i91Jv6kuVyVLEr1w9qxdWr2TYj0ayNmapPrdPSVW4pK+Wdn4yQ7Yb74DivhFg50GlFER LqrzceHgCw39EsjfnwzsmbyecqtbnhovUignLlMfgcyzMpGtun6DiZVLKY1t+eMqbeSN iZ3GQuEwGkNbB9RfGYRa8g4AspsUaNgs7wUfyzgWln0LfjkdrKG25D6dCjbRuYmnujit Eioj2vGusKPySVi6V/NLlbo+yj0FE8soD+jaqpMHYA2lVUeF+Usur9cLxfmT90Q7ThwS 84xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=G9uCAk3iTWnFuSHw/VNpI5xEXC+t2fOozyZO7TUr38Y=; b=qmuxQIDdaSEw46oNj49qva7eZ+mUafj8b4TT2yciMhEegrZ52Bqr+4FBAnGUs5QVN/ 0K3cCWVR6cZH5zkurA7lA8Ybj+9x0319PvySYhHCr4xrPxgYfOatp3mR3GABf3xVWBye hyk5AlGfaS2ZKYfyKfwPHFpO8NaTE3bwV+uZxmmGP5B0tchB45orOJ0Tvwlvpk/JYBfj 7YG30Ko2dg9YADdgWsdPuA39jIGnyY7hfjCiumh4GaTCLbyN3jLTRkHVYRTASTDfa0i+ TQ4AO4CijDzfjirmyIbjeXaUUydl2Mf63BRekpfMxEt8/GEr0/7lpLsFTdpE+8EB0ksK 0EAA== X-Gm-Message-State: APjAAAWnixfUR9ZshjRC3jfvpPQTkxRnOmodSaifCFwQ3ceCidsKImep 2z2ZF21qpWxYMNwlZyH1Hdvi6nCh X-Google-Smtp-Source: APXvYqwbmNkkfSmjDz8C1e6u27vEs/JE9c0V0Uc/Bi+KkSkStX/o47HuYjYTWkmXNk2iqxwC+bqrRA== X-Received: by 2002:adf:f1cb:: with SMTP id z11mr5534727wro.375.1575486136888; Wed, 04 Dec 2019 11:02:16 -0800 (PST) Original-Received: from little-buster (2a01cb04010fc800a9966e0b19f92b66.ipv6.abo.wanadoo.fr. [2a01:cb04:10f:c800:a996:6e0b:19f9:2b66]) by smtp.gmail.com with ESMTPSA id z64sm8400715wmg.30.2019.12.04.11.02.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2019 11:02:15 -0800 (PST) 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:172846 Archived-At: --=-=-= Content-Type: text/plain Hello, For some reason, one of my setups[1] experiences a pure storage overflow with the current master[2]. Searching previous bug reports for the warning[3] led me to understand that increasing BASE_PURESIZE in src/puresize.h would solve the issue; since I didn't have the patience to recompile possibly multiple times, I tried to find a way to know exactly how much I should increase this value. I noticed that Fdump_emacs uses check_pure_size from alloc.c to print a warning before dumping when this happens. The following patch exposes check_pure_size when we HAVE_PDUMPER, so that Fdump_emacs_portable can use it too. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Warn-pdumper-users-when-pure-space-has-been-overflow.patch >From 02a48f2388932ae78460a76f74e27202212994d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Wed, 4 Dec 2019 18:22:29 +0100 Subject: [PATCH] Warn pdumper users when pure space has been overflowed * src/alloc.c (check_pure_size): Expose when using the portable dumper. * src/pdumper.c (Fdump_emacs_portable): Use it. --- src/alloc.c | 2 +- src/pdumper.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alloc.c b/src/alloc.c index 9fbd0d0573..52ea87c7b7 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5125,7 +5125,7 @@ pure_alloc (size_t size, int type) } -#ifdef HAVE_UNEXEC +#if defined HAVE_UNEXEC || defined HAVE_PDUMPER /* Print a warning if PURESIZE is too small. */ diff --git a/src/pdumper.c b/src/pdumper.c index 74f198c4ae..721d23e696 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4004,6 +4004,8 @@ DEFUN ("dump-emacs-portable", { eassert (initialized); + check_pure_size (); + if (will_dump_with_unexec_p ()) error ("This Emacs instance was started under the assumption " "that it would be dumped with unexec, not the portable " -- 2.20.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable That gets me a helpful error message at compile-time[4] (as well as an intriguing warning[5]) that let me figure out how much I should increase BASE_PURESIZE by, recompile Emacs and run it with no further warnings about pure storage overflow. Would it make sense to apply this? (Maybe not as-is: e.g. I don't know if the #if guard is still useful at this point; maybe the call to check_pure_size should be moved somewhere else=E2=80=A6) Thank you for your time. [1] Debian Buster on Samsung NC10 (32-bit, 2GB RAM). [2] 8bea7e9ab4453da71d9766d582089154f31de907 [3] Warning (initialization): Building Emacs overflowed pure space. (See t= he node Pure Storage in the Lisp manual for details.) [4] emacs:0:Pure Lisp storage overflow (approx. 2005404 bytes needed) [5] alloc.c:5136:14: warning: format =E2=80=98%d=E2=80=99 expects argument = of type =E2=80=98int=E2=80=99, but argument 2 has type =E2=80=98intmax_t=E2= =80=99 {aka =E2=80=98long long int=E2=80=99} [-Wformat=3D] message (("emacs:0:Pure Lisp storage overflow (approx. %"pI"d" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " bytes needed)"), ~~~~~~~~~~~~~~~~~ I tried to puzzle this one out by looking at the definition for pI in lisp.h, but I am not sure how to proceed. The warning suggests that pI is defined as "" since the final format is %d, which means that I should look into this snippet: # elif INTPTR_MAX <=3D INT_MAX && !defined WIDE_EMACS_INT typedef int EMACS_INT; typedef unsigned int EMACS_UINT; enum { EMACS_INT_WIDTH =3D INT_WIDTH, EMACS_UINT_WIDTH =3D UINT_WIDTH }; # define EMACS_INT_MAX INT_MAX # define pI "" =E2=80=A6 I can probably dig into this to see what's wrong on my setup[= 1], but I'll bank on someone more experienced going "Oh well duh" and fixing whatever needs fixing (assuming the problem isn't on my end). In GNU Emacs 27.0.50 (build 11, i686-pc-linux-gnu, GTK+ Version 3.24.5, cai= ro version 1.16.0) of 2019-11-17 built on little-buster Repository revision: 1c29ba034092660e73bce8c6ff459c75ff2c2d72 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Configured using: 'configure --with-xwidgets --with-cairo' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Features: (shadow sort mail-extr emacsbug sendmail etags fileloop generator xref vc-mtn vc-hg mule-util warnings filecache markdown-mode rx color noutline outline help-fns radix-tree magit-extras sh-script smie flyspell ispell executable cus-edit wid-edit whitespace notifications dbus xml misearch multi-isearch bug-reference cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs thingatpt magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process magit-mode git-commit magit-git magit-section magit-utils crm log-edit message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor async-bytecomp async shell pcomplete server dash vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs project delight eighters-theme rg rg-info-hack advice rg-menu transient cl-extra format-spec rg-ibuffer rg-result wgrep-rg wgrep s rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs grep compile comint ansi-color ring quail help-mode edmacro kmacro disp-table paren mb-depth icomplete page-break-lines elec-pair diff-hl-flydiff diff diff-hl vc-dir ewoc vc vc-dispatcher diff-mode easy-mmode delsel cus-start cus-load tex-site info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 8 330562 41453) (symbols 24 23104 2) (strings 16 73924 11567) (string-bytes 1 2445511) (vectors 8 42019) (vector-slots 4 959888 63404) (floats 8 281 269) (intervals 28 21802 357) (buffers 568 52)) --=-=-=--