GNU bug report logs - #42790
[PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file

Previous Next

Package: emacs;

Reported by: <lin.sun <at> zoom.us>

Date: Mon, 10 Aug 2020 03:22:02 UTC

Severity: normal

Tags: confirmed, help, patch

Merged with 35503, 43050

Found in versions 27.0.50, 28.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42790 in the body.
You can then email your comments to 42790 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 10 Aug 2020 03:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <lin.sun <at> zoom.us>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 10 Aug 2020 03:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <lin.sun <at> zoom.us>
To: <bug-gnu-emacs <at> gnu.org>,
	"'Eli Zaretskii'" <eliz <at> gnu.org>
Subject: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Mon, 10 Aug 2020 11:21:32 +0800
[Message part 1 (text/plain, inline)]
Hi,

The pdmp file always named as "emcas.pdmp", this will cause error in my
local that I build two Emacs with different configuration options and
different suffix from same source tree. Here are configure lines:

$ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
$ cd ~/emacs-nor && ~/emacs/configure # normal build

After installation, run the first installed Emacs binary, there is
error message as follow:

emacs: could not load dump file "... emacs.pdmp": not built for this
Emacs executable

This patch will add the version info to pdmp file name to avoid the error.
After apply this patch, pdmp file in my case will be "emacs-27.1.pdmp" 
and "emacs-27.1m.pdmp", Emacs will load pdmp file correctly.
[0001-Makefile.in-Add-version-info-into-file-name-emacs.pd.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 10 Aug 2020 08:28:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: via "Bug reports for GNU Emacs, the Swiss army knife of text editors"
 <bug-gnu-emacs <at> gnu.org>
Cc: eliz <at> gnu.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Mon, 10 Aug 2020 10:27:45 +0200
On Aug 10 2020, via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

> This patch will add the version info to pdmp file name to avoid the error.

Even better would be to use the fingerprint in the file name.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 10 Aug 2020 08:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 10 Aug 2020 09:26:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <lin.sun <at> zoom.us>
To: "'Andreas Schwab'" <schwab <at> linux-m68k.org>,
 "'via Bug reports for GNU Emacs,
 the Swiss army knife of text editors'" <bug-gnu-emacs <at> gnu.org>
Cc: eliz <at> gnu.org, 42790 <at> debbugs.gnu.org
Subject: RE: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Mon, 10 Aug 2020 17:24:48 +0800
Hi Andreas,

> Even better would be to use the fingerprint in the file name.

It's an idea solution, but in a build tree the name "emacs.pdmp" is reasonable.
Another excuse, it's also too complicated to modify the c/lisp/automake files 
to support generating pdmp file name with fingerprint correctly.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 10 Aug 2020 09:26:02 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 13 Aug 2020 15:49:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Fri, 14 Aug 2020 14:54:02 GMT) Full text and rfc822 format available.

Message #22 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: <lin.sun <at> zoom.us>
Cc: eliz <at> gnu.org, 42790 <at> debbugs.gnu.org
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Fri, 14 Aug 2020 16:53:29 +0200
<lin.sun <at> zoom.us> writes:

> The pdmp file always named as "emcas.pdmp", this will cause error in my
> local that I build two Emacs with different configuration options and
> different suffix from same source tree. Here are configure lines:
>
> $ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
> $ cd ~/emacs-nor && ~/emacs/configure # normal build
>
> After installation, run the first installed Emacs binary, there is
> error message as follow:

I'm not sure I understand the use case or the recipe -- if I try
something like that, it just says

gcc: error: fontset.o: No such file or directory
gcc: error: fringe.o: No such file or directory
gcc: error: image.o: No such file or directory
gcc: error: xgselect.o: No such file or directory
gcc: error: terminfo.o: No such file or directory
gcc: error: lastfile.o: No such file or directory
make[1]: *** [Makefile:651: temacs] Error 1
make[1]: Leaving directory '/tmp/em/src'
make: *** [Makefile:424: src] Error 2

after saying "make".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 15 Aug 2020 04:53:02 GMT) Full text and rfc822 format available.

