emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS make-thread


From: Ihor Radchenko
Subject: Re: MPS make-thread
Date: Fri, 21 Jun 2024 19:58:54 +0000

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

>>> I think current_thread and all_threads also need to be roots.
>>
>> Ok, thanks.
>>>
>>>>  Unless someone(tm) is quicker, of course.
>>>
>>> I'll delay looking at threads until native compilation works :-)
>>
>> I thought native comp works for you?
>
> Pushed, please check.

Now, there is no crash when I run my code that creates threads, but
there is a crash soon after :(

thix.c:67: Emacs fatal error: assertion failed: SigCheck Thread: thread
Fatal error 6: Aborted

lockix.c:126: Emacs fatal error: assertion failed: res == 0

Thread 1 "emacs" received signal SIGABRT, Aborted.
0x00007ffff58ae9fb in pthread_kill () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff58ae9fb in pthread_kill () at /lib64/libc.so.6
#1  0x00007ffff58553d2 in raise () at /lib64/libc.so.6
#2  0x00005555556bba66 in terminate_due_to_signal (sig=sig@entry=6, 
backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:481
#3  0x00005555557b2ec9 in igc_assert_fail (file=<optimized out>, 
line=<optimized out>, msg=<optimized out>) at igc.c:158
#4  0x000055555582fe29 in mps_lib_assert_fail (condition=0x55555588ff52 "res == 
0", line=126, file=0x55555588ff3c "lockix.c")
    at /home/yantar92/Dist/mps/code/mpsliban.c:87
#5  LockClaim (lock=0x7fffe8000110) at /home/yantar92/Dist/mps/code/lockix.c:126
#6  0x000055555583005d in ArenaEnterLock (arena=0x7ffff7fc2000, recursive=0) at 
/home/yantar92/Dist/mps/code/global.c:576
#7  0x000055555585e09c in ArenaEnter (arena=0x7ffff7fc2000) at 
/home/yantar92/Dist/mps/code/global.c:553
#8  mps_ap_fill (p_o=p_o@entry=0x7fffffffa490, 
mps_ap=mps_ap@entry=0x7fffe8001770, size=size@entry=24) at 
/home/yantar92/Dist/mps/code/mpsi.c:1094
#9  0x00005555557b444c in alloc_impl (size=24, type=IGC_OBJ_CONS, 
ap=0x7fffe8001770) at igc.c:3159
#10 0x00005555557b454a in alloc (size=size@entry=16, 
type=type@entry=IGC_OBJ_CONS) at igc.c:3177
#11 0x00005555557b5f24 in igc_make_cons (car=car@entry=0x2, cdr=cdr@entry=0x0) 
at igc.c:3204
#12 0x000055555571f922 in Fcons (cdr=0x0, car=0x2) at alloc.c:2926
#13 list2 (arg1=arg1@entry=0x7f20, arg2=arg2@entry=0x2) at alloc.c:2978
#14 0x000055555578913c in Fdelete_process (process=0x7fffae000ffd) at 
process.c:1124
#15 0x00005555557916b0 in kill_buffer_processes (buffer=buffer@entry=0x0) at 
process.c:8289
#16 0x00005555556bb797 in shut_down_emacs (sig=sig@entry=6, 
stuff=stuff@entry=0x0) at emacs.c:3140
#17 0x00005555556bba2f in terminate_due_to_signal (sig=sig@entry=6, 
backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:464
#18 0x00005555557b2ec9 in igc_assert_fail (file=<optimized out>, 
line=<optimized out>, msg=<optimized out>) at igc.c:158
#19 0x000055555584d2ae in mps_lib_assert_fail (condition=0x55555588c9ee 
"SigCheck Thread: thread", line=67, file=0x55555588ca06 "thix.c")
    at /home/yantar92/Dist/mps/code/mpsliban.c:87
#20 ThreadCheck (thread=0x7fff98184c40) at 
/home/yantar92/Dist/mps/code/thix.c:67
#21 ThreadCheck (thread=0x7fff98184c40) at 
/home/yantar92/Dist/mps/code/thix.c:65
#22 ThreadScan (ss=0x7fffffffb6f0, thread=0x7fff98184c40, 
stackCold=0x7fffdabffbb0, scan_area=0x5555557b24fc <scan_ambig>, closure=0x0)
    at /home/yantar92/Dist/mps/code/thix.c:259
