bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#42540: 28.0.50; macOS assertion failure in src/alloc-tests


From: Philipp
Subject: bug#42540: 28.0.50; macOS assertion failure in src/alloc-tests
Date: Sat, 25 Jul 2020 21:26:54 +0200

This is another follow-up to Bug#30700.  It's rather subtle, and I
couldn't get GDB to work, so here's the LLDB backtrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff6fa6f33a libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff6fb2be60 libsystem_pthread.dylib`pthread_kill + 430
    frame #2: 0x00007fff6f98693e libsystem_c.dylib`raise + 26
    frame #3: 0x00000001004a24e2 emacs`terminate_due_to_signal(sig=6, 
backtrace_limit=40) at emacs.c:409:3
    frame #4: 0x00000001004a28f3 emacs`emacs_abort at sysdep.c:2431:3
    frame #5: 0x0000000100292071 emacs`string_bytes(s=0x0000000101330300) at 
alloc.c:1702:5
    frame #6: 0x000000010031e7c5 emacs`STRING_BYTES(s=0x0000000101330300) at 
lisp.h:1621:22
    frame #7: 0x0000000100300fcd emacs`SBYTES(string=(i = 0x0000000101330304)) 
at lisp.h:1632:10
    frame #8: 0x000000010030e411 emacs`internal_equal(o1=(i = 
0x0000000101330304), o2=(i = 0x00000001013302e4), equal_kind=EQUAL_PLAIN, 
depth=0, ht=(i = 0x0000000000000000)) at fns.c:2489:11
    frame #9: 0x00000001003073b5 emacs`Fequal(o1=(i = 0x0000000101330304), 
o2=(i = 0x00000001013302e4)) at fns.c:2321:10
    frame #10: 0x00000001002f94a6 emacs`funcall_subr(subr=0x00000001005290e8, 
numargs=2, args=0x00007ffeefbf1928) at eval.c:2870:19
    frame #11: 0x00000001002f7b1d emacs`Ffuncall(nargs=3, 
args=0x00007ffeefbf1920) at eval.c:2795:11
    frame #12: 0x00000001002f78d9 emacs`Fapply(nargs=2, 
args=0x00007ffeefbf1a90) at eval.c:2425:24
    frame #13: 0x00000001002e9de2 emacs`eval_sub(form=(i = 0x0000000101898993)) 
at eval.c:2246:10
    frame #14: 0x00000001002eaffa emacs`Fsetq(args=(i = 0x00000001018989b3)) at 
eval.c:509:13
    frame #15: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x00000001018989c3)) 
at eval.c:2227:8
    frame #16: 0x00000001002efe9e emacs`Funwind_protect(args=(i = 
0x0000000101897d83)) at eval.c:1213:9
    frame #17: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897d73)) 
at eval.c:2227:8
    frame #18: 0x00000001002ea8ad emacs`Fif(args=(i = 0x0000000101897dd3)) at 
eval.c:414:10
    frame #19: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897dc3)) 
at eval.c:2227:8
    frame #20: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #21: 0x00000001002ef0df emacs`Flet(args=(i = 0x0000000101897e23)) at 
eval.c:987:9
    frame #22: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897e33)) 
at eval.c:2227:8
    frame #23: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x00000001018986a3)) 
at eval.c:462:13
    frame #24: 0x00000001002ef0df emacs`Flet(args=(i = 0x0000000101897e63)) at 
eval.c:987:9
    frame #25: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897e73)) 
at eval.c:2227:8
    frame #26: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #27: 0x00000001002ed57f emacs`FletX(args=(i = 0x0000000101897e93)) at 
eval.c:919:9
    frame #28: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897ea3)) 
at eval.c:2227:8
    frame #29: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000101898d53)) 
at eval.c:462:13
    frame #30: 0x00000001002ef0df emacs`Flet(args=(i = 0x0000000101897f13)) at 
eval.c:987:9
    frame #31: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897f23)) 
at eval.c:2227:8
    frame #32: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #33: 0x00000001002eacd5 emacs`prog_ignore(body=(i = 
0x0000000101897f53)) at eval.c:473:3
    frame #34: 0x00000001002ef309 emacs`Fwhile(args=(i = 0x0000000101897f43)) 
