Subject: bug#45651: 28.0.50; emacs native-comp crashes with pidigits bench

From: Michael Schmidt <[email-masked]>
Date: Mon, 4 Jan 2021 12:37:10 +0100

Hi!

Running the pidigits benchmark crashes emacs with a SIGTERM.
All other benchmarks from the elip-benchmarks-1.9 suite passed and were
moved in another dir for this run.
I tested both with and without libgmp.

gdb:
Thread 1 "emacs-28.0.50.1" received signal SIGTERM, Terminated.
allocate_vector_from_block (nbytes=24) at alloc.c:3025
3025           index < VECTOR_MAX_FREE_LIST_INDEX; index++)

[...]
(gdb) bt full
#0  allocate_vector_from_block (nbytes=24) at alloc.c:3025
vector = 0x0
block = 0x7fffffffbda0
index = 92
restbytes = 0
#1  0x000000000064aa2c in allocate_vectorlike (len=2, clearit=false) at alloc.c:3305
nbytes = 24
p = 0xce6440 <mpz>
#2  0x000000000064ac58 in allocate_pseudovector (memlen=2, lisplen=0, zerolen=0, tag=PVEC_BIGNUM) at alloc.c:3382
v = 0x244
#3  0x00000000005e1574 in make_bignum_bits (bits=580) at bignum.c:93
b = 0xd11900 <freloc>
#4  0x00000000005e1807 in make_integer_mpz () at bignum.c:161
bits = 580
#5  0x000000000066a0e6 in bignum_arith_driver (code=Amult, nargs=2, args=0x7fffffffbf50, argnum=2, iaccum=3159281367, val=make_fixnum(2)) at data.c:2927
next = 0xce6450 <mpz+16>
accum = 0xce6440 <mpz>
#6  0x000000000066a399 in arith_driver (code=Amult, nargs=2, args=0x7fffffffbf50, val=XIL(0x2f13b3b5d)) at data.c:2993
argnum = 0
accum = 3159281367
#7  0x000000000066a54c in Ftimes (nargs=2, args=0x7fffffffbf50) at data.c:3038
a = XIL(0x2f13b3b5d)
#8  0x00007fffd93db4f9 in F656c622d6e6578742d7465726d_elb_next_term_0 ()
at /home/mike/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/pidigits-22132bdd38575b726ac6394158ec2a2c-5728b356c772df7625b0ec392163a334.eln
#9  0x00007fffd93db68a in F656c622d7069646967697473_elb_pidigits_0 ()
at /home/mike/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/pidigits-22132bdd38575b726ac6394158ec2a2c-5728b356c772df7625b0ec392163a334.eln
#10 0x00007fffd93db8c1 in F656c622d70696469676974732d656e747279_elb_pidigits_entry_0 ()
at /home/mike/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/pidigits-22132bdd38575b726ac6394158ec2a2c-5728b356c772df7625b0ec392163a334.eln
#11 0x0000000000689890 in eval_sub (form=XIL(0x19fd713)) at eval.c:2446
i = 0
maxargs = 0
args_left = XIL(0)
numargs = 0
original_fun = XIL(0x12c1340)
original_args = XIL(0)
count = 23
fun = XIL(0x1fd147d)
val = XIL(0x19fcb83)
funcar = XIL(0xd01360)
argvals = {XIL(0x7fffffffc190), make_fixnum(1677754), XIL(0x1eab93e00), XIL(0), XIL(0x19fcbc3), XIL(0x89d0), XIL(0x7fffffffc170), XIL(0x7fffeab93e00)}
#12 0x0000000000683ccc in Fprogn (body=XIL(0x19fd493)) at eval.c:471
form = XIL(0x19fd713)
val = XIL(0)
--Type <RET> for more, q to quit, c to continue without paging--   c
#13 0x0000000000685d4c in Flet (args=XIL(0x19fd453)) at eval.c:1055
temps = 0x7fffffffc220
tem = XIL(0)
lexenv = XIL(0x19fcbc3)
elt = XIL(0x12c15b0)
count = 22
argnum = 1
sa_avail = 16376
sa_count = 22
varlist = XIL(0)
varlist_len = 1
nvars = 1
#14 0x00000000006894f3 in eval_sub (form=XIL(0x19fd443)) at eval.c:2402
args_left = XIL(0x19fd453)
numargs = 5
original_fun = XIL(0x95a0)
original_args = XIL(0x19fd453)
count = 21
fun = XIL(0xc83fc5)
val = XIL(0x7fffffffc380)
funcar = XIL(0)
argvals = {XIL(0x7fffffffc340), XIL(0), XIL(0xd01360), XIL(0), XIL(0x7fffffffc360), XIL(0x681d93), make_fixnum(1073741824), XIL(0xd01360)}
#15 0x0000000000689cc3 in eval_sub (form=XIL(0x19fd653)) at eval.c:2522
count1 = 21
exp = XIL(0x19fd443)
original_fun = XIL(0xe5fa20)
original_args = XIL(0x19fd6b3)
count = 20
fun = XIL(0xe69c03)
val = XIL(0x7fffffffc4a0)
funcar = XIL(0x9ba0)
argvals = {XIL(0x7fffeab93e00), XIL(0), XIL(0xd01360), XIL(0), XIL(0x7fffffffc480), XIL(0x6906fc), XIL(0x7fffffffc490), XIL(0xd01360)}
#16 0x00000000006896b9 in eval_sub (form=XIL(0x19fd5a3)) at eval.c:2416
arg = XIL(0x19fd653)
vals = 0x7fffffffc510
argnum = 1
sa_avail = 16360
sa_count = 20
args_left = XIL(0x19fd5c3)
numargs = 3
original_fun = XIL(0x9870)
original_args = XIL(0x19fd5b3)
count = 19
fun = XIL(0xc7e8c5)
val = XIL(0)
funcar = XIL(0xd01360)
argvals = {XIL(0x7fffffffc5f0), make_fixnum(1677754), XIL(0x1eab93e00), XIL(0), XIL(0x19fd533), XIL(0x89d0), XIL(0x7fffffffc5d0), XIL(0x7fffeab93e00)}
#17 0x0000000000683ccc in Fprogn (body=XIL(0)) at eval.c:471
form = XIL(0x19fd5a3)
val = XIL(0)
#18 0x0000000000685d4c in Flet (args=XIL(0x19fd583)) at eval.c:1055
temps = 0x7fffffffc680
tem = make_fixnum(30)
lexenv = XIL(0x19fd533)
elt = XIL(0x19fd693)
count = 18
argnum = 2
sa_avail = 16368
sa_count = 18
varlist = XIL(0)
varlist_len = 2
nvars = 2
#19 0x00000000006894f3 in eval_sub (form=XIL(0x19fd573)) at eval.c:2402
args_left = XIL(0x19fd583)
numargs = 2
original_fun = XIL(0x95a0)
original_args = XIL(0x19fd583)
count = 17
fun = XIL(0xc83fc5)
val = XIL(0x7fffffffc7f0)
funcar = XIL(0)
argvals = {XIL(0x7fffffffc7b0), XIL(0), XIL(0xd01360), XIL(0), XIL(0x7fffffffc7d0), XIL(0x681d93), make_fixnum(1073741824), XIL(0xd01360)}
#20 0x0000000000689cc3 in eval_sub (form=XIL(0x19fd6e3)) at eval.c:2522
count1 = 17
exp = XIL(0x19fd573)
original_fun = XIL(0x7fffe977f2a8)
original_args = XIL(0x19fd6f3)
count = 16
fun = XIL(0xe69e03)
val = XIL(0x7fffffffc930)
funcar = XIL(0x9ba0)
argvals = {XIL(0x7fffffffc8d0), XIL(0x7fffeab93e00), XIL(0x7fffffffc8d0), XIL(0xd01360), XIL(0), XIL(0x19f1078), XIL(0x7fffffffc8f0), XIL(0xd09d30)}
#21 0x0000000000688e78 in Feval (form=XIL(0x19fd6e3), lexical=XIL(0x30)) at eval.c:2278
count = 15
#22 0x00007fffd9961dbe in F656c6973702d62656e63686d61726b732d72756e_elisp_benchmarks_run_0 () at /home/mike/.emacs.d/eln-cache/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/elisp-benchmarks-d217026a16f93ba804ff4a2bce0ac791-02eba4fb124454c4dfffa7915c3e12c0.eln
#23 0x000000000068b563 in funcall_subr (subr=0x1eafe50, numargs=0, args=0x7fffffffd080) at eval.c:3029
#24 0x000000000068b13a in Ffuncall (nargs=1, args=0x7fffffffd078) at eval.c:2974
fun = XIL(0x1eafe55)
original_fun = XIL(0x388c90)
funcar = make_fixnum(1492280)
numargs = 0
val = XIL(0x100000000)
count = 14
#25 0x000000000067f443 in Ffuncall_interactively (nargs=1, args=0x7fffffffd078) at callint.c:253
speccount = 13
#26 0x000000000068b563 in funcall_subr (subr=0xc83840 <Sfuncall_interactively>, numargs=1, args=0x7fffffffd078) at eval.c:3029
#27 0x000000000068b13a in Ffuncall (nargs=2, args=0x7fffffffd070) at eval.c:2974
fun = XIL(0xc83845)
original_fun = XIL(0x7470)
funcar = XIL(0)
numargs = 1
val = XIL(0x7fffffffd000)
count = 12
#28 0x0000000000689e4b in Fapply (nargs=3, args=0x7fffffffd070) at eval.c:2557
i = 6808136
funcall_nargs = 140737488343040
funcall_args = 0x0
spread_arg = XIL(0)
fun = XIL(0x7470)
sa_avail = 16384
sa_count = 12
numargs = 0
retval = XIL(0x7470)
#29 0x000000000067f8af in Fcall_interactively (function=XIL(0x388c90), record_flag=XIL(0xc1e0), keys=XIL(0x1b8e2ad)) at callint.c:346
funval = XIL(0x1eafe55)
events = 7
input = XIL(0)
speccount = 11
arg_from_tty = false
key_count = 22
record_then_fail = false
save_this_command = XIL(0x388c90)
save_this_original_command = XIL(0x7fffe9acf720)
save_real_this_command = XIL(0x388c90)
save_last_command = XIL(0)
prefix_arg = XIL(0)
enable = XIL(0)
up_event = XIL(0)
form = XIL(0xe6ccd3)
specs = XIL(0)
sa_avail = 0
sa_count = 13636448
string_len = 140737488343520
string = 0xd01360 <lispsym> "\230\001"
string_end = 0x681d93 <make_lisp_symbol+57> "H9E\350t\024\272\351\003"
next_event = 32177749
nargs = 140737488343616
args = 0xd01360 <lispsym>
visargs = 0x7fffffffd1e0
varies = 0x0
tem = 0x0
val = XIL(0x4)
#30 0x00007fffea1f22d9 in F636f6d6d616e642d65786563757465_command_execute_0 () at /home/mike/emacs/src/../native-lisp/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/simple-fab5b0cffee734040ac60e9bc557cd20-323d3d979103c267037f0e2ad77cf9af.eln
#31 0x000000000068b6d9 in funcall_subr (subr=0x7fffea3fd9b0, numargs=2, args=0x7fffffffd480) at eval.c:3057
internal_argbuf = {XIL(0x388c90), XIL(0xc1e0), XIL(0), XIL(0), make_fixnum(1706153), XIL(0x1000681ddf), XIL(0x7fffea3fd9b5), XIL(0x7fffffffd3c0)}
internal_args = 0x7fffffffd370
#32 0x000000000068b13a in Ffuncall (nargs=3, args=0x7fffffffd478) at eval.c:2974
fun = XIL(0x7fffea3fd9b5)
original_fun = XIL(0x4530)
funcar = XIL(0x68d178)
numargs = 2
val = XIL(0x7fffffffd440)
count = 10
#33 0x00007fffea1f1831 in F657865637574652d657874656e6465642d636f6d6d616e64_execute_extended_command_0 () at /home/mike/emacs/src/../native-lisp/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/simple-fab5b0cffee734040ac60e9bc557cd20-323d3d979103c267037f0e2ad77cf9af.eln
#34 0x000000000068b6a2 in funcall_subr (subr=0x7fffea7d0ad0, numargs=3, args=0x7fffffffd750) at eval.c:3054
internal_argbuf = {XIL(0x7fffea7d0ad5), XIL(0x1000d01360), XIL(0x7fffea7d0ad0), XIL(0x7fffffffd568), make_fixnum(1706153), XIL(0x1000681ddf), XIL(0x7fffea7d0ad5), XIL(0x7fffffffd580)}
internal_args = 0x7fffffffd750
#35 0x000000000068b13a in Ffuncall (nargs=4, args=0x7fffffffd748) at eval.c:2974
fun = XIL(0x7fffea7d0ad5)
original_fun = XIL(0x7fffe9acf720)
funcar = make_fixnum(1492280)
numargs = 3
val = make_fixnum(100)
count = 8
#36 0x000000000067f443 in Ffuncall_interactively (nargs=4, args=0x7fffffffd748) at callint.c:253
speccount = 7
#37 0x000000000068b563 in funcall_subr (subr=0xc83840 <Sfuncall_interactively>, numargs=4, args=0x7fffffffd748) at eval.c:3029
#38 0x000000000068b13a in Ffuncall (nargs=5, args=0x7fffffffd740) at eval.c:2974
fun = XIL(0xc83845)
original_fun = XIL(0x7470)
funcar = XIL(0xd01360)
numargs = 4
val = XIL(0)
count = 6
#39 0x000000000068a27a in Fapply (nargs=3, args=0x7fffffffd860) at eval.c:2604
i = 5
funcall_nargs = 5
funcall_args = 0x7fffffffd740
spread_arg = XIL(0)
fun = XIL(0xc83845)
sa_avail = 16344
sa_count = 6
numargs = 4
retval = XIL(0x7470)
#40 0x000000000067f8af in Fcall_interactively (function=XIL(0x7fffe9acf720), record_flag=XIL(0), keys=XIL(0x7fffeab80785)) at callint.c:346
funval = XIL(0x7fffea7d0ad5)
events = 1
input = XIL(0x7fffea7d0b43)
speccount = 5
arg_from_tty = false
key_count = 1
record_then_fail = false
save_this_command = XIL(0x7fffe9acf720)
save_this_original_command = XIL(0x7fffe9acf720)
save_real_this_command = XIL(0x7fffe9acf720)
save_last_command = XIL(0)
prefix_arg = XIL(0)
enable = XIL(0)
up_event = XIL(0)
form = XIL(0x7fffea7d0b23)
specs = XIL(0x16c06d3)
sa_avail = 0
sa_count = 0
string_len = 0
string = 0xd01360 <lispsym> "\230\001"
string_end = 0xd01360 <lispsym> "\230\001"
next_event = 140737127451349
nargs = 140737488345648
args = 0xd01360 <lispsym>
visargs = 0xd01360 <lispsym>
varies = 0x6906fc <make_lisp_symbol+57> "H9E\350t\024\272\351\003"
tem = 0x0
val = XIL(0x7fffea72d970)
#41 0x00007fffea1f22d9 in F636f6d6d616e642d65786563757465_command_execute_0 () at /home/mike/emacs/src/../native-lisp/28.0.50-x86_64-pc-linux-gnu-e3a5f788b71c3a9845018a44bb9fa705/simple-fab5b0cffee734040ac60e9bc557cd20-323d3d979103c267037f0e2ad77cf9af.eln
#42 0x000000000068b6d9 in funcall_subr (subr=0x7fffea3fd9b0, numargs=1, args=0x7fffffffdc58) at eval.c:3057
internal_argbuf = {XIL(0x7fffe9acf720), XIL(0), XIL(0), XIL(0), make_fixnum(1706153), XIL(0x1000681ddf), XIL(0x7fffea3fd9b5), XIL(0x7fffffffdbb0)}
internal_args = 0x7fffffffdb60
#43 0x000000000068b13a in Ffuncall (nargs=2, args=0x7fffffffdc50) at eval.c:2974
fun = XIL(0x7fffea3fd9b5)
original_fun = XIL(0x4530)
funcar = XIL(0xffdf18)
numargs = 1
val = make_fixnum(1706230)
count = 4
#44 0x000000000068a94a in call1 (fn=XIL(0x4530), arg1=XIL(0x7fffe9acf720)) at eval.c:2834
#45 0x00000000005b26e2 in command_loop_1 () at keyboard.c:1466
scount = 3
cmd = XIL(0x7fffe9acf720)
keybuf = {make_fixnum(134217848), XIL(0x89d0), XIL(0x7fffffffdd20), make_fixnum(1677754), XIL(0x1eab93e00), XIL(0x7fffeab93e00), XIL(0), XIL(0x89d0), XIL(0x7fffffffdd00), XIL(0), XIL(0xd01360), XIL(0), XIL(0x7fffffffdd20), XIL(0x681d93), make_fixnum(34910567923712), XIL(0), XIL(0xd01360), XIL(0), XIL(0x7fffffffdd50), XIL(0x681d93), XIL(0), XIL(0xd01360), XIL(0), XIL(0), XIL(0x7fffffffdd70), XIL(0x681ddf), make_fixnum(2), XIL(0x89d0), XIL(0x7fffffffddb0), make_fixnum(1711396)}
i = 1
prev_modiff = 48
prev_buffer = 0x19f1078
already_adjusted = false
#46 0x0000000000686ca3 in internal_condition_case (bfun=0x5b1ec7 <command_loop_1>, handlers=XIL(0x90), hfun=0x5b1530 <cmd_error>) at eval.c:1424
val = XIL(0x5ae77c)
c = 0xf67ce0
#47 0x00000000005b1ad7 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1094
val = XIL(0xe340)
#48 0x00000000006861b1 in internal_catch (tag=XIL(0xe340), func=0x5b1aae <command_loop_2>, arg=XIL(0)) at eval.c:1185
val = XIL(0)
c = 0xf67bb0
#49 0x00000000005b1a7a in command_loop () at keyboard.c:1073
#50 0x00000000005b1044 in recursive_edit_1 () at keyboard.c:720
count = 1
val = XIL(0x7fffffffdf20)
#51 0x00000000005b1225 in Frecursive_edit () at keyboard.c:789
count = 0
buffer = XIL(0)
#52 0x00000000005ad3b2 in main (argc=1, argv=0x7fffffffe188) at emacs.c:2087
stack_bottom_variable = 0x7fffee021ea0 <typeinfo for std::num_get<wchar_t, std::istreambuf_iterator<wchar_t, std::char_traits<wchar_t> > >>
no_loadup = false
junk = 0x0
dname_arg = 0x0
ch_to_dir = 0x0
original_pwd = 0x0
dump_mode = 0x0
skip_args = 0
temacs = 0x0
attempt_load_pdump = true
rlim = {
rlim_cur = 10022912,
rlim_max = 18446744073709551615
}
lc_all = 0x0
sockfd = -1
module_assertions = false

