unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16717: Dumping: Can't update subspace record
@ 2014-02-10 18:33         ` Paul Eggert
  2014-02-14  7:51           ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Eggert @ 2014-02-10 18:33 UTC (permalink / raw)
  To: 16717; +Cc: Klaus.Zeitler

In http://lists.gnu.org/archive/html/emacs-devel/2014-02/msg00192.html 
Klaus Zeitler wrote:
> I'm trying to build emacs 24.3 under HP-UX
> (HP-UX keana B.10.20 U 9000/800 894327431 unlimited-user license),
> but dumping fails with:
>
> Dumping under the name emacs
> Can't update subspace record: File too large
>
>
> So what is that supposed to tell me?

I'm taking the liberty of mailing this to bug-gnu-emacs@gnu.org, which 
is a better place to file Emacs bug reports.  I'll follow up there.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
       [not found] <q5glhxj886p.fsf@destgd0h411156.de.alcatel-lucent.com>
@ 2014-02-10 18:40 ` Paul Eggert
  2014-02-13 14:39   ` Klaus Zeitler
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Eggert @ 2014-02-10 18:40 UTC (permalink / raw)
  To: Klaus.Zeitler, 16717

[-- Attachment #1: Type: text/plain, Size: 114 bytes --]

Could you please try the attached patch?  I can't easily test under 
HP-UX, so you may have to tweak it.  Thanks.

[-- Attachment #2: hp.diff --]
[-- Type: text/x-patch, Size: 5674 bytes --]

diff -pru emacs-24.3/src/unexhp9k800.c emacs-24.3-hp/src/unexhp9k800.c
--- emacs-24.3/src/unexhp9k800.c	2012-04-13 18:33:59.000000000 -0700
+++ emacs-24.3-hp/src/unexhp9k800.c	2014-02-10 10:26:09.323174656 -0800
@@ -73,6 +73,22 @@ run_time_remap (char *ignored)
 #define roundup(x,n) (((x) + ((n) - 1)) & ~((n) - 1))  /* n is power of 2 */
 #define min(x,y)  (((x) < (y)) ? (x) : (y))
 
+/* Report a fatal error and exit.  */
+static _Noreturn void
+unexec_error (char const *msg)
+{
+  perror (msg);
+  exit (1);
+}
+
+/* Do an lseek and check the result.  */
+static void
+check_lseek (int fd, off_t offset, int whence)
+{
+  if (lseek (fd, offset, whence) < 0)
+    unexec_error ("Cannot lseek");
+}
+
 /* Save current data space in the file, update header.  */
 
 static void
@@ -81,7 +97,7 @@ save_data_space (int file, struct header
 {
   /* Write the entire data space out to the file */
   if (write (file, auxhdr->exec_dmem, size) != size)
-    { perror ("Can't save new data space"); exit (1); }
+    unexec_error ("Can't save new data space");
 
   /* Update the header to reflect the new data size */
   auxhdr->exec_dsize = size;
@@ -114,20 +130,21 @@ update_file_ptrs (int file, struct heade
   update (auxhdr->exec_dfile);
 
   /* Do for each subspace dictionary entry */
-  lseek (file, hdr->subspace_location, 0);
+  check_lseek (file, hdr->subspace_location, 0);
   for (i = 0; i < hdr->subspace_total; i++)
     {
-      if (read (file, &subspace, sizeof (subspace)) != sizeof (subspace))
-	{ perror ("Can't read subspace record"); exit (1); }
+      ptrdiff_t subspace_size = sizeof subspace;
+      if (read (file, &subspace, subspace_size) != subspace_size)
+	unexec_error ("Can't read subspace record");
 
       /* If subspace has a file location, update it */
       if (subspace.initialization_length > 0
 	  && subspace.file_loc_init_value > location)
 	{
 	  subspace.file_loc_init_value += offset;
-	  lseek (file, -sizeof (subspace), 1);
-	  if (write (file, &subspace, sizeof (subspace)) != sizeof (subspace))
-	    { perror ("Can't update subspace record"); exit (1); }
+	  check_lseek (file, -subspace_size, 1);
+	  if (write (file, &subspace, subspace_size) != subspace_size)
+	    unexec_error ("Can't update subspace record");
 	}
     }
 
@@ -143,9 +160,9 @@ read_header (int file, struct header *hd
 {
 
   /* Read the header in */
-  lseek (file, 0, 0);
+  check_lseek (file, 0, 0);
   if (read (file, hdr, sizeof (*hdr)) != sizeof (*hdr))
-    { perror ("Couldn't read header from a.out file"); exit (1); }
+    unexec_error ("Couldn't read header from a.out file");
 
   if (hdr->a_magic != EXEC_MAGIC && hdr->a_magic != SHARE_MAGIC
       &&  hdr->a_magic != DEMAND_MAGIC)
@@ -154,12 +171,9 @@ read_header (int file, struct header *hd
       exit (1);
     }
 
-  lseek (file, hdr->aux_header_location, 0);
+  check_lseek (file, hdr->aux_header_location, 0);
   if (read (file, auxhdr, sizeof (*auxhdr)) != sizeof (*auxhdr))
-    {
-      perror ("Couldn't read auxiliary header from a.out file");
-      exit (1);
-    }
+    unexec_error ("Couldn't read auxiliary header from a.out file");
 }
 
 /* Write out the header records into an a.out file.  */
@@ -171,12 +185,12 @@ write_header (int file, struct header *h
   hdr->checksum = calculate_checksum (hdr);
 
   /* Write the header back into the a.out file */
-  lseek (file, 0, 0);
+  check_lseek (file, 0, 0);
   if (write (file, hdr, sizeof (*hdr)) != sizeof (*hdr))
-    { perror ("Couldn't write header to a.out file"); exit (1); }
-  lseek (file, hdr->aux_header_location, 0);
+    unexec_error ("Couldn't write header to a.out file");
+  check_lseek (file, hdr->aux_header_location, 0);
   if (write (file, auxhdr, sizeof (*auxhdr)) != sizeof (*auxhdr))
-    { perror ("Couldn't write auxiliary header to a.out file"); exit (1); }
+    unexec_error ("Couldn't write auxiliary header to a.out file");
 }
 
 /* Calculate the checksum of a SOM header record. */
@@ -206,9 +220,9 @@ copy_file (int old, int new, int size)
     {
       len = min (size, sizeof (buffer));
       if (read (old, buffer, len) != len)
-	{ perror ("Read failure on a.out file"); exit (1); }
+	unexec_error ("Read failure on a.out file");
       if (write (new, buffer, len) != len)
-	{ perror ("Write failure in a.out file"); exit (1); }
+	unexec_error ("Write failure in a.out file");
     }
 }
 
@@ -225,7 +239,7 @@ copy_rest (int old, int new)
     if (write (new, buffer, len) != len) break;
 
   if (len != 0)
-    { perror ("Unable to copy the rest of the file"); exit (1); }
+    unexec_error ("Unable to copy the rest of the file");
 }
 
 #ifdef	DEBUG
@@ -270,10 +284,10 @@ unexec (const char *new_name,      /* na
   /* Open the input and output a.out files */
   old = open (old_name, O_RDONLY);
   if (old < 0)
-    { perror (old_name); exit (1); }
+    unexec_error (old_name);
   new = open (new_name, O_CREAT|O_RDWR|O_TRUNC, 0777);
   if (new < 0)
-    { perror (new_name); exit (1); }
+    unexec_error (new_name);
 
   /* Read the old headers */
   read_header (old, &hdr, &auxhdr);
@@ -288,11 +302,11 @@ unexec (const char *new_name,      /* na
   new_size = i - auxhdr.exec_dmem;
 
   /* Copy the old file to the new, up to the data space */
-  lseek (old, 0, 0);
+  check_lseek (old, 0, 0);
   copy_file (old, new, auxhdr.exec_dfile);
 
   /* Skip the old data segment and write a new one */
-  lseek (old, old_size, 1);
+  check_lseek (old, old_size, 1);
   save_data_space (new, &hdr, &auxhdr, new_size);
 
   /* Copy the rest of the file */
Only in emacs-24.3-hp/src: unexhp9k800.c~
Only in emacs-24.3-hp/src: unexhp9k800.c.orig
Only in emacs-24.3-hp/src: unexhp9k800.c.rej

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-10 18:40 ` bug#16717: Dumping: Can't update subspace record Paul Eggert
@ 2014-02-13 14:39   ` Klaus Zeitler
  2014-02-13 19:43     ` Paul Eggert
  0 siblings, 1 reply; 13+ messages in thread
