emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS make-thread


From: Gerd Möllmann
Subject: Re: MPS make-thread
Date: Sun, 23 Jun 2024 06:54:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> 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

Looks like I get something different, with this config:

  #define EMACS_CONFIG_OPTIONS "--enable-checking=all,igc_debug 
--with-native-compilation=no
   --with-mps=debug CC=clang 'CFLAGS=-g -O0'"

I would say always use --with-mps=debug when reproducing something, and
maybe also CLAGS="-g -O0". If that's possible, of course.

    frame #0: 0x000000010046b758 
emacs`mps_lib_assert_fail(file="/Users/gerd/emacs/github/mps/code/thxc.c", 
line=53, condition="SigCheck Thread: thread") at mpsliban.c:87:3
    frame #1: 0x00000001004ca014 emacs`ThreadCheck(thread=0x0000000108007fc8) 
at thxc.c:53:3

I think it checks above if the thread is of type Thread? No idea at the
moment how it can't be at that point. Maybe the mps_thr_t has been
destroyed by us? Have to think a bit how to approach this.

    frame #2: 0x00000001004cb38c emacs`ThreadScan(ss=0x000000016fdf9378, 
thread=0x0000000108007fc8, stackCold=0x0000000170a66fb0, 
scan_area=(emacs`scan_ambig at igc.c:1082), closure=0x0000000000000000) at 
thxc.c:236:3
    frame #3: 0x00000001004cad04 emacs`RootScan(ss=0x000000016fdf9378, 
root=0x0000000108042eb0) at root.c:568:11
    frame #4: 0x000000010054f6cc emacs`traceScanRootRes(ts=1, rank=0, 
arena=0x0000000100ea4000, root=0x0000000108042eb0) at trace.c:528:9
    frame #5: 0x000000010054f5c8 emacs`traceScanRoot(ts=1, rank=0, 
arena=0x0000000100ea4000, root=0x0000000108042eb0) at trace.c:545:9
    frame #6: 0x000000010054f558 emacs`rootFlip(root=0x0000000108042eb0, 
p=0x000000016fdf9578) at trace.c:580:11
    frame #7: 0x00000001004c5dfc emacs`RootsIterate(arena=0x0000000100ea4008, 
f=(emacs`rootFlip at trace.c:567), p=0x000000016fdf9578) at root.c:665:11
    frame #8: 0x00000001004c6544 emacs`traceFlip(trace=0x0000000100ea4b50) at 
trace.c:652:11
    frame #9: 0x00000001004c5750 emacs`TraceStart(trace=0x0000000100ea4b50, 
mortality=0.78513529903807, finishingTime=39377294) at trace.c:1694:10
    frame #10: 0x00000001004a801c 
emacs`PolicyStartTrace(traceReturn=0x000000016fdf9760, 
collectWorldReturn=0x000000016fdf9804, arena=0x0000000100ea4000, 
collectWorldAllowed=1) at policy.c:335:13
    frame #11: 0x00000001004a7258 
emacs`TracePoll(workReturn=0x000000016fdf97f0, 
collectWorldReturn=0x000000016fdf9804, globals=0x0000000100ea4008, 
collectWorldAllowed=1) at trace.c:1840:10
    frame #12: 0x0000000100474284 emacs`ArenaPoll(globals=0x0000000100ea4008) 
at global.c:745:16
    frame #13: 0x0000000100476fb8 emacs`mps_ap_fill(p_o=0x000000016fdf9980, 
mps_ap=0x00000001080016c8, size=24) at mpsi.c:1097:5
    frame #14: 0x000000010039faac emacs`alloc_impl(size=24, type=IGC_OBJ_CONS, 
ap=0x00000001080016c8) at igc.c:3221:23
    frame #15: 0x000000010039a744 emacs`alloc(size=16, type=IGC_OBJ_CONS) at 
igc.c:3239:10
    frame #16: 0x000000010039a6d4 emacs`igc_make_cons(car=(struct Lisp_Symbol 
*) $8 = 0x0000000100ca51f0, cdr=(struct Lisp_Cons *) $9 = 0x000000015e2affe8) 
at igc.c:3266:28
    frame #17: 0x000000010026c8c8 emacs`Fcons(car=(struct Lisp_Symbol *) $10 = 