Thread 1 "emacs-28.0.50.1" received signal SIGTERM, Terminated.
backtrace_top () at eval.c:176
176    {
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(backtrace_top) will be abandoned.
When the function is done executing, GDB will silently stop.
[end]

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
of 2021-01-03 built on localhost.localdomain
Repository revision: a3f2373bfb604af5570c86b4ffefb23296a5bfdd
Repository branch: feature/native-comp
Windowing system distributor 'Fedora Project', version 11.0.12010000
System Description: Fedora 33 (Workstation Edition)

Configured using:
'configure -enable-checking=yes,glyphs --enable-check-lisp-object-type
'CFLAGS=-O0 -g3' --with-nativecomp --with-x-toolkit=yes
--with-mailutils --with-sound --with-json --with-cairo --with-xwidgets
--with-file-notification=yes --with-modules --without-libgmp'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS
XWIDGETS JSON PDUMPER

Important settings:
value of $LANG: de_DE.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils info package
easymenu browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face pcase macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process nativecomp
emacs)

Memory information:
((conses 16 86393 8315)
(symbols 48 8008 0)
(strings 32 24673 1863)
(string-bytes 1 817585)
(vectors 16 14753)
(vector-slots 8 315270 10618)
(floats 8 29 14)
(intervals 56 254 0)
(buffers 984 11))

All the best,
Michael Schmidt