From: Klaus Zeitler @ 2014-02-13 14:39 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 16717

Hello Paul,

many thanks for the quick help. This was really fast. I'm impressed.

>>>>> "Paul" == Paul Eggert <eggert@cs.ucla.edu> writes:
    Paul> 
    Paul> Could you please try the attached patch? I can't easily test
    Paul> under HP-UX, so you may have to tweak it. Thanks.

yes, that worked perfectly. The build continued now up to the
part where all the .el files get compressed and then it stopped with:

--- snip ---

	[ -z "/opt/exp/bin/gzip" ] || \
	  ( echo "Compressing *.el ..." ; \
	    unset CDPATH; \
	    thisdir=`/bin/pwd`; \
	    for dir in /opt/exp/expmake/build/gnuemacs2src/ins/share/lib/gnuemacs2/share/emacs/24.3/lisp /opt/exp/expmake/build/gnuemacs2src/ins/share/lib/gnuemacs2/share/emacs/24.3/leim; do \
	      cd ${thisdir} ; \
	      cd ${dir} || exit 1 ; \
	      for f in `find . -name "*.elc" -print`; do \
	        /opt/exp/bin/gzip -9n `echo $f|sed 's/.elc$/.el/'` ; \
	      done ; \
	    done )
Compressing *.el ...
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.