Message #25 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: <lin.sun <at> zoom.us>
To: "'Lars Ingebrigtsen'" <larsi <at> gnus.org>
Cc: eliz <at> gnu.org, 42790 <at> debbugs.gnu.org
Subject: RE: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sat, 15 Aug 2020 12:52:18 +0800
Hi Lars,

I assume you already have an environment that can compile Emacs success, and these command lines will illustrate what happened,

cd ~ && git clone --depth 1 -b emacs-27 git://git.savannah.gnu.org/emacs.git ~/emacs && cd ~/emacs && ./autogen.sh; 
mkdir -p ~/emacs-min && cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no && sudo make install;  
mkdir -p ~/emacs-nor && cd ~/emacs-nor && ~/emacs/configure && sudo make install;

Then try run /usr/local/bin/emacsm, you'll get the error message.

Regards
Lin Sun
-----Original Message-----
From: Lars Ingebrigtsen <larsi <at> gnus.org> 
Sent: Friday, August 14, 2020 22:53
To: lin.sun <at> zoom.us
Cc: 42790 <at> debbugs.gnu.org; eliz <at> gnu.org
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name "emacs.pdmp" to avoid mismatch pdmp file

<lin.sun <at> zoom.us> writes:

> The pdmp file always named as "emcas.pdmp", this will cause error in 
> my local that I build two Emacs with different configuration options 
> and different suffix from same source tree. Here are configure lines:
>
> $ cd ~/emacs-min && ~/emacs/configure --program-suffix=m --with-x=no...
> $ cd ~/emacs-nor && ~/emacs/configure # normal build
>
> After installation, run the first installed Emacs binary, there is 
> error message as follow:

I'm not sure I understand the use case or the recipe -- if I try something like that, it just says

gcc: error: fontset.o: No such file or directory
gcc: error: fringe.o: No such file or directory
gcc: error: image.o: No such file or directory
gcc: error: xgselect.o: No such file or directory
gcc: error: terminfo.o: No such file or directory
gcc: error: lastfile.o: No such file or directory
make[1]: *** [Makefile:651: temacs] Error 1
make[1]: Leaving directory '/tmp/em/src'
make: *** [Makefile:424: src] Error 2

after saying "make".

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 15 Aug 2020 10:43:02 GMT) Full text and rfc822 format available.

Message #28 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: <lin.sun <at> zoom.us>
Cc: eliz <at> gnu.org, 42790 <at> debbugs.gnu.org
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Sat, 15 Aug 2020 12:42:17 +0200
<lin.sun <at> zoom.us> writes:

> mkdir -p ~/emacs-min && cd ~/emacs-min && ~/emacs/configure
> --program-suffix=m --with-x=no && sudo make install;

I think the problem was that I had already built an Emacs in ~/emacs, so
it didn't want to build the .o files in ~/emacs-min, apparently...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 15 Aug 2020 10:48:01 GMT) Full text and rfc822 format available.

Message #31 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: <lin.sun <at> zoom.us>
Cc: 42790 <at> debbugs.gnu.org
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Sat, 15 Aug 2020 12:47:45 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think the problem was that I had already built an Emacs in ~/emacs, so
> it didn't want to build the .o files in ~/emacs-min, apparently...

Anyway, while your patch fixes the problem in your specific setup, it
doesn't really seem like a general fix.  Andreas's suggestion (to add
the fingerprint to the file name) seems like a safer solution.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sun, 16 Aug 2020 00:31:02 GMT) Full text and rfc822 format available.

Message #34 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: <lin.sun <at> zoom.us>
To: "'Lars Ingebrigtsen'" <larsi <at> gnus.org>
Cc: 42790 <at> debbugs.gnu.org
Subject: RE: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sun, 16 Aug 2020 08:30:30 +0800
[Message part 1 (text/plain, inline)]
Hi Lars,

