[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS make-thread
From: |
Eli Zaretskii |
Subject: |
Re: MPS make-thread |
Date: |
Sat, 22 Jun 2024 22:17:03 +0300 |
> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: Helmut Eller <eller.helmut@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
> emacs-devel@gnu.org
> Date: Sat, 22 Jun 2024 18:52:25 +0000
>
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> >> thix.c:67: Emacs fatal error: assertion failed: SigCheck Thread: thread
> >> Fatal error 6: Aborted
> >
> > Any chance to make this reproducible? Maybe by adding calls to
> > (igc--collect) in various places? I don't know what you are doing...
>
> (progn
> (defvar *baz* nil)
> (defun bar (len)
> (let ((data (make-list len nil)))
> (setq *baz* (lambda () (bar len) data))))
> (defun foo ()
> (bar 1000)
> (dotimes (_ 10000)
> (funcall *baz*)))
> (thread-join (make-thread (lambda () (igc--collect))))
> (foo))
I get a crash only after running this several times. It looks like
this:
ss.c:66: Emacs fatal error: assertion failed: warmest < stackCold
lockw3.c:98: Emacs fatal error: assertion failed: lock->claims == 0
Thread 11 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 9512.0x10a08]
0x774996c3 in KERNELBASE!DebugBreak () from C:\WINDOWS\SysWOW64\KernelBase.dll
(gdb) thread apply all bt
Thread 11 (Thread 9512.0x10a08):
#0 0x774996c3 in KERNELBASE!DebugBreak () from
C:\WINDOWS\SysWOW64\KernelBase.dll
#1 0x002e457c in emacs_abort () at w32fns.c:11279
#2 0x00194ca0 in terminate_due_to_signal (sig=sig@entry=22,
backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:481
#3 0x002c2ebc in igc_assert_fail (file=0x7b304d <__mon_yday+4429>
"lockw3.c", line=98, msg=0x7b9a5c <__mon_yday+31580> "lock->claims == 0") at
igc.c:181
#4 0x0039c18d in mps_lib_assert_fail (condition=0x7b9a5c <__mon_yday+31580>
"lock->claims == 0", line=98, file=0x7b304d <__mon_yday+4429> "lockw3.c") at
mpsliban.c:87
#5 LockClaim (lock=0xa5560c8) at lockw3.c:98
#6 0x0039c2e5 in ArenaEnterLock (arena=arena@entry=0x7100000,
recursive=recursive@entry=0) at global.c:576
#7 0x003c9cdd in ArenaEnter (arena=0x7100000) at global.c:553
#8 mps_ap_fill (p_o=p_o@entry=0x1fc5f838, mps_ap=mps_ap@entry=0xa605bc4,
size=size@entry=24) at mpsi.c:1094
#9 0x002c2036 in alloc_impl (size=24, size@entry=16,
type=type@entry=IGC_OBJ_STRING, ap=0xa605bc4) at igc.c:3218
#10 0x002c48f3 in alloc (type=IGC_OBJ_STRING, size=16) at igc.c:3236
#11 igc_make_string (nchars=nchars@entry=3, nbytes=nbytes@entry=3,
unibyte=unibyte@entry=false, clear=clear@entry=false) at igc.c:3344
#12 0x002c496d in igc_make_multibyte_string (nchars=nchars@entry=3,
nbytes=nbytes@entry=3, clear=clear@entry=false) at igc.c:3354
#13 0x00209f39 in make_clear_multibyte_string (clearit=false, nbytes=3,
nchars=3) at alloc.c:2635
#14 make_clear_string (length=length@entry=3, clearit=clearit@entry=false) at
alloc.c:2612
#15 0x00209f97 in make_clear_string (clearit=<optimized out>,
length=<optimized out>) at alloc.c:2621
#16 make_uninit_string (length=3) at alloc.c:2623
#17 make_uninit_string (length=3) at alloc.c:2621
#18 make_unibyte_string (contents=contents@entry=0x82f3a0 <root_dir> "d:/",
length=length@entry=3) at alloc.c:2538
#19 0x0020a058 in make_string (contents=contents@entry=0x82f3a0 <root_dir>
"d:/", nbytes=3) at alloc.c:2526
#20 0x001d9f2b in build_string (str=0x82f3a0 <root_dir> "d:/") at lisp.h:4687
#21 Fexpand_file_name (name=0x14800eb4,
default_directory=default_directory@entry=0x0) at fileio.c:1070
#22 0x001e1316 in Fdo_auto_save (no_message=<optimized out>,
no_message@entry=0x18, current_only=current_only@entry=0x0) at lisp.h:1191
#23 0x00194ada in shut_down_emacs (sig=sig@entry=22, stuff=stuff@entry=0x0)
at lisp.h:1191
#24 0x00194d06 in terminate_due_to_signal (sig=sig@entry=22,
backtrace_limit=backtrace_limit@entry=2147483647) at lisp.h:1191
#25 0x002c2ebc in igc_assert_fail (file=0x7b8b1f <__mon_yday+27679> "ss.c",
line=66, msg=0x7b8b3d <__mon_yday+27709> "warmest < stackCold") at igc.c:181
#26 0x0039571d in mps_lib_assert_fail (condition=0x7b8b3d <__mon_yday+27709>
"warmest < stackCold", line=66, file=0x7b8b1f <__mon_yday+27679> "ss.c") at
mpsliban.c:87
#27 StackScan (ss=0x1fc5fb70, stackCold=0x1edeff28, scan_area=0x2c11f9
<scan_ambig>, closure=0x0) at ss.c:66
#28 0x003c7494 in RootScan (ss=ss@entry=0x1fc5fb70,
root=root@entry=0xa60e83c) at root.c:577
#29 0x003c7d1d in traceScanRootRes (ts=ts@entry=1, rank=rank@entry=0,
arena=arena@entry=0x7100000, root=root@entry=0xa60e83c) at trace.c:528
#30 0x003c8118 in traceScanRoot (root=0xa60e83c, arena=0x7100000, rank=0,
ts=1) at trace.c:545
#31 rootFlip (p=<synthetic pointer>, root=0xa60e83c) at trace.c:580
#32 RootsIterate (p=<synthetic pointer>, f=<optimized out>, arena=0x7100008)
at root.c:665
#33 traceFlip (trace=0x7100498) at trace.c:652
#34 TraceStart (trace=0x7100498, mortality=0.78544231075332438,
finishingTime=189006713) at trace.c:1694
#35 0x003c89ab in TraceStartCollectAll
(traceReturn=traceReturn@entry=0x1fc5fca8, arena=arena@entry=0x7100000,
why=why@entry=4) at trace.c:1794
#36 0x003c9788 in ArenaStartCollect (globals=globals@entry=0x7100008,
why=why@entry=4) at traceanc.c:634
#37 0x003c97e4 in ArenaCollect (globals=globals@entry=0x7100008,
why=why@entry=4) at traceanc.c:652
#38 0x003c9886 in mps_arena_collect (arena=0x7100000) at mpsi.c:313
#39 0x002c4582 in igc_collect () at igc.c:3150
#40 0x002c4599 in Figc__collect () at igc.c:3159
#41 0x00239c8a in eval_sub (form=0xe58609b) at eval.c:2613
#42 0x00239fa3 in Fprogn (body=0x0) at eval.c:448
We must do something about these assertions: when there's an assertion
violation caused by a thread which was started by MPS, we cannot call
shut_down_emacs in that thread's context, for obvious reasons. We
must instead set some flag which will cause the main thread or one of
the other Lisp threads call shut_down_emacs. The MPS documentation
says:
Warning: The installed assertion handler must not call any
function in MPS, and it must not access memory managed by the
MPS.
But our handler, igc_assert_fail, does exactly what they say not to
do.
And what does "warmest < stackCold" mean, in human-understandable
terms, anyway?
- Re: MPS: profiler, (continued)
- Re: MPS: profiler, Ihor Radchenko, 2024/06/21
- MPS make-thread (was: MPS: profiler), Helmut Eller, 2024/06/21
- Re: MPS make-thread, Gerd Möllmann, 2024/06/21
- Re: MPS make-thread, Gerd Möllmann, 2024/06/21
- Re: MPS make-thread, Helmut Eller, 2024/06/21
- Re: MPS make-thread, Gerd Möllmann, 2024/06/21
- Re: MPS make-thread, Gerd Möllmann, 2024/06/21
- Re: MPS make-thread, Ihor Radchenko, 2024/06/21
- Re: MPS make-thread, Gerd Möllmann, 2024/06/21
- Re: MPS make-thread, Ihor Radchenko, 2024/06/22
- Re: MPS make-thread,
Eli Zaretskii <=
- Re: MPS make-thread, Gerd Möllmann, 2024/06/22
- Re: MPS make-thread, Gerd Möllmann, 2024/06/23
- Re: MPS make-thread, Eli Zaretskii, 2024/06/23
- Re: MPS make-thread, Eli Zaretskii, 2024/06/23
- Re: MPS make-thread, Gerd Möllmann, 2024/06/23
- Re: MPS make-thread, Eli Zaretskii, 2024/06/23
- Re: MPS make-thread, Gerd Möllmann, 2024/06/23
- Re: MPS make-thread, Gerd Möllmann, 2024/06/23
- Re: MPS make-thread, Gerd Möllmann, 2024/06/23
- Re: MPS make-thread, Eli Zaretskii, 2024/06/23