#23 0x00005555558595a8 in RootScan (ss=ss@entry=0x7fffffffb6f0, 
root=root@entry=0x7fff98184cb8) at /home/yantar92/Dist/mps/code/root.c:568
#24 0x0000555555859e75 in traceScanRootRes (ts=ts@entry=1, rank=rank@entry=0, 
arena=arena@entry=0x7ffff7fc2000, root=root@entry=0x7fff98184cb8)
    at /home/yantar92/Dist/mps/code/trace.c:528
#25 0x000055555585a591 in traceScanRoot (root=0x7fff98184cb8, 
arena=0x7ffff7fc2000, rank=0, ts=<optimized out>) at 
/home/yantar92/Dist/mps/code/trace.c:545
#26 rootFlip (p=<synthetic pointer>, root=0x7fff98184cb8) at 
/home/yantar92/Dist/mps/code/trace.c:580
#27 RootsIterate (p=<synthetic pointer>, f=<optimized out>, 
arena=0x7ffff7fc2008) at /home/yantar92/Dist/mps/code/root.c:665
#28 traceFlip (trace=0x7ffff7fc2aa8) at /home/yantar92/Dist/mps/code/trace.c:652
#29 TraceStart (trace=trace@entry=0x7ffff7fc2aa8, mortality=<optimized out>, 
finishingTime=<optimized out>) at /home/yantar92/Dist/mps/code/trace.c:1694
#30 0x000055555585b2cf in PolicyStartTrace
    (traceReturn=traceReturn@entry=0x7fffffffb8b0, 
collectWorldReturn=collectWorldReturn@entry=0x7fffffffb90c, 
arena=arena@entry=0x7ffff7fc2000, 
collectWorldAllowed=collectWorldAllowed@entry=1) at 
/home/yantar92/Dist/mps/code/policy.c:335
#31 0x000055555585db52 in TracePoll
    (workReturn=workReturn@entry=0x7fffffffb910, 
collectWorldReturn=collectWorldReturn@entry=0x7fffffffb90c, 
globals=globals@entry=0x7ffff7fc2008, collectWorldAllowed=1) at 
/home/yantar92/Dist/mps/code/trace.c:1840
#32 0x000055555585dcfb in ArenaPoll (globals=globals@entry=0x7ffff7fc2008) at 
/home/yantar92/Dist/mps/code/global.c:745
--Type <RET> for more, q to quit, c to continue without paging--c
#33 0x000055555585e0ea in mps_ap_fill (p_o=p_o@entry=0x7fffffffba80, 
mps_ap=mps_ap@entry=0x7fffe8001770, size=size@entry=48)
    at /home/yantar92/Dist/mps/code/mpsi.c:1097
#34 0x00005555557b444c in alloc_impl (size=48, type=IGC_OBJ_VECTOR, 
ap=0x7fffe8001770) at igc.c:3159
#35 0x00005555557b454a in alloc (size=size@entry=40, 
type=type@entry=IGC_OBJ_VECTOR) at igc.c:3177
#36 0x00005555557b6126 in igc_alloc_pseudovector
    (nwords_mem=nwords_mem@entry=4, nwords_lisp=nwords_lisp@entry=0, 
nwords_zero=nwords_zero@entry=0, tag=tag@entry=PVEC_MARKER) at igc.c:3325
#37 0x000055555572040d in allocate_pseudovector (tag=PVEC_MARKER, zerolen=0, 
lisplen=0, memlen=4) at alloc.c:3786
#38 build_marker (buf=0x7fff9ca44c88, charpos=12320533, bytepos=13012048) at 
alloc.c:4179
#39 0x00005555557307f0 in Fpoint_marker () at editfns.c:202
#40 0x000055555573a8bd in save_excursion_save (pdl=0x555556cecc50) at 
editfns.c:782
#41 0x000055555573ed3d in record_unwind_protect_excursion () at eval.c:3678
#42 0x0000555555781ef4 in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7fffaea538ed, args_template=<optimized out>, 
    args_template@entry=257, nargs=<optimized out>, nargs@entry=1, 
args=<optimized out>, args@entry=0x7fffffffbd18) at bytecode.c:942
#43 0x0000555555742c4a in funcall_lambda (fun=0x7fffaea538ed, 
nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffbd18) at eval.c:3270
#44 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffffffbd18) at eval.c:3062
#45 0x000055555573f3f0 in Ffuncall (nargs=nargs@entry=2, 
args=args@entry=0x7fffffffbd10) at eval.c:3111
#46 0x000055555574a824 in mapcar1 (leni=leni@entry=13, 
vals=vals@entry=0x7fffffffbd70, fn=fn@entry=0x7fffaea538ed, 
seq=seq@entry=0x7fffa6242f8b)
    at fns.c:3349