Yes, I agree with you that file name with fingerprint is an idea solution.
It may be have to keep the fingerprint be synced in c/lisp/Makefile, too
complicate (for me).
The minor changes in this patch will get an pretty enhance for most
circumstances, this patch can worked before other better solution ready.

Regards
Lin Sun
[winmail.dat (application/ms-tnef, attachment)]

Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 11 Nov 2020 20:54:02 GMT) Full text and rfc822 format available.

Merged 42790 43050. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 05:48:02 GMT) Full text and rfc822 format available.

Merged 35503 42790 43050. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 05:53:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 16 Nov 2020 01:05:02 GMT) Full text and rfc822 format available.

Message #43 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: lin.sun <at> zoom.us
Cc: eliz <at> gnu.org, schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sun, 15 Nov 2020 20:03:57 -0500
I have also had problems with configure's transform argument being
ignored for the pdmp file, and with the pdmp file not being found.

Here is a simple-minded proof-of-concept patch for installing the pdmp
file with the fingerprint in the name. It needs cleaning up (compilation
warnings; hexbuf stuff is awful; should look for FINGERPRINT.pdmp first,
then fall back to less specific names, finishing with emacs.pdmp; etc).
Hopefully people who know more about this stuff than me will feel like
finishing this off...

diff --git a/Makefile.in b/Makefile.in
index fbb1891ba7..d1c228c5f3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -309,6 +309,7 @@ TRANSFORM = @program_transform_name@
 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
 EMACS = ${EMACS_NAME}${EXEEXT}
 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
+EMACS_PDMP = `./src/emacs${EXEEXT} --fingerprint 2>&1 | sed 's/.* //'`.pdmp
 
 # Subdirectories to make recursively.
 SUBDIR = $(NTDIR) lib lib-src src lisp
@@ -495,7 +496,7 @@ install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
 ifeq (${ns_self_contained},no)
 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifeq (${DUMPING},pdumper)
-	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
+	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/${EMACS_PDMP}
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
diff --git a/src/emacs.c b/src/emacs.c
index 172e460769..1743e1cc99 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -117,6 +117,7 @@ extern char etext;
 #endif
 
 #include "pdumper.h"
+#include "fingerprint.h"
 #include "epaths.h"
 
 static const char emacs_version[] = PACKAGE_VERSION;
@@ -238,6 +239,7 @@ Initialization options:\n\
 #ifdef HAVE_PDUMPER
     "\
 --dump-file FILE            read dumped state from FILE\n\
+--fingerprint               output fingerprint and exit\n\
 ",
 #endif
     "\
@@ -868,9 +870,15 @@ load_pdump (int argc, char **argv)
      "emacs.pdmp" so that the Emacs binary still works if the user
      copies and renames it.  */
   const char *argv0_base = "emacs";
+  enum { hexbuf_size = 2 * sizeof fingerprint };
+  char hexbuf[hexbuf_size];
+  hexbuf_digest (hexbuf, fingerprint, sizeof fingerprint);
+  char finger[hexbuf_size];
+  strcpy (finger, hexbuf);
+  finger[sizeof hexbuf] = '\0';
   ptrdiff_t needed = (strlen (path_exec)
                       + 1
-                      + strlen (argv0_base)
+                      + strlen (finger)
                       + strlen (suffix)
                       + 1);
   if (bufsize < needed)
@@ -879,7 +887,7 @@ load_pdump (int argc, char **argv)
       dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
     }
   sprintf (dump_file, "%s%c%s%s",
-           path_exec, DIRECTORY_SEP, argv0_base, suffix);
+           path_exec, DIRECTORY_SEP, finger, suffix);
   result = pdumper_load (dump_file);
 
   if (result == PDUMPER_LOAD_FILE_NOT_FOUND)
