Subject: Re: bug#68690: Segmentation fault building with native-comp

From: Eli Zaretskii <[email-masked]>
Date: Wed, 24 Jan 2024 22:27:01 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: john muhl <[email-masked]>,  [email-masked]
> Date: Wed, 24 Jan 2024 14:56:49 -0500
> 
> > Adding Stefan, who installed that commit.
> 
> Oops, should be fixed now,

The build now crashes here (this is a 32-bit build with large ints):

  '../src/bootstrap-emacs.exe' -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t byte-compile-warnings 'all)"  --eval "(setq org--inhibit-version-check t)"  \
	  -l bytecomp -f byte-compile-refresh-preloaded \
	  -f batch-byte-compile ../lisp/mwheel.el

  lisp.h:1784: Emacs fatal error: assertion failed: VECTORLIKEP (a)

Here's the backtrace from GDB:

  lisp.h:1784: Emacs fatal error: assertion failed: VECTORLIKEP (a)

  Thread 1 hit Breakpoint 1, terminate_due_to_signal (sig=22,
      backtrace_limit=2147483647) at emacs.c:442
  442       signal (sig, SIG_DFL);
  (gdb) bt
  #0  terminate_due_to_signal (sig=22, backtrace_limit=2147483647) at emacs.c:442
  #1  0x00772401 in die (msg=0xddc80d <b_fwd+233> "VECTORLIKEP (a)",
      file=0xddc740 <b_fwd+28> "lisp.h", line=1784) at alloc.c:8062
  #2  0x00626a44 in XVECTOR (a=XIL(0x92348b000000000)) at lisp.h:1784
  #3  0x00626ace in gc_asize (array=XIL(0x92348b000000000)) at lisp.h:1800
  #4  0x00626bba in AREF (array=XIL(0x92348b000000000), idx=1) at lisp.h:1971
  #5  0x0063174d in Fcharset_after (pos=make_fixnum(113)) at charset.c:2084
  #6  0x007ba520 in funcall_subr (subr=0xdb7a80 <Scharset_after>, numargs=1,
      args=0x9d14a08) at eval.c:3090
  #7  0x0082d5b7 in exec_byte_code (fun=XIL(0xa0000000091dcec8),
      args_template=0, nargs=0, args=0x9d14a08) at bytecode.c:815
  #8  0x007baafa in fetch_and_exec_byte_code (fun=XIL(0xa000000009136058),
      args_template=642, nargs=10, args=0x5dce628) at eval.c:3135
  #9  0x007bb059 in funcall_lambda (fun=XIL(0xa000000009136058), nargs=10,
      arg_vector=0x5dce628) at eval.c:3207
  #10 0x007b9e7d in funcall_general (fun=XIL(0xa000000009136058), numargs=10,
      args=0x5dce628) at eval.c:2972
  #11 0x007ba202 in Ffuncall (nargs=11, args=0x5dce620) at eval.c:3022
  #12 0x007b90d0 in Fapply (nargs=2, args=0x9d14648) at eval.c:2693
  #13 0x007ba9ab in funcall_subr (subr=0xdc1f40 <Sapply>, numargs=2,
      args=0x9d14648) at eval.c:3113
  #14 0x0082d5b7 in exec_byte_code (fun=XIL(0xa000000009108c20),
      args_template=513, nargs=2, args=0x9d145e8) at bytecode.c:815
  #15 0x007baafa in fetch_and_exec_byte_code (fun=XIL(0xa00000000a6685e0),
      args_template=0, nargs=0, args=0x5dcee70) at eval.c:3135
  #16 0x007bb059 in funcall_lambda (fun=XIL(0xa00000000a6685e0), nargs=0,
      arg_vector=0x5dcee70) at eval.c:3207
  #17 0x007b9e7d in funcall_general (fun=XIL(0xa00000000a6685e0), numargs=0,
      args=0x5dcee70) at eval.c:2972
  #18 0x007ba202 in Ffuncall (nargs=1, args=0x5dcee68) at eval.c:3022
  #19 0x007adffe in call0 (fn=XIL(0xa00000000a6685e0)) at lisp.h:3349
  #20 0x007b397d in Fhandler_bind_1 (nargs=3, args=0x9d14478) at eval.c:1403
  #21 0x007ba9ab in funcall_subr (subr=0xdc1dc0 <Shandler_bind_1>, numargs=3,
      args=0x9d14478) at eval.c:3113
  #22 0x0082d5b7 in exec_byte_code (fun=XIL(0xa000000009041ed0),
      args_template=257, nargs=1, args=0x9d14440) at bytecode.c:815
  #23 0x007baafa in fetch_and_exec_byte_code (fun=XIL(0xa000000009365d18),
      args_template=0, nargs=0, args=0x5dcf5a0) at eval.c:3135
  #24 0x007bb059 in funcall_lambda (fun=XIL(0xa000000009365d18), nargs=0,
      arg_vector=0x5dcf5a0) at eval.c:3207
  #25 0x007baca9 in apply_lambda (fun=XIL(0xa000000009365d18), args=XIL(0),
      count=128) at eval.c:3157
  #26 0x007b85e6 in eval_sub (form=XIL(0xc00000000982c7b0)) at eval.c:2572
  #27 0x007b75b9 in Feval (form=XIL(0xc00000000982c7b0), lexical=XIL(0x30))
      at eval.c:2389
  #28 0x006b01ec in top_level_2 () at keyboard.c:1173
  #29 0x007b4530 in internal_condition_case (bfun=0x6b0163 <top_level_2>,
      handlers=XIL(0x90), hfun=0x6af6c2 <cmd_error>) at eval.c:1537
  #30 0x006b027f in top_level_1 (ignore=XIL(0)) at keyboard.c:1185
  #31 0x007b319e in internal_catch (tag=XIL(0x10a40),
      func=0x6b020b <top_level_1>, arg=XIL(0)) at eval.c:1217
  #32 0x006b0056 in command_loop () at keyboard.c:1134
  #33 0x006af122 in recursive_edit_1 () at keyboard.c:744
  #34 0x006af3c0 in Frecursive_edit () at keyboard.c:827
  #35 0x006aa3cc in main (argc=15, argv=0x77a2970) at emacs.c:2624

  Lisp Backtrace:
  "charset-after" (0x9d14a08)
  "fill-move-to-break-point" (0x9d149b8)
  "fill-region-as-paragraph" (0x9d14948)
  "fill-region" (0x9d14898)
  "easy-mmode--mode-docstring" (0x9d14778)
  0x9136058 PVEC_COMPILED
  "apply" (0x9d14648)
  "macroexpand-1" (0x9d145d8)
  "macroexp-macroexpand" (0x9d14578)
  "byte-compile-recurse-toplevel" (0x9d14538)
  "byte-compile-toplevel-file-form" (0x9d144f0)
  0xa6685a8 PVEC_COMPILED
  0xa6685e0 PVEC_COMPILED
  "handler-bind-1" (0x9d14478)
  0x9041ed0 PVEC_COMPILED
  "bytecomp--displaying-warnings" (0x9d14390)
  "byte-compile-from-buffer" (0x9d14328)
  "byte-compile-file" (0x9d14288)
  "batch-byte-compile-file" (0x9d14228)
  "batch-byte-compile" (0x9d14198)
  "command-line-1" (0x9d140b8)
  "command-line" (0x9d14048)
  "normal-top-level" (0x5dcf5a0)
  (gdb)