0x0000000100ca51f0, cdr=(struct Lisp_Cons *) $11 = 0x000000015e2affe8) at 
alloc.c:2951:10
    frame #18: 0x000000010026cdc8 emacs`Fmake_list(length=(EMACS_INT) $12 = 
1000, init=(struct Lisp_Symbol *) $13 = 0x0000000100ca51f0) at alloc.c:3094:13
    frame #19: 0x00000001002b065c emacs`eval_sub(form=(struct Lisp_Cons *) $14 
= 0x000000010b011930) at eval.c:2661:15
  * frame #20: 0x00000001002b3a50 emacs`Flet(args=(struct Lisp_Cons *) $15 = 
0x000000010b007b70) at eval.c:1131:18
    frame #21: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $16 
= 0x000000010b007278) at eval.c:2609:8
    frame #22: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $17 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #23: 0x00000001002ba124 emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $18 = 0x000000010b004878, nargs=1, arg_vector=(struct Lisp_Symbol *) $19 = 
0x0000000270a9f290) at eval.c:3417:15
    frame #24: 0x00000001002b81cc emacs`apply_lambda(fun=(struct Lisp_Vector *) 
$20 = 0x000000010b004878, args=(struct Lisp_Cons *) $21 = 0x000000010b013a78, 
count=(bytes = 960)) at eval.c:3282:9
    frame #25: 0x00000001002b07cc emacs`eval_sub(form=(struct Lisp_Cons *) $22 
= 0x000000010b013500) at eval.c:2705:12
    frame #26: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Cons *) $23 = 
0x000000010b013518) at eval.c:448:13
    frame #27: 0x00000001002ba124 emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $24 = 0x000000015e2aef70, nargs=0, arg_vector=(struct Lisp_Symbol *) $25 = 
0x0000000270a9f758) at eval.c:3417:15
    frame #28: 0x00000001002b9330 emacs`funcall_general(fun=(struct Lisp_Vector 
*) $26 = 0x000000015e2aef70, numargs=0, args=(struct Lisp_Symbol *) $27 = 
0x0000000270a9f758) at eval.c:3111:12
    frame #29: 0x00000001002b1c68 emacs`Ffuncall(nargs=1, args=(struct 
Lisp_Symbol *) $28 = 0x0000000270a9f750) at eval.c:3160:21
    frame #30: 0x00000001002b04f0 emacs`eval_sub(form=(struct Lisp_Cons *) $29 
= 0x000000010b03b078) at eval.c:2630:10
    frame #31: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $30 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #32: 0x00000001002b3c4c emacs`Flet(args=(struct Lisp_Cons *) $31 = 
0x000000010b03af40) at eval.c:1160:9
    frame #33: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $32 
= 0x000000010b03aeb0) at eval.c:2609:8
    frame #34: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Cons *) $33 = 
0x000000010b03aec8) at eval.c:448:13
    frame #35: 0x00000001002b0df4 emacs`prog_ignore(body=(struct Lisp_Cons *) 
$34 = 0x000000010b03ae20) at eval.c:459:3
    frame #36: 0x00000001002b3dd4 emacs`Fwhile(args=(struct Lisp_Cons *) $35 = 
0x000000010b03ad78) at eval.c:1181:7
    frame #37: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $36 
= 0x000000010b03ac80) at eval.c:2609:8
    frame #38: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $37 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #39: 0x00000001002b3c4c emacs`Flet(args=(struct Lisp_Cons *) $38 = 
0x000000010b03aa88) at eval.c:1160:9
    frame #40: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $39 
= 0x000000010b03a9b0) at eval.c:2609:8
    frame #41: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $40 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #42: 0x00000001002ba124 emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $41 = 0x0000000104fb6360, nargs=0, arg_vector=(struct Lisp_Symbol *) $42 = 
0x0000000270aa0380) at eval.c:3417:15
    frame #43: 0x00000001002b81cc emacs`apply_lambda(fun=(struct Lisp_Vector *) 
