GNU bug report logs - #28882
[bug-gnu-emacs] emacs-26.0.90 build feedback

Previous Next

Package: emacs;

Reported by: "Nelson H. F. Beebe" <beebe <at> math.utah.edu>

Date: Tue, 17 Oct 2017 23:32:01 UTC

Severity: minor

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Nelson H. F. Beebe" <beebe <at> math.utah.edu>
To: 28882 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> users.sourceforge.net>, Andreas Schwab <schwab <at> suse.de>
Cc: beebe <at> math.utah.edu
Subject: bug#28882: [bug-gnu-emacs] emacs-26.0.90 build feedback
Date: Wed, 18 Oct 2017 11:58:11 -0600
Andreas Schwab asks about my build attempts for emacs-26.0.90 on
HardenedBSD:

>> Does it help to add -no-pie to LDFLAGS?

For HardenedBSD 11.1-STABLE-HBSD (FreeBSD 11.1-STABLE-HBSD #0), that
worked:

	rm src/emacs src/temacs
	gmake LDFLAGS=-no-pie

I installed that version.

I then tried the same on HardenedBSD 12.0-CURRENT (FreeBSD
12.0-CURRENT #0).

It complained that the -no-pie option was unrecognized, so I retried
with --no-pie: that was accepted, but there was still a segmentation
fault at dump time.

Next, based on the advice for NetBSD in etc/PROBLEMS about kernel
parameters that control address-space layout randomization (ASLR), 
I looked to see what HardenedBSD had:

	# sysctl -a | grep -i aslr
	kern.features.hbsd_aslr: 1
	options PAX_ASLR
	hardening.pax.aslr.status: 2

With those defaults, I get failure like this in the emacs build:

	Dumping under the name emacs
	11323200 of 33554432 static heap bytes used
	gmake[1]: *** [Makefile:738: bootstrap-emacs] Segmentation fault

In another window, as root, I then ran

	# sysctl kern.features.hbsd_aslr:0
	sysctl: oid 'kern.features.hbsd_aslr' is read only

	# sysctl hardening.pax.aslr.status:0
	hardening.pax.aslr.status: 2 -> 0

Then, back in the emacs build window, I ran

	% \rm src/emacs src/temacs
	% gmake
	...
	./temacs --batch  --load loadup bootstrap
	Loading loadup.el (source)...
	Using load-path (/local/build/cc/emacs-26.0.90/lisp /local/build/cc/emacs-26.0.90/lisp/emacs-lisp
	/local/build/cc/emacs-26.0.90/lisp/language /local/build/cc/emacs-26.0.90/lisp/international
	/local/build/cc/emacs-26.0.90/lisp/textmodes /local/build/cc/emacs-26.0.90/lisp/vc)
	Loading emacs-lisp/byte-run...
	Loading emacs-lisp/backquote...
	...
	Finding pointers to doc strings...
	Finding pointers to doc strings...done
	Dumping under the name emacs
	11323200 of 33554432 static heap bytes used
	96055 pure bytes used
	mv -f emacs bootstrap-emacs
	gmake -C ../lisp compile-first EMACS="../src/bootstrap-emacs"
	gmake[2]: Entering directory '/local/build/cc/emacs-26.0.90/lisp'
	gmake[2]: Nothing to be done for 'compile-first'.
	gmake[2]: Leaving directory '/local/build/cc/emacs-26.0.90/lisp'
	gmake -C ../admin/unidata all EMACS="../../src/bootstrap-emacs"
	gmake[2]: Entering directory '/local/build/cc/emacs-26.0.90/admin/unidata'
	  ELC      uvs.elc
	elf_load_section: truncated ELF file
	gmake[2]: *** [Makefile:72: uvs.elc] Abort trap

If I try to run the dumped emacs, I get

	% src/bootstrap-emacs --version
	elf_load_section: truncated ELF file
	Abort

Thus, disabling the ASLR feature in HardenedBSD 12.0 DOES let temacs
run to completion, but the result dumped emacs does not run correctly.

As I final experiment, I ported over the 11.1 emacs installation
directories to 12.0, and after installing some missing packages, and
creating some symlinks to missing older library versions, I was able
to get a usable emacs-26.0.90 on 12.0.  However, that has to be viewed
as a temporary stopgap.

The number of dependent shared libraries is frighteningly large

	% ldd $B/nemacs |wc -l
	96

so the import from 11.1 to 12.0 is fragile, and likely to break with
future system updates on the 12.0 system.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe <at> math.utah.edu  -
- 155 S 1400 E RM 233                       beebe <at> acm.org  beebe <at> computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------




This bug report was last modified 4 years and 330 days ago.

Previous Next


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