#47 0x000055555574d463 in Fmapcar (function=0x7fffaea538ed, 
sequence=0x7fffa6242f8b) at fns.c:3469
#48 0x0000555555741198 in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=2, args=args@entry=0x7fffe2200400) at eval.c:3181
#49 0x0000555555781aac in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7fffae9cdc5d, args_template=<optimized out>, 
    args_template@entry=256, nargs=<optimized out>, nargs@entry=0, 
args=<optimized out>, args@entry=0x7fffffffbfb0)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#50 0x0000555555742c4a in funcall_lambda (fun=fun@entry=0x7fffae9cdc5d, 
nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7fffffffbfb0) at eval.c:3270
#51 0x00005555557438ef in apply_lambda (fun=fun@entry=0x7fffae9cdc5d, 
args=<optimized out>, count=count@entry=...) at eval.c:3233
#52 0x00005555557425fe in eval_sub (form=<optimized out>) at eval.c:2663
#53 0x00005555557422a1 in eval_sub (form=<optimized out>) at eval.c:2604
#54 0x0000555555742b00 in Fprogn (body=<optimized out>) at eval.c:448
#55 0x00005555557433c3 in Fif (args=<optimized out>) at eval.c:404
#56 0x0000555555742326 in eval_sub (form=<optimized out>) at eval.c:2567
#57 0x0000555555742b00 in Fprogn (body=<optimized out>) at eval.c:448
#58 0x0000555555742326 in eval_sub (form=<optimized out>) at eval.c:2567
#59 0x00005555557433b0 in Fif (args=0x7fffab5e4c43) at eval.c:403
#60 0x0000555555742326 in eval_sub (form=<optimized out>) at eval.c:2567
#61 0x0000555555742b00 in Fprogn (body=<optimized out>) at eval.c:448
#62 0x0000555555742ee2 in funcall_lambda (fun=<optimized out>, 
nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7fffffffc5a0) at eval.c:3368
#63 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=0, args=args@entry=0x7fffffffc5a0) at eval.c:3062
#64 0x000055555573f3f0 in Ffuncall (nargs=1, args=0x7fffffffc598) at eval.c:3111
#65 0x000055555573f927 in funcall_nil (nargs=<optimized out>, args=<optimized 
out>) at eval.c:2794
#66 0x000055555573e4aa in run_hook_with_args (nargs=nargs@entry=1, 
args=args@entry=0x7fffffffc598, funcall=funcall@entry=0x55555573f91e 
<funcall_nil>)
    at eval.c:2971
#67 0x000055555573e5fe in Frun_hook_with_args (nargs=nargs@entry=1, 
args=args@entry=0x7fffffffc598) at eval.c:2836
#68 0x000055555573e61b in run_hook (hook=<optimized out>) at eval.c:2984
#69 0x000055555573e63d in Frun_hooks (nargs=1, args=0x7fffe2200388) at 
eval.c:2818
#70 0x0000555555741273 in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffe2200388) at eval.c:3202
#71 0x0000555555781aac in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7fffa2e46ed5, args_template=<optimized out>, 
    args_template@entry=0, nargs=<optimized out>, nargs@entry=0, 
args=<optimized out>, args@entry=0x7fffffffc7d8)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#72 0x0000555555742c4a in funcall_lambda (fun=0x7fffa2e46ed5, 
nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7fffffffc7d8) at eval.c:3270
#73 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=0, args=args@entry=0x7fffffffc7d8) at eval.c:3062
#74 0x000055555573f3f0 in Ffuncall (nargs=1, args=0x7fffffffc7d0) at eval.c:3111
#75 0x0000555555742407 in eval_sub (form=<optimized out>) at eval.c:2588
#76 0x0000555555742b00 in Fprogn (body=<optimized out>) at eval.c:448
#77 0x0000555555743d3c in Flet (args=0x7fffa2e46ff3) at 
/home/yantar92/Git/emacs/src/lisp.h:1554
#78 0x0000555555742326 in eval_sub (form=form@entry=0x7fffa2e4900b) at 
eval.c:2567
#79 0x000055555574466b in Feval (form=0x7fffa2e4900b, lexical=<optimized out>) 
at eval.c:2475
#80 0x0000555555741198 in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffe22001a8) at eval.c:3181
#81 0x0000555555781aac in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7fffeb002f55, args_template=<optimized out>, 
    args_template@entry=768, nargs=<optimized out>, nargs@entry=1, 