$43 = 0x0000000104fb6360, args=(struct Lisp_Symbol *) $44 = 0x0000000100ca51f0, 
count=(bytes = 672)) at eval.c:3282:9
    frame #44: 0x00000001002b07cc emacs`eval_sub(form=(struct Lisp_Cons *) $45 
= 0x0000000104fb4bf0) at eval.c:2705:12
    frame #45: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $46 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #46: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $47 
= 0x0000000104fb5668) at eval.c:2609:8
    frame #47: 0x00000001002b0cdc emacs`Fprogn(body=(struct Lisp_Symbol *) $48 
= 0x0000000100ca51f0) at eval.c:448:13
    frame #48: 0x00000001002b0300 emacs`eval_sub(form=(struct Lisp_Cons *) $49 
= 0x0000000104fb6290) at eval.c:2609:8
    frame #49: 0x00000001002b7a9c emacs`Feval(form=(struct Lisp_Cons *) $50 = 
0x0000000104fb6290, lexical=(struct Lisp_Symbol *) $51 = 0x0000000100ca5220) at 
eval.c:2517:28
    frame #50: 0x00000001002b96ac emacs`funcall_subr(subr=0x0000000100c11d28, 
numargs=2, args=(struct Lisp_Symbol *) $52 = 0x0000000248d9d3e8) at 
eval.c:3230:15
    frame #51: 0x000000010032f9c0 emacs`exec_byte_code(fun=(struct Lisp_Vector 
*) $53 = 0x000000010ef1cdb0, args_template=513, nargs=2, args=(struct 
Lisp_Symbol *) $54 = 0x0000000248d9d8a0) at bytecode.c:827:14
!gud 827:14:/Users/gerd/emacs/github/tinker/src/bytecode.c
    frame #52: 0x00000001002b9b5c emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $55 = 0x0000000104fb3d88, nargs=0, arg_vector=(struct Lisp_Symbol *) $56 = 
0x0000000270aa1510) at eval.c:3319:9
    frame #53: 0x00000001002b9330 emacs`funcall_general(fun=(struct Lisp_Vector 
*) $57 = 0x0000000104fb3d88, numargs=0, args=(struct Lisp_Symbol *) $58 = 
0x0000000270aa1510) at eval.c:3111:12
    frame #54: 0x00000001002b1c68 emacs`Ffuncall(nargs=1, args=(struct 
Lisp_Symbol *) $59 = 0x0000000270aa1508) at eval.c:3160:21
    frame #55: 0x00000001002b55a4 emacs`call0(fn=(struct Lisp_Vector *) $60 = 
0x0000000104fb3d88) at lisp.h:3557:10
    frame #56: 0x00000001002b5544 emacs`Fhandler_bind_1(nargs=3, args=(struct 
Lisp_Symbol *) $61 = 0x0000000248d9d328) at eval.c:1529:21
    frame #57: 0x00000001002b989c emacs`funcall_subr(subr=0x0000000100c11c10, 
numargs=3, args=(struct Lisp_Symbol *) $62 = 0x0000000248d9d328) at 
eval.c:3251:9
    frame #58: 0x000000010032f9c0 emacs`exec_byte_code(fun=(struct Lisp_Vector 
*) $63 = 0x000000010fb20980, args_template=128, nargs=1, args=(struct 
Lisp_Symbol *) $64 = 0x0000000248d9d368) at bytecode.c:827:14
    frame #59: 0x00000001002b9b5c emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $65 = 0x0000000111d41a50, nargs=1, arg_vector=(struct Lisp_Symbol *) $66 = 
0x0000000270aa21a0) at eval.c:3319:9
    frame #60: 0x00000001002b9330 emacs`funcall_general(fun=(struct Lisp_Vector 
*) $67 = 0x0000000111d41a50, numargs=1, args=(struct Lisp_Symbol *) $68 = 
0x0000000270aa21a0) at eval.c:3111:12
!gud 3111:12:/Users/gerd/emacs/github/tinker/src/eval.c
    frame #61: 0x00000001002b1c68 emacs`Ffuncall(nargs=2, args=(struct 