--- snip ---


This looked like a Make problem to me and when I replaced the official
HP make with GNU make everything worked beautifully.


So it seems you already made a bug report. Is there anything I need to
do additionally?


BR

Klaus

-- 
 -------------------------------------------------------------------
|  Klaus Zeitler              Alcatel-Lucent                        |
|  Lorenzstrasse 10           D-70435 Stuttgart, Germany            |
|  Department:                MS/E Building: 004  Office: 1/62      |
|  Telefon:                   +49 711 821 43898                     |
|  Email:                     klaus.zeitler@alcatel-lucent.com      |
|                                                                   |
| Alcatel-Lucent Deutschland AG                                     |
| Sitz der Gesellschaft: Stuttgart · Amtsgericht Stuttgart HRB 4026 |
| Vorsitzender des Aufsichtsrates: Michael Oppenhoff                |
| Vorstand: Wilhelm Dresselhaus (Chairman) · Hans-Jörg Daub ·       |
|           Andreas Gehe                                            |
 -------------------------------------------------------------------
---
Good judgement comes from experience and
experience comes from bad judgement!





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 14:39   ` Klaus Zeitler
@ 2014-02-13 19:43     ` Paul Eggert
  2014-02-13 19:54       ` Glenn Morris
                         ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Paul Eggert @ 2014-02-13 19:43 UTC (permalink / raw)
  To: Klaus.Zeitler; +Cc: 16717

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

On 02/13/2014 06:39 AM, Klaus Zeitler wrote:
> This looked like a Make problem to me and when I replaced the official 
> HP make with GNU make everything worked beautifully.

That's good, but it'd be better if the makefile worked with HP make as 
well.  That part of the makefile has evolved since 24.3, but I expect 
that part of the problem is that it's just too complicated, so I 
simplified it in the hopes of getting things to work.  Could you please 
try the attached patch with HP make?  Thanks.


[-- Attachment #2: hp1.diff --]
[-- Type: text/x-patch, Size: 1175 bytes --]

Only in emacs-24.3-hp/: ChangeLog.orig
Only in emacs-24.3-hp/: ChangeLog.rej
diff -pru emacs-24.3/Makefile.in emacs-24.3-hp/Makefile.in
--- emacs-24.3/Makefile.in	2013-03-04 19:42:28.000000000 -0800
+++ emacs-24.3-hp/Makefile.in	2014-02-13 11:41:21.935087020 -0800
@@ -556,17 +556,11 @@ install-arch-indep: lisp leim install-in
 	  ${write_subdir}
 	subdir=$(DESTDIR)${datadir}/emacs/site-lisp ; \
 	  ${write_subdir} || true
-	[ -z "${GZIP_PROG}" ] || \
-	  ( echo "Compressing *.el ..." ; \
-	    unset CDPATH; \
-	    thisdir=`/bin/pwd`; \
-	    for dir in $(DESTDIR)${lispdir} $(DESTDIR)${leimdir}; do \
-	      cd $${thisdir} ; \
-	      cd $${dir} || exit 1 ; \
-	      for f in `find . -name "*.elc" -print`; do \
-	        ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
-	      done ; \
-	    done )
+	[ -z "${GZIP_PROG}" ] || { \
+	  echo "Compressing *.el ..." && \
+	  find "$(DESTDIR)${lispdir}" "$(DESTDIR)${leimdir}" -name '*.elc' -exec sh -c \
+	    '${GZIP_PROG} -9n `expr "$$@" : "\\(.*\\)c"`' dummy '{}' ';'; \
+	}
 	-chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} ${COPYDESTS}
 
 ## The above chmods are needed because "umask 022; tar ..." is not

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:43     ` Paul Eggert
@ 2014-02-13 19:54       ` Glenn Morris
  2014-02-13 19:56         ` Glenn Morris
  2014-02-14  1:45       ` Stefan Monnier
  2014-02-14 14:42       ` Klaus Zeitler
  2 siblings, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2014-02-13 19:54 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Klaus.Zeitler, 16717

