Subject: bug#57789: Emacs 28.1 clone build with native compilation crashes on s390x

From: Rob Browning <[email-masked]>
Date: Sat, 17 Sep 2022 16:00:17 -0500

Eli Zaretskii <[email-masked]> writes:

> Rob Browning <[email-masked]> writes:

> Does the build of the same code with the same options sans
> "--with-native-compilation" succeed, or does it also crash with
> similar symptoms?

Works fine.

> You can source it manually from the GDB prompt, when the segfault
> happens, and then invoke xbacktrace manually, can't you?

Yep.

  Breakpoint 1 at 0x2aa0004ef30: file emacs.c, line 400.
  Breakpoint 2 at 0x2aa0010f168: file xterm.c, line 10291.
  (gdb) xbacktrace
  "Automatic GC" (0x0)
  "internal-macroexpand-for-load" (0xffffa6a8)
  "eval-buffer" (0xffffaa28)
  "let" (0xffffac10)
  "let" (0xffffae28)
  "unwind-protect" (0xffffaff0)
  "let" (0xffffb1f8)
  "if" (0xffffb3c8)
  "load-with-code-conversion" (0xffffb650)
  "time-since" (0xffffbba8)
  "comp--native-compile" (0xffffbd38)
  "batch-native-compile" (0xffffbef0)
  "batch-byte+native-compile" (0xffffc080)
  "funcall" (0xffffc078)
  "if" (0xffffc268)
  "cond" (0xffffc438)
  "let*" (0xffffc618)
  "while" (0xffffc7e8)
  "let*" (0xffffc9c8)
  "progn" (0xffffcb98)
  "if" (0xffffccc0)
  "let" (0xffffceb8)
  "let" (0xffffd0b0)
  "command-line-1" (0xffffd280)
  "let" (0xffffd570)
  "command-line" (0xffffd740)
  "unwind-protect" (0xffffd9f0)
  "let" (0xffffdbe8)
  "if" (0xffffddb8)
  "normal-top-level" (0xffffdf88)

> Too bad, it means we have a heisenbug on our hands, which will make it
> even harder to debug (as if debugging crashes in GC were not hard
> enough already).
>
> What happens if you modify this variable:
>
>   (defcustom native-comp-debug (if (eq 'windows-nt system-type) 1 0)
>
> to have the value 1 or even zero, and then rebuild from scratch? does
> the build succeed then?

No, appears to crash in the same way.

> Yes, running the full test suite would be the logical next step.

Oh, I had run it, I just meant that I'd likely want to double-check via
testing in a loop to try to see if it might be an intermittent failure.

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