6

I'm writing to see if you have tried to compile Emacs lately. I want to compile emacs-25.1 but hit a segmentation fault. If you wonder why I want to compile, or why I'm asking here, read on...

I upgraded to Ubuntu 16.10 today and emacs-24.5 still runs, but the toolbar icons have turned invisible. After a suitable amount of googling, I found this problem has appeared through time, usually either a flaw in gtk+, the desktop theme, or Emacs itself. The most recent posts seem to say that there was a bug in the Emacs code that was since fixed (https://bugs.archlinux.org/task/48862).

I figured I'd try emacs25, see if it is fixed there. Many people suggest using the repo offered here, (deb http://ppa.launchpad.net/adrozdoff/emacs/ubuntu yakkety main), however that one is refused by apt-get for a reason I have not seen before:

W: The repository 'http://ppa.launchpad.net/adrozdoff/emacs/ubuntu yakkety Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

I don't mind compiling programs, so I'll move forward.

My first idea was to take the source deb packaging from that website but trying to build the package resulted in a segmentation fault.

Supposing that there was something wrong in that packaging, I tried to build from source. I end in the same segmentation fault:

$ wget http://ftp.gnu.org/gnu/emacs/emacs-25.1.tar.gz
$ tar xzvf emacs-25.1.tar.gz
$ cd emacs-25.1
$ ./configure --prefix=/usr/local
$ make

After a few thousand lines, I get same seg fault I saw rebuilding package

Loading emacs-lisp/eldoc...
Loading cus-start...
Loading tooltip...
Loading /home/pauljohn/LinuxDownloads/Ubuntu/sources/emacs/emacs-25.1/lisp/leim/leim-list.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Dumping under the name emacs
Makefile:736: recipe for target 'bootstrap-emacs' failed  
make[1]: *** [bootstrap-emacs] Segmentation fault (core dumped)
make[1]: Leaving directory '/home/pauljohn/LinuxDownloads/Ubuntu/sources/emacs/emacs-25.1/src'
Makefile:398: recipe for target 'src' failed
make: *** [src] Error 2

While googling the error message, I don't find a fix. I do find plenty of emacs seg faults over time, of course, but they usually give a more informative message. I think the mention of Makefile:736 is referring to the Makefile in the src directory:

bootstrap-emacs$(EXEEXT): temacs$(EXEEXT)
        $(MAKE) -C ../lisp update-subdirs
ifeq ($(CANNOT_DUMP),yes)
        ln -f temacs$(EXEEXT) $@
else
        $(RUN_TEMACS) --batch --load loadup bootstrap
   ifneq ($(PAXCTL_dumped),)
        $(PAXCTL_dumped) emacs$(EXEEXT)
   endif
        mv -f emacs$(EXEEXT) $@
endif

I have not been in this situation in a long time.

I found pages about past seg faults building Emacs

1 https://bbs.archlinux.org/viewtopic.php?id=197841. In Arch linux there is a "hardening" package that was installed and Emacs was failing because of that. I found I had a package "hardening-includes" from Ubuntu 16.10 and I removed that to see if the result would change. No!

2 https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-04/msg00371.html. There was an errant compiler flag. I don't have that flag.

3 http://emacs.1067599.n8.nabble.com/bug-20190-Building-emacs-24-4-against-GCC-5-0-td352965.html says there was an environment flag that was to blame. I don't have that.

The Emacs bug reporting process (https://debbugs.gnu.org/Emacs.html) is, well, difficult me. I can't figure how to submit a new bug.

I uploaded the whole configure/make output in case that is informative:

http://pj.freefaculty.org/scraps/emacs-build-fail-20161013.txt

  • I don't want to build my own emacs, do you have a working build I can use? – Menasheh Jan 2 '17 at 14:52
3

After a little rest, I found that this problem was discovered before Yakkety Yak was released but the fix was not included in the packages. If you look here

https://bugs.launchpad.net/ubuntu/+source/emacs24/+bug/1623585

you should find my post toward the end that says I did rebuild the package source they mention, and I can confirm it does build and that the Emacs toolbar icons will re-appear.

| improve this answer | |
  • Isn't your original question about building emacs 25, not a lack of a toolbar in emacs 24? – Jeremiah Peschka Oct 14 '16 at 13:00
  • Original need to build Emacs25 was lack of toolbar in Yakkety's release of Emacs24. Now we have patches that do apply to 24.5 to fix the toolbar problem. I am considering if it is worth effort to do same. The tricky part is that there are several existing Emacs24 patches that won't apply cleanly to the Emacs25 source. – pauljohn32 Oct 14 '16 at 13:39
  • Ah, I understand. You should clean up the question and title to indicate that this is about the toolbar in emacs24, not emacs25. – Jeremiah Peschka Oct 14 '16 at 14:01
  • I confirm @Tim claim that compiler flags are complication with Emacs25 build. Have built it, but now run with packages you can download too! There is a Ubunutu PPA that offers packages for Emacs 25 and these have worked well in my testing. launchpad.net/~kelleyk/+archive/ubuntu/emacs. Hats off to Kelly K. This works after you follow the usual repo install routine. Tested it by building a lot of newer packages in MELPA, everything worked that was supposed to work with Emacs 25 – pauljohn32 Nov 19 '16 at 3:43
2

Just for completeness, it seems the reason emacs 25 will not build correctly under Ubuntu 16.10 is due to changes in the default flags being used by gcc on Ubuntu 16.10. To get emacs to build, you need to add -no-pie to the flags. The following works:

$ ./autogen.sh
$ ./configure CFLAGS=-no-pie <other configure options>

until an update is made in the git repo

| improve this answer | |
  • This solves the empty toolbar problem in emacs 25? – pauljohn32 Oct 16 '16 at 3:41
  • This solves the seg fault problem with prevents you from being able to build emacs 25 on Ubuntu 16.10. I don't know about the missing toolbar issue as I've had no problems with missing toolbars for emacs 25 on either ubuntu 16.04 or 16.10. – Tim X Oct 27 '16 at 23:32
  • I believe the seg fualt issue due to Ubuntu's default gcc configuration using PIE has now been resolved in the emacs git repo, to the above work-around is no longer required – Tim X Oct 27 '16 at 23:34
  • I confirm CFLAGS=-no-pie does solve the problem – Louis Kottmann Nov 1 '16 at 13:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.