Paul Eggert wrote:

> please try the attached patch with HP make?

Fails when the installation directory contains spaces.
(with GNU make)





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:54       ` Glenn Morris
@ 2014-02-13 19:56         ` Glenn Morris
  2014-02-13 20:32           ` Eli Zaretskii
  2014-02-14  8:31           ` Paul Eggert
  0 siblings, 2 replies; 13+ messages in thread
From: Glenn Morris @ 2014-02-13 19:56 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Klaus.Zeitler, 16717

Glenn Morris wrote:

> Fails when the installation directory contains spaces.

Also I imagine we will hear that "expr" does not exist on MS Windows...

I think it would be better to first figure out exactly what HP make did
not like in the original version.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:56         ` Glenn Morris
@ 2014-02-13 20:32           ` Eli Zaretskii
  2014-02-14  8:31           ` Paul Eggert
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2014-02-13 20:32 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Klaus.Zeitler, eggert, 16717

> From: Glenn Morris <rgm@gnu.org>
> Date: Thu, 13 Feb 2014 14:56:47 -0500
> Cc: Klaus.Zeitler@alcatel-lucent.com, 16717@debbugs.gnu.org
> 
> Also I imagine we will hear that "expr" does not exist on MS Windows...

You won't:

  $ type expr
  expr is /bin/expr





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:43     ` Paul Eggert
  2014-02-13 19:54       ` Glenn Morris
@ 2014-02-14  1:45       ` Stefan Monnier
  2014-02-10 18:33         ` Paul Eggert
  2014-02-14 14:42       ` Klaus Zeitler
  2 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2014-02-14  1:45 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Klaus.Zeitler, 16717

> That's good, but it'd be better if the makefile worked with HP make as well.

I'm not sure it would really be better.


        Stefan "who'd rather require GNU Make"





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-10 18:33         ` Paul Eggert
@ 2014-02-14  7:51           ` Glenn Morris
  2014-02-14 17:31             ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2014-02-14  7:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Klaus.Zeitler, Paul Eggert, 16717

Stefan Monnier wrote:

>         Stefan "who'd rather require GNU Make"

You would? Really and truly? For some reason I thought you were against that.

Because I totally agree; and I think we should do that post 24.4.
It will make Makefile life much easier.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:56         ` Glenn Morris
  2014-02-13 20:32           ` Eli Zaretskii
@ 2014-02-14  8:31           ` Paul Eggert
  1 sibling, 0 replies; 13+ messages in thread
From: Paul Eggert @ 2014-02-14  8:31 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Klaus.Zeitler, 16717

Glenn Morris wrote:
> Because I totally agree [with requiring GNU make]

I'd also prefer requiring GNU make after the freeze is over.  GCC has 
required this since GCC 3.4 (April 2004), and it seems to perk along 
quite nicely.  GCC requires GNU make 3.80 (October 2002) or later; these 
days I think it'd be OK for Emacs to bump that to GNU make 3.81 (April 
2006) or later.

> I think it would be better to first figure out exactly what HP make did
> not like in the original version.

Trying to nail down exactly what an old proprietary 'make' dislikes is 
often more trouble than it's worth.  I've had experiences with them not 
liking command lines of exactly 1023 bytes, that sort of thing.

> Fails when the installation directory contains spaces.

Sorry about that; fixed in trunk bzr 16717.  There are other reasons 
installation fails when the destination directory name contains spaces, 
at least for me; I'll try to look into that.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-13 19:43     ` Paul Eggert
  2014-02-13 19:54       ` Glenn Morris
  2014-02-14  1:45       ` Stefan Monnier