at eval.c:1008:7
    frame #35: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897f33)) 
at eval.c:2227:8
    frame #36: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #37: 0x00000001002ef0df emacs`Flet(args=(i = 0x0000000101897f73)) at 
eval.c:987:9
    frame #38: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897f83)) 
at eval.c:2227:8
    frame #39: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #40: 0x00000001002ef0df emacs`Flet(args=(i = 0x0000000101897fa3)) at 
eval.c:987:9
    frame #41: 0x00000001002e85d9 emacs`eval_sub(form=(i = 0x0000000101897fb3)) 
at eval.c:2227:8
    frame #42: 0x00000001002eaa97 emacs`Fprogn(body=(i = 0x0000000000000000)) 
at eval.c:462:13
    frame #43: 0x00000001002fa133 emacs`funcall_lambda(fun=(i = 
0x000000010189e763), nargs=0, arg_vector=0x00007ffeefbf4a38) at eval.c:3065:11
    frame #44: 0x00000001002f7cff emacs`Ffuncall(nargs=1, 
args=0x00007ffeefbf4a30) at eval.c:2809:8
    frame #45: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x0000000101313e64), vector=(i = 0x0000000101848fad), maxdepth=(i = 
0x000000000000002a), args_template=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbf5ac8) at bytecode.c:635:12
    frame #46: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x00000001018490ed), syms_left=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbf5ac0) at eval.c:2917:10
    frame #47: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x00000001018490ed), nargs=1, arg_vector=0x00007ffeefbf5ac0) at eval.c:2998:11
    frame #48: 0x00000001002f7b6f emacs`Ffuncall(nargs=2, 
args=0x00007ffeefbf5ab8) at eval.c:2797:11
    frame #49: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x0000000101314344), vector=(i = 0x000000010184967d), maxdepth=(i = 
0x0000000000000036), args_template=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbf6b10) at bytecode.c:635:12
    frame #50: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x00000001018497a5), syms_left=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbf6b08) at eval.c:2917:10
    frame #51: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x00000001018497a5), nargs=1, arg_vector=0x00007ffeefbf6b08) at eval.c:2998:11
    frame #52: 0x00000001002f7b6f emacs`Ffuncall(nargs=2, 
args=0x00007ffeefbf6b00) at eval.c:2797:11
    frame #53: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x00000001013162d4), vector=(i = 0x0000000101858975), maxdepth=(i = 
0x000000000000003a), args_template=(i = 0x0000000000000c0e), nargs=3, 
args=0x00007ffeefbf7b78) at bytecode.c:635:12
    frame #54: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x0000000101858a3d), syms_left=(i = 0x0000000000000c0e), nargs=3, 
args=0x00007ffeefbf7b60) at eval.c:2917:10
    frame #55: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x0000000101858a3d), nargs=3, arg_vector=0x00007ffeefbf7b60) at eval.c:2998:11
    frame #56: 0x00000001002f7b6f emacs`Ffuncall(nargs=4, 
args=0x00007ffeefbf7b58) at eval.c:2797:11
    frame #57: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x0000000101316394), vector=(i = 0x0000000101858ae5), maxdepth=(i = 
0x000000000000003a), args_template=(i = 0x0000000000000c0a), nargs=3, 
args=0x00007ffeefbf8b98) at bytecode.c:635:12
    frame #58: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x0000000101858bdd), syms_left=(i = 0x0000000000000c0a), nargs=3, 
args=0x00007ffeefbf8b80) at eval.c:2917:10
    frame #59: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x0000000101858bdd), nargs=3, arg_vector=0x00007ffeefbf8b80) at eval.c:2998:11
    frame #60: 0x00000001002f7b6f emacs`Ffuncall(nargs=4, 
args=0x00007ffeefbf8b78) at eval.c:2797:11
    frame #61: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x0000000101316b94), vector=(i = 0x000000010185b875), maxdepth=(i = 
0x000000000000002a), args_template=(i = 0x0000000000000402), nargs=1, 
args=0x00007ffeefbf9b40) at bytecode.c:635:12
    frame #62: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x000000010185b8d5), syms_left=(i = 0x0000000000000402), nargs=1, 