Lisp_Symbol *) $69 = 0x0000000270aa2198) at eval.c:3160:21
    frame #62: 0x00000001002aa654 emacs`Ffuncall_interactively(nargs=2, 
args=(struct Lisp_Symbol *) $70 = 0x0000000270aa2198) at callint.c:250:32
    frame #63: 0x00000001002b989c emacs`funcall_subr(subr=0x0000000100c11510, 
numargs=2, args=(struct Lisp_Symbol *) $71 = 0x0000000270aa2198) at 
eval.c:3251:9
    frame #64: 0x00000001002b92e8 emacs`funcall_general(fun=(struct Lisp_Subr 
*) $72 = 0x0000000100c11510, numargs=2, args=(struct Lisp_Symbol *) $73 = 
0x0000000270aa2198) at eval.c:3107:12
    frame #65: 0x00000001002b1c68 emacs`Ffuncall(nargs=3, args=(struct 
Lisp_Symbol *) $74 = 0x0000000270aa2190) at eval.c:3160:21
    frame #66: 0x00000001002acc84 emacs`Fcall_interactively(function=(struct 
Lisp_Symbol *) $75 = 0x0000000110a83a70, record_flag=(struct Lisp_Symbol *) $76 
= 0x0000000100ca51f0, keys=(struct Lisp_Vector *) $77 = 0x0000000104dd1af0) at 
callint.c:789:21
    frame #67: 0x00000001002b96d8 emacs`funcall_subr(subr=0x0000000100c114d8, 
numargs=3, args=(struct Lisp_Symbol *) $78 = 0x0000000248d9d258) at 
eval.c:3232:15
    frame #68: 0x000000010032f9c0 emacs`exec_byte_code(fun=(struct Lisp_Vector 
*) $79 = 0x000000010e814708, args_template=1025, nargs=1, args=(struct 
Lisp_Symbol *) $80 = 0x0000000270aa36b8) at bytecode.c:827:14
    frame #69: 0x00000001002b9b5c emacs`funcall_lambda(fun=(struct Lisp_Vector 
*) $81 = 0x000000010e814708, nargs=1, arg_vector=(struct Lisp_Symbol *) $82 = 
0x0000000270aa36b0) at eval.c:3319:9
    frame #70: 0x00000001002b9330 emacs`funcall_general(fun=(struct Lisp_Vector 
*) $83 = 0x000000010e814708, numargs=1, args=(struct Lisp_Symbol *) $84 = 
0x0000000270aa36b0) at eval.c:3111:12
    frame #71: 0x00000001002b1c68 emacs`Ffuncall(nargs=2, args=(struct 
Lisp_Symbol *) $85 = 0x0000000270aa36a8) at eval.c:3160:21
    frame #72: 0x00000001001a7830 emacs`command_loop_1 at keyboard.c:1551:13
    frame #73: 0x00000001002b5644 
emacs`internal_condition_case(bfun=(emacs`command_loop_1 at keyboard.c:1325), 
handlers=(struct Lisp_Symbol *) $86 = 0x0000000100ca5280, hfun=(emacs`cmd_error 
at keyboard.c:971)) at eval.c:1664:25
    frame #74: 0x00000001001a6dc0 emacs`command_loop_2(handlers=(struct 
Lisp_Symbol *) $87 = 0x0000000100ca5280) at keyboard.c:1169:11
    frame #75: 0x00000001002b47ac emacs`internal_catch(tag=(struct Lisp_Symbol 
*) $88 = 0x0000000100cb6d10, func=(emacs`command_loop_2 at keyboard.c:1165), 
arg=(struct Lisp_Symbol *) $89 = 0x0000000100ca5280) at eval.c:1343:25
    frame #76: 0x00000001001a5e08 emacs`command_loop at keyboard.c:1147:2
    frame #77: 0x00000001001a5bf4 emacs`recursive_edit_1 at keyboard.c:755:9
    frame #78: 0x00000001001a6168 emacs`Frecursive_edit at keyboard.c:838:3
    frame #79: 0x00000001001a29d8 emacs`main(argc=1, argv=0x000000016fdfeda8) 
at emacs.c:2651:3



reply via email to

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