Subject: bug#18392: Bug#759400: emacs24-nox: segfault when saving emacs lisp file

From: Rob Browning <[email-masked]>
Date: Tue, 02 Sep 2014 22:16:25 -0500

[If possible, please preserve the -forwarded address in any replies.]

It appears that Emacs 24.3 is crashing on Debian mipsel, though it's not
clear whether it's an Emacs problem, a toolchain issue, or something
else.

For now, I've been able to reproduce the crash by following the
instructions below on one of our porter boxes.

If helpful, I'd be happy to run further tests, or gather any additional
information.

On Ma, 26 aug 14, 17:16:32, David Bremner wrote:

> To reproduce, 
> 
> 0. log into a mipsel host
> 
> 1. run "emacs -Q foo.el", where foo.el is the attached file 
>    (from the notmuch source)
> 
> 2. Press space or modify the file in some other way
> 
> 3. save the file using Control-X Control-S
> 
> For me this prints 
> 
> "Fatal error 6: aborted"
> 
> And then it seems like emacs hangs, and never returns to the shell.
> 
> I originally noticed a possibly related problem with the same file
> causing notmuch to FTBFS on notmuch. Here byte compilation leads to a
> more detailed output.
> 
>  % emacs --quick -batch  --directory .  -f batch-byte-compile notmuch-show.el
> emacs: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) -
> 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long)
> (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2
> *(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned
> long) old_end & pagemask) == 0)' failed.

The file mentioned (notmuch-show.el) is avaiable as an attachment to the
full bug report here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759400

Also, when I tested, I saw:

  emacs24-nox: malloc.c:2372: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 *(sizeof(size_t))) - 1)) & ~((2 *(sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long) old_end & pagemask) == 0)' failed.

  Program received signal SIGABRT, Aborted.
  0x77943ee8 in raise () from /lib/mipsel-linux-gnu/libc.so.6
  (gdb) Quit
  (gdb) where
  #0  0x77943ee8 in raise () from /lib/mipsel-linux-gnu/libc.so.6
  #1  0x77945948 in abort () from /lib/mipsel-linux-gnu/libc.so.6
  #2  0x7798fad0 in ?? () from /lib/mipsel-linux-gnu/libc.so.6

  Lisp Backtrace:
  "find-coding-systems-region-internal" (0x7fff23a0)
  "find-coding-systems-region" (0x7fff2510)
  "select-safe-coding-system" (0x7fff2694)
  "write-region" (0x7fff2ab8)
  "basic-save-buffer-2" (0x7fff2c30)
  "basic-save-buffer-1" (0x7fff2d98)
  "basic-save-buffer" (0x7fff2f10)
  "save-buffer" (0x7fff30ac)
  "call-interactively" (0x7fff31d4)

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4