@@ -1129,6 +1137,22 @@ main (int argc, char **argv)
       exit (0);
     }
 
+#ifdef HAVE_PDUMPER
+  if (argmatch (argv, argc, "-fingerprint", "--fingerprint", 4, NULL, &skip_args))
+    {
+      if (initialized)
+        {
+          dump_fingerprint ("fingerprint", fingerprint);
+          exit (0);
+        }
+      else
+        {
+          fputs ("Not initialized\n", stderr);
+          exit (1);
+        }
+    }
+#endif
+
   emacs_wd = emacs_get_current_dir_name ();
 #ifdef HAVE_PDUMPER
   if (dumped_with_pdumper_p ())
diff --git a/src/pdumper.c b/src/pdumper.c
index b5b4050b93..c8d7378221 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -311,7 +311,7 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset)
     error ("dump relocation out of range");
 }
 
-static void
+void
 dump_fingerprint (char const *label,
 		  unsigned char const xfingerprint[sizeof fingerprint])
 {
diff --git a/src/pdumper.h b/src/pdumper.h
index c793fb4058..2028b44f81 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -50,6 +50,10 @@ enum { PDUMPER_NO_OBJECT = -1 };
 #define PDUMPER_REMEMBER_SCALAR(thing)                  \
   pdumper_remember_scalar (&(thing), sizeof (thing))
 
+extern void dump_fingerprint (const char *label,
+                              const unsigned char *xfingerprint);
+
+
 extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes);
 
 INLINE void




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Fri, 20 Nov 2020 15:08:02 GMT) Full text and rfc822 format available.

Message #46 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>
Cc: schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Fri, 20 Nov 2020 17:07:11 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: schwab <at> linux-m68k.org,  42790 <at> debbugs.gnu.org,  eliz <at> gnu.org
> Date: Sun, 15 Nov 2020 20:03:57 -0500
> 
> I have also had problems with configure's transform argument being
> ignored for the pdmp file, and with the pdmp file not being found.
> 
> Here is a simple-minded proof-of-concept patch for installing the pdmp
> file with the fingerprint in the name. It needs cleaning up (compilation
> warnings; hexbuf stuff is awful; should look for FINGERPRINT.pdmp first,
> then fall back to less specific names, finishing with emacs.pdmp; etc).
> Hopefully people who know more about this stuff than me will feel like
> finishing this off...

I hope this gets cleaned up, because I think it would be good to have
this fixed for Emacs 27.2.

Volunteers are welcome.

TIA




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 27 Feb 2021 01:41:02 GMT) Full text and rfc822 format available.

Message #49 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Daniel Colascione <dancol <at> dancol.org>, schwab <at> linux-m68k.org,
 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Fri, 26 Feb 2021 20:40:22 -0500
Eli Zaretskii wrote:

> I hope this gets cleaned up, because I think it would be good to have
> this fixed for Emacs 27.2.

No response; presumably it's now too late.
(FWIW I think it would be straightforward for someone whose C isn't
execrable like mine.)

I really think having some central list of "issues that should be fixed
before the next release" would help with this kind of thing.

The debbugs blocking mechanism has been used for this previously.
If you don't like it that's fine, please use whatever you prefer.
Eg monthly summary postings to emacs-devel, anything.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 27 Feb 2021 07:23:02 GMT) Full text and rfc822 format available.

Message #52 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: dancol <at> dancol.org, schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org,
 lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sat, 27 Feb 2021 09:22:37 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Daniel Colascione <dancol <at> dancol.org>,  42790 <at> debbugs.gnu.org,  schwab <at> linux-m68k.org,  lin.sun <at> zoom.us
> Date: Fri, 26 Feb 2021 20:40:22 -0500
> 
> Eli Zaretskii wrote:
> 
> > I hope this gets cleaned up, because I think it would be good to have
> > this fixed for Emacs 27.2.
> 
> No response; presumably it's now too late.

Yes, pretty much.