@ 2014-02-14 14:42       ` Klaus Zeitler
  2014-02-14 15:49         ` Paul Eggert
  2 siblings, 1 reply; 13+ messages in thread
From: Klaus Zeitler @ 2014-02-14 14:42 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 16717

>>>>> "Paul" == Paul Eggert <eggert@cs.ucla.edu> writes:
    Paul> 
    Paul> On 02/13/2014 06:39 AM, Klaus Zeitler wrote:
    >> This looked like a Make problem to me and when I replaced the official HP
    >> make with GNU make everything worked beautifully.
    Paul> 
    Paul> That's good, but it'd be better if the makefile worked with HP
    Paul> make as well. That part of the makefile has evolved since
    Paul> 24.3, but I expect that part of the problem is that it's just
    Paul> too complicated, so I simplified it in the hopes of getting
    Paul> things to work. Could you please try the attached patch with
    Paul> HP make?

Yes, with this patch it also works with HP make.

I don't care much for HP make anyway and I only ran into this problem
cause we have to use a little build and install script for any additional SW.
I normally always use the GNU versions and for good reason as one can see.

I wonder if it's worth to investigate the HP make problem. I made a few
feeble attempts to see if I can figure out the problem, but no luck so far.

-- 
 -------------------------------------------------------------------
|  Klaus Zeitler              Alcatel-Lucent                        |
|  Lorenzstrasse 10           D-70435 Stuttgart, Germany            |
|  Department:                MS/E Building: 004  Office: 1/62      |
|  Telefon:                   +49 711 821 43898                     |
|  Email:                     klaus.zeitler@alcatel-lucent.com      |
|                                                                   |
| Alcatel-Lucent Deutschland AG                                     |
| Sitz der Gesellschaft: Stuttgart · Amtsgericht Stuttgart HRB 4026 |
| Vorsitzender des Aufsichtsrates: Michael Oppenhoff                |
| Vorstand: Wilhelm Dresselhaus (Chairman) · Hans-Jörg Daub ·       |
|           Andreas Gehe                                            |
 -------------------------------------------------------------------
---
A budget is just a method of worrying before
you spend money, as well as afterward.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-14 14:42       ` Klaus Zeitler
@ 2014-02-14 15:49         ` Paul Eggert
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Eggert @ 2014-02-14 15:49 UTC (permalink / raw)
  To: Klaus.Zeitler; +Cc: 16717

Klaus Zeitler wrote:
> I wonder if it's worth to investigate the HP make problem.

I wouldn't bother, since that problem should be fixed in the Emacs trunk 
now.  Thanks.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#16717: Dumping: Can't update subspace record
  2014-02-14  7:51           ` Glenn Morris
@ 2014-02-14 17:31             ` Stefan Monnier
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2014-02-14 17:31 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Klaus.Zeitler, Paul Eggert, 16717

>> Stefan "who'd rather require GNU Make"
> You would? Really and truly? For some reason I thought you were against that.

AFAIK GNU Make is available everywhere where Emacs can be built.
So while requiring GNU Make might occasionally be a hindrance because
the user has to first install GNU Make, it would not prevent
building Emacs.

For that reason, I'm not opposed to it.

> Because I totally agree; and I think we should do that post 24.4.
> It will make Makefile life much easier.

Let's move this to emacs-devel to see if someone has a good reason to
oppose it.


        Stefan





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-02-14 17:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <q5glhxj886p.fsf@destgd0h411156.de.alcatel-lucent.com>
2014-02-10 18:40 ` bug#16717: Dumping: Can't update subspace record Paul Eggert
2014-02-13 14:39   ` Klaus Zeitler
2014-02-13 19:43     ` Paul Eggert
2014-02-13 19:54       ` Glenn Morris
2014-02-13 19:56         ` Glenn Morris
2014-02-13 20:32           ` Eli Zaretskii
2014-02-14  8:31           ` Paul Eggert
2014-02-14  1:45       ` Stefan Monnier
2014-02-10 18:33         ` Paul Eggert
2014-02-14  7:51           ` Glenn Morris
2014-02-14 17:31             ` Stefan Monnier
2014-02-14 14:42       ` Klaus Zeitler
2014-02-14 15:49         ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).