args=0x00007ffeefbf9b38) at eval.c:2917:10
    frame #63: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x000000010185b8d5), nargs=1, arg_vector=0x00007ffeefbf9b38) at eval.c:2998:11
    frame #64: 0x00000001002f7b6f emacs`Ffuncall(nargs=2, 
args=0x00007ffeefbf9b30) at eval.c:2797:11
    frame #65: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x00000001013172f4), vector=(i = 0x000000010185d4f5), maxdepth=(i = 
0x000000000000001a), args_template=(i = 0x0000000000000402), nargs=1, 
args=0x00007ffeefbfa9b8) at bytecode.c:635:12
    frame #66: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x000000010185d55d), syms_left=(i = 0x0000000000000402), nargs=1, 
args=0x00007ffeefbfa9b0) at eval.c:2917:10
    frame #67: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x000000010185d55d), nargs=1, arg_vector=0x00007ffeefbfa9b0) at eval.c:2998:11
    frame #68: 0x00000001002f3fd2 emacs`apply_lambda(fun=(i = 
0x000000010185d55d), args=(i = 0x000000010189e123), count=12) at eval.c:2942:9
    frame #69: 0x00000001002ea26d emacs`eval_sub(form=(i = 0x000000010189e0b3)) 
at eval.c:2319:12
    frame #70: 0x00000001002f265b emacs`Feval(form=(i = 0x000000010189e0b3), 
lexical=(i = 0x0000000000000030)) at eval.c:2103:28
    frame #71: 0x00000001002f94a6 emacs`funcall_subr(subr=0x0000000100527c48, 
numargs=2, args=0x00007ffeefbfb0d8) at eval.c:2870:19
    frame #72: 0x00000001002f7b1d emacs`Ffuncall(nargs=3, 
args=0x00007ffeefbfb0d0) at eval.c:2795:11
    frame #73: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x00000001040676cc), vector=(i = 0x0000000104066275), maxdepth=(i = 
0x0000000000000066), args_template=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbfc4e8) at bytecode.c:635:12
    frame #74: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x0000000104066245), syms_left=(i = 0x0000000000000406), nargs=1, 
args=0x00007ffeefbfc4e0) at eval.c:2917:10
    frame #75: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x0000000104066245), nargs=1, arg_vector=0x00007ffeefbfc4e0) at eval.c:2998:11
    frame #76: 0x00000001002f7b6f emacs`Ffuncall(nargs=2, 
args=0x00007ffeefbfc4d8) at eval.c:2797:11
    frame #77: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x000000010406b424), vector=(i = 0x000000010406791d), maxdepth=(i = 
0x000000000000003a), args_template=(i = 0x0000000000000002), nargs=0, 
args=0x00007ffeefbfdb18) at bytecode.c:635:12
    frame #78: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x00000001040678ed), syms_left=(i = 0x0000000000000002), nargs=0, 
args=0x00007ffeefbfdb18) at eval.c:2917:10
    frame #79: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x00000001040678ed), nargs=0, arg_vector=0x00007ffeefbfdb18) at eval.c:2998:11
    frame #80: 0x00000001002f7b6f emacs`Ffuncall(nargs=1, 
args=0x00007ffeefbfdb10) at eval.c:2797:11
    frame #81: 0x000000010037f7ef emacs`exec_byte_code(bytestr=(i = 
0x000000010406c0ec), vector=(i = 0x000000010406b5f5), maxdepth=(i = 
0x0000000000000032), args_template=(i = 0x0000000000000002), nargs=0, 
args=0x00007ffeefbfeb90) at bytecode.c:635:12
    frame #82: 0x00000001002fe8e1 emacs`fetch_and_exec_byte_code(fun=(i = 
0x000000010406b5c5), syms_left=(i = 0x0000000000000002), nargs=0, 
args=0x00007ffeefbfeb90) at eval.c:2917:10
    frame #83: 0x00000001002f9a8b emacs`funcall_lambda(fun=(i = 
0x000000010406b5c5), nargs=0, arg_vector=0x00007ffeefbfeb90) at eval.c:2998:11
    frame #84: 0x00000001002f3fd2 emacs`apply_lambda(fun=(i = 