> (FWIW I think it would be straightforward for someone whose C isn't
> execrable like mine.)
> 
> I really think having some central list of "issues that should be fixed
> before the next release" would help with this kind of thing.
> 
> The debbugs blocking mechanism has been used for this previously.
> If you don't like it that's fine, please use whatever you prefer.
> Eg monthly summary postings to emacs-devel, anything.

It's okay to use debbugs blocking, but the problem is, we have no real
mechanism to make sure the blocking problems will be worked on, and
the fact that some aren't is an indirect evidence that those problems
aren't acute.  So delaying a release indefinitely due to such problems
doesn't sound wise to me: we are already accused of having too long
release cycles.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 27 Feb 2021 16:06:01 GMT) Full text and rfc822 format available.

Message #55 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Colascione <dancol <at> dancol.org>
To: Eli Zaretskii <eliz <at> gnu.org>, Glenn Morris <rgm <at> gnu.org>
Cc: schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Sat, 27 Feb 2021 11:05:16 -0500
On 2/27/21 2:22 AM, Eli Zaretskii wrote:
>> From: Glenn Morris <rgm <at> gnu.org>
>> Cc: Daniel Colascione <dancol <at> dancol.org>,  42790 <at> debbugs.gnu.org,  schwab <at> linux-m68k.org,  lin.sun <at> zoom.us
>> Date: Fri, 26 Feb 2021 20:40:22 -0500
>>
>> Eli Zaretskii wrote:
>>
>>> I hope this gets cleaned up, because I think it would be good to have
>>> this fixed for Emacs 27.2.
>> No response; presumably it's now too late.
> Yes, pretty much.


Maybe for next release: look through *all* *.pdmp files in well-known 
directories and just use the first one with the correct fingerprint? 
Then the files can have whatever name you want.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 27 Feb 2021 18:23:01 GMT) Full text and rfc822 format available.

Message #58 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dancol <at> dancol.org, schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org,
 lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sat, 27 Feb 2021 13:21:54 -0500
Eli Zaretskii wrote:

> So delaying a release indefinitely due to such problems doesn't sound
> wise to me: we are already accused of having too long release cycles.

You control when a release is made. A flag in the bug database can't
prevent you from making a release. But if you don't have any mechanism
for communicating to people what you think the important issues are,
they are likely to get lost in the noise (certain individuals can report
a dozen trivial bugs a day). Personally I have no idea what issues
remain to be fixed before 27.2 can be released.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Sat, 27 Feb 2021 18:51:02 GMT) Full text and rfc822 format available.

Message #61 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: dancol <at> dancol.org, schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org,
 lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Sat, 27 Feb 2021 20:49:48 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: dancol <at> dancol.org,  42790 <at> debbugs.gnu.org,  schwab <at> linux-m68k.org,  lin.sun <at> zoom.us
> Date: Sat, 27 Feb 2021 13:21:54 -0500
> 
> Eli Zaretskii wrote:
> 
> > So delaying a release indefinitely due to such problems doesn't sound
> > wise to me: we are already accused of having too long release cycles.
> 
> You control when a release is made. A flag in the bug database can't
> prevent you from making a release. But if you don't have any mechanism
> for communicating to people what you think the important issues are,
> they are likely to get lost in the noise (certain individuals can report
> a dozen trivial bugs a day).

I think I do have a mechanism for communicating that: the 2 mailing
lists we use, and the bug tracker.  What better mechanism can you
propose that will make sure the messages don't drown in the noise?
You proposed announcing on emacs-devel, but with the level of noise
present there lately, I'm not sure _I_ don't lose important messages
there; I have no reason to believe posting there will get the
attention of the unknown parties who ignored this particular bug since
it was reported.

> Personally I have no idea what issues remain to be fixed before 27.2
> can be released.

None.  We are all set.  The next tarball will be a RC.




