From: Gemini Lasswell <gazally@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 33014@debbugs.gnu.org
Subject: bug#33014: 26.1.50; 27.0.50; Fatal error after re-evaluating a thread's function
Date: Sat, 13 Oct 2018 10:17:10 -0700 [thread overview]
Message-ID: <87va65daw9.fsf@runbox.com> (raw)
In-Reply-To: <83y3b2uzyt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 13 Oct 2018 09:23:38 +0300")
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
> Did you try loading it as a .el file?
Yes, but I couldn't reproduce the bug.
>> The Lisp backtrace is really short:
>>
>> Thread 7 (Thread 0x7f1cd4dec700 (LWP 21837)):
>> "erb--benchmark-monitor-func" (0x158ec58)
>
> If you succeed in reproducing this when this code is loaded
> uncompiled, the backtrace might be more helpful.
The assertion happens in the Bswitch case of exec_byte_code when it's
running erb--benchmark-monitor-func, and there's only one 'switch' in
the disassembled bytecode, see line 16:
[-- Attachment #2: bytecode.txt --]
[-- Type: text/plain, Size: 4386 bytes --]
byte code for erb--benchmark-monitor-func:
doc: Process benchmark job status update. ...
args: nil
0:1 constant (error quit)
1 pushconditioncase 34
4 constant thread-queue-get
5 varref erb--status-updates
6 call 1
7 dup
8 consp
9 goto-if-nil 32
12 dup
13 car
14 dup
15 constant <jump-table-eq (clear 2 add 6 remove 14 change 22)>
16 switch
17 goto 30
20:2 stack-ref 1
21 cdr
22 dup
23 goto-if-not-nil 4
26 varref erb--logging
27 goto-if-nil 3
30 constant message
31 constant "** Clear **"
32 call 1
33 discard
34:3 constant erb--clear-status
35 call 0
36 goto 5
39:4 stack-ref 2
40 constant error
41 constant "Unrecognized status update: %s"
42 stack-ref 2
43 call 2
44 stack-set 1
46:5 stack-set 1
48 goto 31
51:6 stack-ref 1
52 cdr
53 dup
54 consp
55 goto-if-nil 12
58 dup
59 car
60 stack-ref 1
61 cdr
62 dup
63 consp
64 goto-if-nil 10
67 dup
68 car
69 stack-ref 1
70 cdr
71 dup
72 goto-if-not-nil 8
75 stack-ref 1
76 stack-ref 4
77 varref erb--logging
78 goto-if-nil 7
81 constant message
82 constant "** Add %s to %s **"
83 stack-ref 2
84 stack-ref 4
85 call 3
86 discard
87:7 stack-ref 1
88 dup
89 stack-ref 2
90 stack-ref 2
91 symbol-value
92 cons
93 set
94 stack-set 1
96 discardN-preserve-tos 2
98 goto 9
101:8 stack-ref 6
103 constant error
104 constant "Unrecognized status update: %s"
105 stack-ref 2
106 call 2
107 stack-set 1
109:9 discardN-preserve-tos 2
111 goto 11
114:10 stack-ref 4
115 constant error
116 constant "Unrecognized status update: %s"
117 stack-ref 2
118 call 2
119 stack-set 1
121:11 discardN-preserve-tos 2
123 goto 13
126:12 stack-ref 2
127 constant error
128 constant "Unrecognized status update: %s"
129 stack-ref 2
130 call 2
131 stack-set 1
133:13 stack-set 1
135 goto 31
138:14 stack-ref 1
139 cdr
140 dup
141 consp
142 goto-if-nil 20
145 dup
146 car
147 stack-ref 1
148 cdr
149 dup
150 consp
151 goto-if-nil 18
154 dup
155 car
156 stack-ref 1
157 cdr
158 dup
159 goto-if-not-nil 16
162 stack-ref 1
163 stack-ref 4
164 varref erb--logging
165 goto-if-nil 15
168 constant message
169 constant "** Remove %s from %s **"
170 stack-ref 2
171 stack-ref 4
172 call 3
173 discard
174:15 stack-ref 1
175 dup
176 constant delq
177 stack-ref 3
178 stack-ref 5
179 symbol-value
180 call 2
181 set
182 stack-set 1
184 discardN-preserve-tos 2
186 goto 17
189:16 stack-ref 6
191 constant error
192 constant "Unrecognized status update: %s"
193 stack-ref 2
194 call 2
195 stack-set 1
197:17 discardN-preserve-tos 2
199 goto 19
202:18 stack-ref 4
203 constant error
204 constant "Unrecognized status update: %s"
205 stack-ref 2
206 call 2
207 stack-set 1
209:19 discardN-preserve-tos 2
211 goto 21
214:20 stack-ref 2
215 constant error
216 constant "Unrecognized status update: %s"
217 stack-ref 2
218 call 2
219 stack-set 1
221:21 stack-set 1
223 goto 31
226:22 stack-ref 1
227 cdr
228 dup
229 consp
230 goto-if-nil 28
233 dup
234 car
235 stack-ref 1
236 cdr
237 dup
238 consp
239 goto-if-nil 26
242 dup
243 car
244 stack-ref 1
245 cdr
246 dup
247 goto-if-not-nil 24
250 stack-ref 1
251 stack-ref 4
252 varref erb--logging
253 goto-if-nil 23
256 constant message
257 constant "** Set %s to %s **"
258 stack-ref 2
259 stack-ref 4
260 call 3
261 discard
262:23 dup
263 dup
264 stack-ref 3
265 set
266 stack-set 1
268 discardN-preserve-tos 2
270 goto 25
273:24 stack-ref 6
275 constant error
276 constant "Unrecognized status update: %s"
277 stack-ref 2
278 call 2
279 stack-set 1
281:25 discardN-preserve-tos 2
283 goto 27
286:26 stack-ref 4
287 constant error
288 constant "Unrecognized status update: %s"
289 stack-ref 2
290 call 2
291 stack-set 1
293:27 discardN-preserve-tos 2
295 goto 29
298:28 stack-ref 2
299 constant error
300 constant "Unrecognized status update: %s"
301 stack-ref 2
302 call 2
303 stack-set 1
305:29 stack-set 1
307 goto 31
310:30 stack-ref 1
311 constant error
312 constant "Unrecognized status update: %s"
313 stack-ref 2
314 call 2
315 stack-set 1
317:31 stack-set 1
319 goto 33
322:32 dup
323 constant error
324 constant "Unrecognized status update: %s"
325 stack-ref 2
326 call 2
327 stack-set 1
329:33 stack-set 1
331 pophandler
332 goto 35
335:34 constant message
336 constant "Error in ERB benchmark control thread: %s"
337 stack-ref 2
338 call 2
339 stack-set 1
341:35 discard
342 goto 1
345 return
[-- Attachment #3: Type: text/plain, Size: 3123 bytes --]
>> (gdb) p jmp_table
>> $1 = make_number(514)
>> (gdb) p *top
>> $3 = XIL(0x42b4d0)
>> (gdb) pp *top
>> remove
>
> Which one of these is the one that triggers the assertion violation?
jmp_table. The assertion violation is at line 1403 in bytecode.c:
struct Lisp_Hash_Table *h = XHASH_TABLE (jmp_table);
>> Thread 1 "monitor" hit Hardware watchpoint 7: *(EMACS_INT *) 0x16eac38
>>
>> Old value = 60897760
>> New value = 24075314
>> setup_on_free_list (v=v@entry=0x16eac30 <bss_sbrk_buffer+9926032>,
>> nbytes=nbytes@entry=272) at alloc.c:3060
>> 3060 total_free_vector_slots += nbytes / word_size;
>> (gdb) bt 10
>> #0 setup_on_free_list (v=v@entry=0x16eac30 <bss_sbrk_buffer+9926032>,
>> nbytes=nbytes@entry=272) at alloc.c:3060
>> #1 0x00000000005a9a24 in sweep_vectors () at alloc.c:3297
>> #2 0x00000000005adb2e in gc_sweep () at alloc.c:6872
>> #3 garbage_collect_1 (end=<optimized out>) at alloc.c:5860
>> #4 Fgarbage_collect () at alloc.c:5989
>> #5 0x00000000005ca478 in maybe_gc () at lisp.h:4804
>> #6 Ffuncall (nargs=4, args=args@entry=0x7fff210a3bc8) at eval.c:2838
>> #7 0x0000000000611e00 in exec_byte_code (bytestr=..., vector=..., maxdepth=...,
>> args_template=..., nargs=nargs@entry=2, args=<optimized out>,
>> args@entry=0x9bd128 <pure+781288>) at bytecode.c:632
>> #8 0x00000000005cdd32 in funcall_lambda (fun=XIL(0x7fff210a3bc8),
>> nargs=nargs@entry=2, arg_vector=0x9bd128 <pure+781288>,
>> arg_vector@entry=0x7fff210a3f00) at eval.c:3057
>> #9 0x00000000005ca54b in Ffuncall (nargs=3, args=args@entry=0x7fff210a3ef8)
>> at eval.c:2870
>> (More stack frames follow...)
>
> Can you show the Lisp backtrace for the above?
(gdb) xbacktrace
"Automatic GC" (0x0)
"string-match" (0x210a3bd0)
"completion-pcm--string->pattern" (0x210a3f00)
"completion-pcm--find-all-completions" (0x210a43a0)
"completion-pcm-try-completion" (0x210a4668)
0x1723c30 PVEC_COMPILED
"completion--some" (0x210a4b60)
"completion--nth-completion" (0x210a4e68)
"completion-try-completion" (0x210a50f0)
"execute-extended-command--shorter" (0x210a5390)
"execute-extended-command" (0x210a5760)
"funcall-interactively" (0x210a5758)
"call-interactively" (0x210a5a90)
"command-execute" (0x210a5d48)
>> Am I correct that the next step is to figure out why the garbage
>> collector is not marking this vector? Presumably it's no longer
>> attached to the function definition for erb--benchmark-monitor-func by
>> the time the garbage collector runs, but it's supposed to be found by
>> mark_stack when called from mark_one_thread for Thread 7, right?
>
> Is this vector the byte-code of erb--benchmark-monitor-func? If so,
> how come it is no longer attached to the function, as long as the
> function does exist?
This vector is the constants vector for the byte-code of
erb--benchmark-monitor-func.
When eval-region evaluates the defun for erb--benchmark-monitor-func, it
replaces the symbol's function definition, so it removes that reference
to the byte-code. AFAIK the only other reference to the byte-code
is on the stack of Thread 7, which is running the byte-code.
next prev parent reply other threads:[~2018-10-13 17:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 5:30 bug#33014: 26.1.50; 27.0.50; Fatal error after re-evaluating a thread's function Gemini Lasswell
2018-10-12 8:12 ` Eli Zaretskii
2018-10-12 20:02 ` Gemini Lasswell
2018-10-13 6:23 ` Eli Zaretskii
2018-10-13 17:17 ` Gemini Lasswell [this message]
2018-10-13 18:04 ` Eli Zaretskii
2018-10-14 19:29 ` Gemini Lasswell
2018-10-15 2:37 ` Eli Zaretskii
2018-10-14 19:46 ` Andreas Schwab
2018-10-15 14:59 ` Eli Zaretskii
2018-10-15 16:22 ` Gemini Lasswell
2018-10-15 16:41 ` Eli Zaretskii
2018-10-16 18:46 ` Gemini Lasswell
2018-10-16 19:25 ` Eli Zaretskii
2018-10-16 19:38 ` Eli Zaretskii
2018-10-19 0:22 ` Gemini Lasswell
2018-10-19 8:44 ` Eli Zaretskii
2018-10-19 20:05 ` Gemini Lasswell
2018-10-20 6:41 ` Eli Zaretskii
2018-10-20 8:23 ` Andreas Schwab
2018-10-20 10:20 ` Eli Zaretskii
2018-10-20 11:30 ` Andreas Schwab
2018-10-29 18:24 ` Gemini Lasswell
2018-10-29 19:41 ` Eli Zaretskii
2018-10-19 19:32 ` Gemini Lasswell
2018-10-17 16:21 ` Eli Zaretskii
2018-10-18 1:07 ` Gemini Lasswell
2018-10-18 17:04 ` Eli Zaretskii
2018-10-19 0:39 ` Gemini Lasswell
2018-10-19 8:38 ` Eli Zaretskii
2018-10-29 18:56 ` Stefan Monnier
2018-10-31 4:49 ` Paul Eggert
2018-10-31 15:33 ` Eli Zaretskii
2018-11-01 23:15 ` Gemini Lasswell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87va65daw9.fsf@runbox.com \
--to=gazally@runbox.com \
--cc=33014@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.