args=<optimized out>, args@entry=0x7fffe2200108)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#82 0x0000555555742c4a in funcall_lambda (fun=0x7fffeb002f55, 
nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffe2200108) at eval.c:3270
#83 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffe2200108) at eval.c:3062
#84 0x000055555573f3f0 in Ffuncall (nargs=nargs@entry=2, 
args=args@entry=0x7fffe2200100) at eval.c:3111
#85 0x000055555573f72b in Fapply (nargs=2, args=0x7fffe2200100) at eval.c:2740
#86 0x0000555555741273 in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=2, args=args@entry=0x7fffe2200100) at eval.c:3202
#87 0x0000555555781aac in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7fff97c5ab2d, args_template=<optimized out>, 
    args_template@entry=128, nargs=<optimized out>, nargs@entry=1, 
args=<optimized out>, args@entry=0x7fffffffcf90)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#88 0x0000555555742c4a in funcall_lambda (fun=0x7fff97c5ab2d, 
nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffcf90) at eval.c:3270
#89 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffffffcf90) at eval.c:3062
#90 0x000055555573f3f0 in Ffuncall (nargs=nargs@entry=2, 
args=args@entry=0x7fffffffcf88) at eval.c:3111
#91 0x000055555573b559 in Ffuncall_interactively (nargs=2, args=0x7fffffffcf88) 
at callint.c:250
#92 0x0000555555741273 in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=2, args=args@entry=0x7fffffffcf88) at eval.c:3202
#93 0x0000555555743166 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=2, args=args@entry=0x7fffffffcf88)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#94 0x000055555573f3f0 in Ffuncall (nargs=nargs@entry=3, 
args=args@entry=0x7fffffffcf80) at eval.c:3111
#95 0x000055555573ce6e in Fcall_interactively (function=<optimized out>, 
record_flag=<optimized out>, keys=<optimized out>) at callint.c:789
#96 0x00005555557411af in funcall_subr (subr=<optimized out>, 
numargs=numargs@entry=3, args=args@entry=0x7fffe2200070) at eval.c:3183
#97 0x0000555555781aac in exec_byte_code (fun=<optimized out>, 
fun@entry=0x7ffff2be9cfd, args_template=<optimized out>, 
    args_template@entry=1025, nargs=<optimized out>, nargs@entry=1, 
args=<optimized out>, args@entry=0x7fffffffd398)
    at /home/yantar92/Git/emacs/src/lisp.h:2267
#98 0x0000555555742c4a in funcall_lambda (fun=0x7ffff2be9cfd, 
nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffd398) at eval.c:3270
#99 0x0000555555743175 in funcall_general (fun=<optimized out>, 
numargs=numargs@entry=1, args=args@entry=0x7fffffffd398) at eval.c:3062
#100 0x000055555573f3f0 in Ffuncall (nargs=nargs@entry=2, 
args=args@entry=0x7fffffffd390) at eval.c:3111
#101 0x00005555556d2d74 in command_loop_1 () at keyboard.c:1551
#102 0x000055555573dddf in internal_condition_case
    (bfun=bfun@entry=0x5555556d1960 <command_loop_1>, 
handlers=handlers@entry=0x90, hfun=hfun@entry=0x5555556c3232 <cmd_error>) at 
eval.c:1622
#103 0x00005555556be5fb in command_loop_2 (handlers=handlers@entry=0x90) at 
keyboard.c:1169
#104 0x000055555573dd1d in internal_catch (tag=tag@entry=0x12300, 
func=func@entry=0x5555556be5d8 <command_loop_2>, arg=arg@entry=0x90) at 
eval.c:1301
#105 0x00005555556be5b5 in command_loop () at keyboard.c:1147
#106 0x00005555556c2e0e in recursive_edit_1 () at keyboard.c:755
#107 0x00005555556c3158 in Frecursive_edit () at keyboard.c:838
#108 0x00005555556bd8ff in main (argc=1, argv=<optimized out>) at emacs.c:2643
(gdb) c
Continuing.
Couldn't get registers: No such process.
(gdb) [Thread 0x7fffda2006c0 (LWP 27886) exited]
[Thread 0x7fffdbe006c0 (LWP 27884) exited]
[Thread 0x7fffe16006c0 (LWP 27882) exited]
[Thread 0x7fffe20006c0 (LWP 27881) exited]
[Thread 0x7ffff5249a40 (LWP 27874) exited]
[Thread 0x7fffe0c006c0 (LWP 27883) exited]
[New process 27874]

Program terminated with signal SIGABRT, Aborted.
The program no longer exists.

The program is not being run.
(gdb) 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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