Added tag(s) help. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 04 Mar 2021 19:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Wed, 21 Jul 2021 13:52:02 GMT) Full text and rfc822 format available.

Message #66 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Glenn Morris <rgm <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>,
 schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Wed, 21 Jul 2021 15:51:18 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

> I hope this gets cleaned up, because I think it would be good to have
> this fixed for Emacs 27.2.

I've reworked Glenn's patch for Emacs 28...  but this is only for
installed Emacsen?  (And his comments about it needing more work is
still true.)

So that bit of the patch isn't directly relevant for the subject of this
bug report, but I guess the addition of the "--fingerprint" bit is?  (So
that we can write to emacs-FINGERPRINT.pdmp before moving to the
numbered version?)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no
[hex.patch (text/x-diff, inline)]
diff --git a/Makefile.in b/Makefile.in
index 97d954b6ce..edca0e7cf3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -307,6 +307,7 @@ TRANSFORM =
 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
 EMACS = ${EMACS_NAME}${EXEEXT}
 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
+EMACS_PDMP = `./src/emacs${EXEEXT} --fingerprint 2>&1 | sed 's/.* //'`.pdmp
 
 # Subdirectories to make recursively.
 SUBDIR = $(NTDIR) lib lib-src src lisp
@@ -515,7 +516,7 @@ install-arch-dep:
 ifeq (${ns_self_contained},no)
 	${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifeq (${DUMPING},pdumper)
-	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
+	${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/${EMACS_PDMP}
 endif
 	-chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
 ifndef NO_BIN_LINK
diff --git a/src/emacs.c b/src/emacs.c
index 866e43fda9..2f971880cc 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -133,6 +133,7 @@ #define MAIN_PROGRAM
 #endif
 
 #include "pdumper.h"
+#include "fingerprint.h"
 #include "epaths.h"
 
 static const char emacs_version[] = PACKAGE_VERSION;
@@ -255,6 +256,7 @@ #define MAIN_PROGRAM
 #ifdef HAVE_PDUMPER
     "\
 --dump-file FILE            read dumped state from FILE\n\
+--fingerprint               output fingerprint and exit\n\
 ",
 #endif
 #if SECCOMP_USABLE
@@ -830,6 +832,8 @@ load_pdump (int argc, char **argv)
   const char *const suffix = ".pdmp";
   int result;
   char *emacs_executable = argv[0];
+  ptrdiff_t hexbuf_size;
+  char *hexbuf;
   const char *strip_suffix =
 #if defined DOS_NT || defined CYGWIN
     ".exe"
@@ -927,9 +931,13 @@ load_pdump (int argc, char **argv)
   /* Look for "emacs.pdmp" in PATH_EXEC.  We hardcode "emacs" in
      "emacs.pdmp" so that the Emacs binary still works if the user
      copies and renames it.  */
+  hexbuf_size = 2 * sizeof fingerprint + 1;
+  hexbuf = xmalloc (hexbuf_size);
+  hexbuf_digest (hexbuf, (char *)fingerprint, sizeof fingerprint);
+  hexbuf[sizeof hexbuf] = '\0';
   needed = (strlen (path_exec)
 	    + 1
-	    + strlen (argv0_base)
+	    + strlen (hexbuf)
 	    + strlen (suffix)
 	    + 1);
   if (bufsize < needed)
@@ -938,7 +946,7 @@ load_pdump (int argc, char **argv)
       dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1);
     }
   sprintf (dump_file, "%s%c%s%s",
-           path_exec, DIRECTORY_SEP, argv0_base, suffix);
+           path_exec, DIRECTORY_SEP, hexbuf, suffix);
 #if !defined (NS_SELF_CONTAINED)
   /* Assume the Emacs binary lives in a sibling directory as set up by
      the default installation configuration.  */
@@ -1387,6 +1395,23 @@ main (int argc, char **argv)
       exit (0);
     }
 
