Subject: bug#28308: Build failure on FreeBSD/aarch64

From: Noam Postavsky <[email-masked]>
Date: Tue, 24 Oct 2017 14:43:09 -0400

On Fri, Oct 20, 2017 at 3:07 AM, Eli Zaretskii <[email-masked]> wrote:

>> * thread #1, name = 'bootstrap-emacs', stop reason = signal SIGSEGV: invalid address (fault address: 0x41626d78)
>> 0x000000000022810c XFLOAT_INIT at /root/emacs/src/alloc.c:543
>> 0x0000000000227eb0 make_float at /root/emacs/src/alloc.c:2667
>> 0x000000000022de24 init_alloc at /root/emacs/src/alloc.c:7481
>> 0x000000000016825c main at /root/emacs/src/emacs.c:1251

> Can you disassemble XFLOAT_INIT and tell which part of it caused the
> segfault, and why?  In particular, what is the relation of the
> faulting address 0x41626d78 and the C source?

The faulting address is XFLOAT(f):

static void
XFLOAT_INIT (Lisp_Object f, double n)
{
  XFLOAT (f)->u.data = n;
}

'f' is 'val' in make_float. I added a fprintf(stderr, "%p\n",
XFLOAT(val)) before the XFLOAT_INIT call, the address which was ok
with temacs triggers SIGSEGV in bootstrap-emacs.
It seems that the memory pointer to by float_block->floats becomes
invalid following the dumping process.

By the way, when I delete bootstrap-emacs and redump, the faulting
address changes (although it's always of the form 0x4XXXXXXX).