Subject: 29.0.50; sqlite crashes on error

From: Andrew Hyatt <[email-masked]>
Date: Fri, 28 Oct 2022 20:47:05 -0400

From emacs -Q, execute the following:

(defun will-fail ()
  (let ((db (sqlite-open (make-temp-file "will-fail"))))
    (sqlite-execute db "SELECT foo FROM bar;")))

(will-fail)

Some combination of sqlite and getting errors that result in backtraces
seems to result in a problem.

Relevant information from the crash report:
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x1aab6ed98 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x1aaba3ee0 pthread_kill + 288
2   libsystem_c.dylib             	       0x1aaade3cc __abort + 128
3   libsystem_c.dylib             	       0x1aaacfd48 __stack_chk_fail + 96
4   Emacs                         	       0x102dcdbd8 print_object + 5920
5   Emacs                         	       0x102dc9d50 Fprin1 + 112 (print.c:775)
6   Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
7   Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
8   Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
9   Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
10  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
11  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
12  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
13  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
14  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
15  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
16  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
17  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
18  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
19  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
20  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
21  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
22  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
23  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
24  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
25  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
26  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
27  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
28  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
29  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
30  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
31  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
32  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
33  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
34  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
35  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
36  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
37  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
38  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
39  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
40  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
41  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
42  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
43  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
44  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
45  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
46  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
47  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
48  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
49  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
50  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
51  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
52  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
53  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
54  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
55  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
56  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
57  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
58  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
59  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
60  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
61  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
62  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
63  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
64  cl-print-79bf9fb1-c759fffb.eln	       0x16d40e14c F636c2d7072696e31_cl_prin1_0 + 460
65  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
66  backtrace-f58a28c5-349af640.eln	       0x2901c86a0 F6261636b74726163652d2d7072696e74_backtrace__print_0 + 268
67  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
68  cl-print-79bf9fb1-c759fffb.eln	       0x16d40e780 F636c2d7072696e742d746f2d737472696e672d776974682d6c696d6974_cl_print_to_string_with_limit_0 + 1216
69  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
70  backtrace-f58a28c5-349af640.eln	       0x2901c7594 F6261636b74726163652d2d7072696e742d746f2d737472696e67_backtrace__print_to_string_0 + 196
71  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
72  backtrace-f58a28c5-349af640.eln	       0x2901c8230 F6261636b74726163652d2d7072696e742d66756e632d616e642d61726773_backtrace__print_func_and_args_0 + 1820
73  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
74  backtrace-f58a28c5-349af640.eln	       0x2901c7800 F6261636b74726163652d7072696e742d6672616d65_backtrace_print_frame_0 + 240
75  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
76  backtrace-f58a28c5-349af640.eln	       0x2901c721c F6261636b74726163652d7072696e74_backtrace_print_0 + 476
77  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
78  debug-bee52b4d-57b75adc.eln   	       0x2901a6354 F64656275676765722d73657475702d627566666572_debugger_setup_buffer_0 + 596
79  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
80  debug-bee52b4d-57b75adc.eln   	       0x2901a5738 F6465627567_debug_0 + 1736
81  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
82  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
83  ert-786c6677-22d9cf08.eln     	       0x2f8710554 F6572742d2d72756e2d746573742d6465627567676572_ert__run_test_debugger_0 + 992
84  Emacs                         	       0x102df0220 exec_byte_code + 3256 (bytecode.c:809)
85  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
86  Emacs                         	       0x102da8af4 Fapply + 708 (eval.c:2685)
87  Emacs                         	       0x102da2dbc apply1 + 20 (eval.c:2901) [inlined]
88  Emacs                         	       0x102da2dbc call_debugger + 456 (eval.c:338)
89  Emacs                         	       0x102da7810 maybe_call_debugger + 404 (eval.c:2040) [inlined]
90  Emacs                         	       0x102da7810 signal_or_quit + 1380 (eval.c:1811)
91  Emacs                         	       0x102e914c8 Fsignal + 36 (eval.c:1706)
92  Emacs                         	       0x102e914e8 xsignal + 12 (lisp.h:4552)
93  Emacs                         	       0x102e912c0 xsignal1 + 28
94  Emacs                         	       0x102e2db6c Fsqlite_execute + 416 (sqlite.c:435)
95  Emacs                         	       0x102da3c94 eval_sub + 2088 (eval.c:2523)
96  Emacs                         	       0x102daa130 Fprogn + 28 (eval.c:459) [inlined]
97  Emacs                         	       0x102daa130 funcall_lambda + 1428 (eval.c:3253)
98  Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
99  Emacs                         	       0x102db5514 call1 + 16 (lisp.h:3240) [inlined]
100 Emacs                         	       0x102db5514 mapcar1 + 352 (fns.c:2867)
101 Emacs                         	       0x102db5830 Fmapc + 92 (fns.c:2982)
102 Emacs                         	       0x102da3c80 eval_sub + 2068 (eval.c:2520)
103 Emacs                         	       0x102da5950 Fprogn + 28 (eval.c:459) [inlined]
104 Emacs                         	       0x102da5950 Flet + 1124 (eval.c:1049)
105 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
106 Emacs                         	       0x102da3fd8 Fprogn + 28 (eval.c:459) [inlined]
107 Emacs                         	       0x102da3fd8 Fcond + 108 (eval.c:439)
108 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
109 Emacs                         	       0x102da5270 Fprogn + 28 (eval.c:459) [inlined]
110 Emacs                         	       0x102da5270 FletX + 112 (eval.c:981)
111 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
112 Emacs                         	       0x102daa130 Fprogn + 28 (eval.c:459) [inlined]
113 Emacs                         	       0x102daa130 funcall_lambda + 1428 (eval.c:3253)
114 Emacs                         	       0x102da8770 apply_lambda + 368 (eval.c:3123)
115 Emacs                         	       0x102da394c eval_sub + 1248
116 Emacs                         	       0x102daa130 Fprogn + 28 (eval.c:459) [inlined]
117 Emacs                         	       0x102daa130 funcall_lambda + 1428 (eval.c:3253)
118 Emacs                         	       0x102da8770 apply_lambda + 368 (eval.c:3123)
119 Emacs                         	       0x102da394c eval_sub + 1248
120 Emacs                         	       0x102da5950 Fprogn + 28 (eval.c:459) [inlined]
121 Emacs                         	       0x102da5950 Flet + 1124 (eval.c:1049)
122 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
123 Emacs                         	       0x102da3f50 Fprogn + 48 (eval.c:459)
124 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
125 Emacs                         	       0x102da6794 Funwind_protect + 260 (eval.c:1324)
126 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
127 Emacs                         	       0x102da5950 Fprogn + 28 (eval.c:459) [inlined]
128 Emacs                         	       0x102da5950 Flet + 1124 (eval.c:1049)
129 Emacs                         	       0x102da3bb4 eval_sub + 1864 (eval.c:2470)
130 Emacs                         	       0x102daa130 Fprogn + 28 (eval.c:459) [inlined]
131 Emacs                         	       0x102daa130 funcall_lambda + 1428 (eval.c:3253)
132 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
133 ert-786c6677-22d9cf08.eln     	       0x2f8711430 F6572742d2d72756e2d746573742d696e7465726e616c_ert__run_test_internal_0 + 1072
134 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
135 ert-786c6677-22d9cf08.eln     	       0x2f871203c F6572742d72756e2d74657374_ert_run_test_0 + 924
136 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
137 ert-786c6677-22d9cf08.eln     	       0x2f8719528 F6572742d72756e2d6f722d726572756e2d74657374_ert_run_or_rerun_test_0 + 472
138 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
139 ert-786c6677-22d9cf08.eln     	       0x2f87268e0 F6572742d726573756c74732d726572756e2d746573742d61742d706f696e74_ert_results_rerun_test_at_point_0 + 624
140 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
141 ert-786c6677-22d9cf08.eln     	       0x2f8726c0c F6572742d726573756c74732d726572756e2d746573742d61742d706f696e742d646562756767696e672d6572726f7273_ert_results_rerun_test_at_point_debugging_errors_0 + 72
142 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
143 Emacs                         	       0x102da110c Ffuncall_interactively + 68 (callint.c:248)
144 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
145 Emacs                         	       0x102da2620 Fcall_interactively + 5372 (callint.c:340)
146 simple-fab5b0cf-ef411e81.eln  	       0x1070ffd04 F636f6d6d616e642d65786563757465_command_execute_0 + 804
147 Emacs                         	       0x102da5ef0 Ffuncall + 340 (eval.c:3014)
148 Emacs                         	       0x102d18f50 call1 + 20 (lisp.h:3240) [inlined]
149 Emacs                         	       0x102d18f50 command_loop_1 + 1380 (keyboard.c:1505)
150 Emacs                         	       0x102da6d8c internal_condition_case + 96 (eval.c:1497)
151 Emacs                         	       0x102d189d8 command_loop_2 + 52 (keyboard.c:1132)
152 Emacs                         	       0x102da6668 internal_catch + 88 (eval.c:1220)
153 Emacs                         	       0x102e8f370 recursive_edit_1.cold.1 + 80 (keyboard.c:1110)
154 Emacs                         	       0x102d18214 command_loop + 4 (keyboard.c:1107) [inlined]
155 Emacs                         	       0x102d18214 recursive_edit_1 + 372 (keyboard.c:719)
156 Emacs                         	       0x102d183a4 Frecursive_edit + 364 (keyboard.c:802)
157 Emacs                         	       0x102d176bc main + 9504 (emacs.c:2517)
158 dyld                          	       0x10382508c start + 520

In GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.6.0, NS
appkit-2113.60 Version 12.6 (Build 21G115)) of 2022-10-27 built on
andrews-mbp.lan
Repository revision: 41d3d71a1e6709a7357c1c7aeae4f49cd65fb602
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.6

Configured using:
'configure --with-native-compilation'

Configured features:
ACL GLIB GNUTLS JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS
PDUMPER PNG RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS WEBP XIM ZLIB

Important settings:
  value of $LANG: en_US.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
  show-paren-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
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util 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 thingatpt
cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv
cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode 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 lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads kqueue cocoa ns lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 76683 8826)
(symbols 48 7038 0)
(strings 32 19326 3490)
(string-bytes 1 619213)
(vectors 16 16738)
(vector-slots 8 333256 10135)
(floats 8 28 47)
(intervals 56 236 0)
(buffers 1000 12))