+#ifdef HAVE_PDUMPER
+  if (argmatch (argv, argc, "-fingerprint", "--fingerprint", 4,
+		NULL, &skip_args))
+    {
+      if (initialized)
+        {
+          dump_fingerprint ("fingerprint", (unsigned char *)fingerprint);
+          exit (0);
+        }
+      else
+        {
+          fputs ("Not initialized\n", stderr);
+          exit (1);
+        }
+    }
+#endif
+
   emacs_wd = emacs_get_current_dir_name ();
 #ifdef HAVE_PDUMPER
   if (dumped_with_pdumper_p ())
diff --git a/src/pdumper.c b/src/pdumper.c
index 7730ea3d06..0a97849047 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -312,7 +312,7 @@ dump_reloc_set_offset (struct dump_reloc *reloc, dump_off offset)
     error ("dump relocation out of range");
 }
 
-static void
+void
 dump_fingerprint (char const *label,
 		  unsigned char const xfingerprint[sizeof fingerprint])
 {
diff --git a/src/pdumper.h b/src/pdumper.h
index deec9af046..bc339c42da 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -50,6 +50,9 @@ #define PDUMPER_IGNORE(thing) ((void) &(thing))
 #define PDUMPER_REMEMBER_SCALAR(thing)                  \
   pdumper_remember_scalar (&(thing), sizeof (thing))
 
+extern void dump_fingerprint (const char *label,
+                              const unsigned char *xfingerprint);
+
 extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes);
 
 INLINE void

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Thu, 30 Sep 2021 01:34:01 GMT) Full text and rfc822 format available.

Message #69 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>,
 schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1;
 Add version info into file name "emacs.pdmp" to avoid mismatch pdmp
 file
Date: Wed, 29 Sep 2021 21:33:27 -0400
Lars Ingebrigtsen wrote:

> So that bit of the patch isn't directly relevant for the subject of this
> bug report, but I guess the addition of the "--fingerprint" bit is?  (So
> that we can write to emacs-FINGERPRINT.pdmp before moving to the
> numbered version?)

This bug report is about "emacs.pdmp" is not being a specific enough
name. The OP suggests adding program suffix (etc; "version info")
information into the name of the pdmp file. My suggestion is that a
better solution is to use the dump fingerprint in the name instead
(I think this has been suggested several times.)
So the patch directly addresses the problem in the original report.
I think it just needs some C polishing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Thu, 30 Sep 2021 06:48:02 GMT) Full text and rfc822 format available.

Message #72 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>,
 schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Thu, 30 Sep 2021 08:47:43 +0200
Glenn Morris <rgm <at> gnu.org> writes:

> This bug report is about "emacs.pdmp" is not being a specific enough
> name. The OP suggests adding program suffix (etc; "version info")
> information into the name of the pdmp file. My suggestion is that a
> better solution is to use the dump fingerprint in the name instead
> (I think this has been suggested several times.)

Yes, I think everybody agrees with that.

> So the patch directly addresses the problem in the original report.
> I think it just needs some C polishing.

Right.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42790; Package emacs. (Mon, 11 Oct 2021 12:05:02 GMT) Full text and rfc822 format available.

Message #75 received at 42790 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Daniel Colascione <dancol <at> dancol.org>,
 schwab <at> linux-m68k.org, 42790 <at> debbugs.gnu.org, lin.sun <at> zoom.us
Subject: Re: bug#42790: [PATH] 27.1; Add version info into file name
 "emacs.pdmp" to avoid mismatch pdmp file
Date: Mon, 11 Oct 2021 14:04:36 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> So the patch directly addresses the problem in the original report.
>> I think it just needs some C polishing.
>
> Right.

I've now tested the patch (after a "make install"), and after a minor
tweak, it seems to work fine.  So I've now installed it on the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 42790 <at> debbugs.gnu.org and <lin.sun <at> zoom.us> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 11 Oct 2021 12:05:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Nov 2021 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years ago.

Previous Next


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