0x000000010406b5c5), args=(i = 0x0000000000000000), count=4) at eval.c:2942:9
    frame #85: 0x00000001002ea26d emacs`eval_sub(form=(i = 0x000000010421c09b)) 
at eval.c:2319:12
    frame #86: 0x00000001002f265b emacs`Feval(form=(i = 0x000000010421c09b), 
lexical=(i = 0x0000000000000000)) at eval.c:2103:28
    frame #87: 0x00000001001d8c0a emacs`top_level_2 at keyboard.c:1100:10
    frame #88: 0x00000001002f095f 
emacs`internal_condition_case(bfun=(emacs`top_level_2 at keyboard.c:1099), 
handlers=(i = 0x0000000000000090), hfun=(emacs`cmd_error at keyboard.c:919)) at 
eval.c:1356:25
    frame #89: 0x00000001001d8831 emacs`top_level_1(ignore=(i = 
0x0000000000000000)) at keyboard.c:1108:5
    frame #90: 0x00000001002efd4a emacs`internal_catch(tag=(i = 
0x000000000000c900), func=(emacs`top_level_1 at keyboard.c:1105), arg=(i = 
0x0000000000000000)) at eval.c:1117:25
    frame #91: 0x00000001001b5083 emacs`command_loop at keyboard.c:1069:2
    frame #92: 0x00000001001b4ea4 emacs`recursive_edit_1 at keyboard.c:714:9
    frame #93: 0x00000001001b5326 emacs`Frecursive_edit at keyboard.c:786:3
    frame #94: 0x00000001001b1f35 emacs`main(argc=14, argv=0x00007ffeefbff570) 
at emacs.c:2043:3
    frame #95: 0x00007fff6f927cc9 libdyld.dylib`start + 1

This runs into the following codepath:

frame #5: 0x0000000100292071 emacs`string_bytes(s=0x0000000101330300) at 
alloc.c:1702:5
   1699 
   1700   if (!PURE_P (s) && !pdumper_object_p (s) && s->u.s.data
   1701       && nbytes != SDATA_NBYTES (SDATA_OF_STRING (s)))
-> 1702     emacs_abort ();
   1703   return nbytes;
   1704 }
   1705 

Here we have:

(lldb) p *((sdata*)( s->u.s.data - 16))
(sdata) $11 = {
  string = 0x0000000101330300
  n = {
    string = 0x0000000101330300
    nbytes = 1
  }
}
(lldb) p *$11.string
(Lisp_String) $12 = {
  u = {
    s = {
      size = 1
      size_byte = 3
      intervals = 0x0000000000000000
      data = 0x0000000102060ce0 "✓"
    }
    next = 0x0000000000000001
    gcaligned = '\x01'
  }
}

That is, the string "✓" has 3 bytes and 1 character, yet sdata.n.nbytes
is 1 instead of 3, triggering the assertion failure.  I have no idea
where this comes from, though.


In GNU Emacs 28.0.50 (build 67, x86_64-apple-darwin19.5.0, NS appkit-1894.50 
Version 10.15.5 (Build 19F101))
 of 2020-07-25
Repository revision: 3b44829823f43d3736b8ec9db2258eeff7f6c16a
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.5

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --with-modules --without-xml2 --without-pop --with-mailutils
 --enable-gcc-warnings=warn-only --enable-checking=all
 --enable-check-lisp-object-type 'CFLAGS=-ggdb3 -O0''

Configured features:
JPEG TIFF GIF PNG NOTIFY KQUEUE ACL GNUTLS ZLIB TOOLKIT_SCROLL_BARS NS
MODULES THREADS JSON PDUMPER LCMS2

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  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
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc dired dired-loaddefs rfc822
mml easymenu mml-sec epa 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 phst skeleton derived edmacro
kmacro pcase ffap thingatpt url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars mailcap subr-x rx gnutls puny seq
byte-opt gv bytecomp byte-compile cconv dbus xml compile comint
ansi-color ring cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win 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 loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 69735 5242)
 (symbols 48 8650 1)
 (strings 32 23544 2000)
 (string-bytes 1 768650)
 (vectors 16 14146)
 (vector-slots 8 172529 5513)
 (floats 8 26 29)
 (intervals 56 206 0)
 (buffers 992 10))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]