Subject: bug#75632: closed (Re: bug#75632: 31.0.50; igc: Crash report)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 17 Jan 2025 15:27:03 +0000

Your bug report

#75632: 31.0.50; igc: Crash report

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75632: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75632
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#75632: 31.0.50; igc: Crash report
From: Pip Cet <[email-masked]>
To: Ihor Radchenko <[email-masked]>
Cc: Gerd Möllmann <[email-masked]>, [email-masked]
Date: Fri, 17 Jan 2025 15:26:10 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

"Ihor Radchenko" <[email-masked]> writes:

> Pip Cet <[email-masked]> writes:
>
>> "Ihor Radchenko" <[email-masked]> writes:
>>
>>> Just got the following:
>>
>> Yes, that's the signal handling bug.  I'm not entirely sure why we
>> removed the fix that was in scratch/igc, but we did, so we need another
>> one.
>> ...
>> to handle_user_signal, which will silently ignore SIGUSR* received while
>> MPS may have locked the arena.
>
> I indeed sent SIGUSR2 just before I saw the crash.

It'd be nice if that simply worked.  I think debugging with SIGUSR* is
important, so I've pushed a fix (and I'm closing this bug; if further
discussion is needed, feel free to revert and reopen).

> For some context (maybe irrelevant), Emacs hung while performing magit
> commit (C-c C-c in magit commit buffer; and the commit was actually
> written before the hang). It only ever happened for me on igc branch.

Thanks!  Too bad we lost that backtrace, then.  If it happens again,
please let us know!

(I'm using magit, and I know it waits for subprocesses, so I'll go over
the SIGCHLD handling code to ensure we never drop one of them).

Pip

Subject: 31.0.50; igc: Crash report
From: Ihor Radchenko <[email-masked]>
To: [email-masked]
Date: Fri, 17 Jan 2025 14:36:36 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Just got the following:

lockix.c:126: Emacs fatal error: assertion failed: res == 0
[Switching to Thread 0x7ffff2b71e00 (LWP 11068)]

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:432
432	{
(gdb) bt
#0  terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:432
#1  0x00005555557e24fb in set_state (state=IGC_STATE_DEAD) at igc.c:975
#2  igc_assert_fail (file=<optimized out>, line=<optimized out>, msg=<optimized out>) at igc.c:276
#3  0x000055555585f049 in mps_lib_assert_fail (condition=0x5555558c0763 "res == 0", line=126, file=0x5555558c074d "lockix.c") at /home/yantar92/Dist/mps/code/mpsliban.c:87
#4  LockClaim (lock=0x7fffe8000110) at /home/yantar92/Dist/mps/code/lockix.c:126
#5  0x000055555585f27d in ArenaEnterLock (arena=0x7ffff7fbe000, recursive=0) at /home/yantar92/Dist/mps/code/global.c:576
#6  0x000055555588812e in ArenaEnter (arena=0x7ffff7fbe000) at /home/yantar92/Dist/mps/code/global.c:553
#7  ArenaAccess (addr=0x7fff9d8709e0, mode=mode@entry=3, context=context@entry=0x7fffffff4650) at /home/yantar92/Dist/mps/code/global.c:655
#8  0x0000555555893432 in sigHandle (sig=<optimized out>, info=0x7fffffff4970, uap=0x7fffffff4840) at /home/yantar92/Dist/mps/code/protsgix.c:97
#9  0x00007ffff2c41100 in <signal handler called> () at /lib64/libc.so.6
#10 0x00005555556d2273 in SDATA (string=<optimized out>) at /home/yantar92/Git/emacs/src/lisp.h:1758
#11 SSDATA (string=<optimized out>) at /home/yantar92/Git/emacs/src/lisp.h:1764
#12 handle_user_signal (sig=sig@entry=12) at keyboard.c:8315
#13 0x00005555556f1678 in deliver_process_signal (sig=12, handler=handler@entry=0x5555556d2210 <handle_user_signal>) at sysdep.c:1757
#14 0x00005555556d1134 in deliver_user_signal (sig=<optimized out>) at keyboard.c:8352
#15 0x00007ffff2c41100 in <signal handler called> () at /lib64/libc.so.6
#16 0x00007ffff2d189ab in mprotect () at /lib64/libc.so.6
#17 0x000055555588183d in ProtSet (base=0x7ffe4c324000, limit=<optimized out>, mode=0) at /home/yantar92/Dist/mps/code/protix.c:105
#18 0x000055555588b9dc in traceScanSegRes (ts=ts@entry=1, rank=rank@entry=1, arena=arena@entry=0x7ffff7fbe000, seg=seg@entry=0x7ffe4803e5f8) at /home/yantar92/Dist/mps/code/trace.c:1204
#19 0x000055555588bbfa in traceScanSeg (ts=1, rank=1, arena=0x7ffff7fbe000, seg=0x7ffe4803e5f8) at /home/yantar92/Dist/mps/code/trace.c:1267
#20 0x000055555588c5d4 in TraceAdvance (trace=trace@entry=0x7ffff7fbeaa8) at /home/yantar92/Dist/mps/code/trace.c:1728
#21 0x000055555588ccd4 in TracePoll
    (workReturn=workReturn@entry=0x7fffffff58d0, collectWorldReturn=collectWorldReturn@entry=0x7fffffff58cc, globals=globals@entry=0x7ffff7fbe008, collectWorldAllowed=<optimized out>)
    at /home/yantar92/Dist/mps/code/trace.c:1849
#22 0x000055555588cf1b in ArenaPoll (globals=globals@entry=0x7ffff7fbe008) at /home/yantar92/Dist/mps/code/global.c:745
#23 0x000055555588d30a in mps_ap_fill (p_o=p_o@entry=0x7fffffff5a40, mps_ap=mps_ap@entry=0x7fffe8001980, size=size@entry=24) at /home/yantar92/Dist/mps/code/mpsi.c:1097
#24 0x00005555557ddf28 in alloc_impl (size=24, type=IGC_OBJ_CONS, ap=0x7fffe8001980) at igc.c:3956
#25 0x00005555557de04c in alloc (size=size@entry=24, type=type@entry=IGC_OBJ_CONS) at igc.c:3984
#26 0x00005555557e0964 in igc_make_cons (car=car@entry=XIL(0x7ffefc1c18a5), cdr=XIL(0x7ffdf8565feb)) at igc.c:4013
#27 0x0000555555734ee8 in Fcons (car=car@entry=XIL(0x7ffefc1c18a5), cdr=<optimized out>) at alloc.c:2958
#28 0x0000555555752a84 in save_restriction_save () at editfns.c:3097
#29 0x00005555557a3267 in helper_save_restriction () at comp.c:5128
#30 0x00007fffdc3efc22 in F6f72672d666f6c642d636f72652d6765742d666f6c64696e672d73706563_org_fold_core_get_folding_spec_0 ()
    at /home/yantar92/.emacs.d/eln-cache/31.0.50-fc0e2b3f/org-fold-core-7b3a75f5-931c108c.eln
#31 0x0000555555758fb3 in funcall_subr (subr=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffdedff0c0) at eval.c:3178
#32 0x000055555579fdaf in exec_byte_code (fun=<optimized out>, args_template=<optimized out>, args_template@entry=257, nargs=<optimized out>, nargs@entry=1, args=<optimized out>, args@entry=0x7fffffff5e68)
    at /home/yantar92/Git/emacs/src/lisp.h:2332
#33 0x000055555575ab86 in funcall_lambda (fun=XIL(0x7fff9ebde0b5), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffff5e68) at eval.c:3267
#34 0x000055555575af3b in funcall_general (fun=<optimized out>, numargs=numargs@entry=1, args=args@entry=0x7fffffff5e68) at eval.c:3059
#35 0x0000555555757198 in Ffuncall (nargs=2, args=0x7fffffff5e60) at eval.c:3108
#36 0x00007fffdf8c6a6f in F666f6e742d6c6f636b2d666f6e746966792d6b6579776f7264732d726567696f6e_font_lock_fontify_keywords_region_0 ()
    at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/font-lock-895216f6-4021c0ad.eln
#37 0x0000555555758fca in funcall_subr (subr=<optimized out>, numargs=numargs@entry=3, args=args@entry=0x7fffffff6188) at eval.c:3180
#38 0x000055555575b08a in funcall_general (fun=<optimized out>, numargs=numargs@entry=3, args=args@entry=0x7fffffff6188) at /home/yantar92/Git/emacs/src/lisp.h:2332
#39 0x0000555555757198 in Ffuncall (nargs=4, args=0x7fffffff6180) at eval.c:3108
#40 0x00007fffdf8c2740 in F666f6e742d6c6f636b2d64656661756c742d666f6e746966792d726567696f6e_font_lock_default_fontify_region_0 ()
    at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/font-lock-895216f6-4021c0ad.eln
#41 0x0000555555758fca in funcall_subr (subr=<optimized out>, numargs=numargs@entry=3, args=args@entry=0x7fffffff6308) at eval.c:3180
#42 0x000055555575b08a in funcall_general (fun=<optimized out>, numargs=numargs@entry=3, args=args@entry=0x7fffffff6308) at /home/yantar92/Git/emacs/src/lisp.h:2332
#43 0x0000555555757198 in Ffuncall (nargs=4, args=0x7fffffff6300) at eval.c:3108
#44 0x00007fffdf8c1735 in F666f6e742d6c6f636b2d666f6e746966792d726567696f6e_font_lock_fontify_region_0 ()
    at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/font-lock-895216f6-4021c0ad.eln
#45 0x0000555555758fca in funcall_subr (subr=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffdedff040) at eval.c:3180
#46 0x000055555579fdaf in exec_byte_code (fun=<optimized out>, args_template=<optimized out>, args_template@entry=257, nargs=<optimized out>, nargs@entry=1, args=<optimized out>, args@entry=0x7fffffff6608)
    at /home/yantar92/Git/emacs/src/lisp.h:2332
#47 0x000055555575ab86 in funcall_lambda (fun=XIL(0x7ffdf852f91d), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffff6608) at eval.c:3267
#48 0x000055555575af3b in funcall_general (fun=<optimized out>, numargs=numargs@entry=1, args=args@entry=0x7fffffff6608) at eval.c:3059
--Type <RET> for more, q to quit, c to continue without paging--c
#49 0x0000555555757198 in Ffuncall (nargs=2, args=args@entry=0x7fffffff6600) at eval.c:3108
#50 0x000055555575777d in run_hook_wrapped_funcall (nargs=<optimized out>, args=0x7fffffff6600) at eval.c:2887
#51 0x00005555557562b9 in run_hook_with_args (nargs=2, args=0x7fffffff6600, funcall=funcall@entry=0x55555575775c <run_hook_wrapped_funcall>) at eval.c:2968
#52 0x000055555575648e in Frun_hook_wrapped (nargs=<optimized out>, args=<optimized out>) at eval.c:2902
#53 0x00007fffdf89fafa in F6a69742d6c6f636b2d2d72756e2d66756e6374696f6e73_jit_lock__run_functions_0 () at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/jit-lock-8a988e43-86e09700.eln
#54 0x0000555555758fb3 in funcall_subr (subr=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffffff67e8) at eval.c:3178
#55 0x000055555575b08a in funcall_general (fun=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffffff67e8) at /home/yantar92/Git/emacs/src/lisp.h:2332
#56 0x0000555555757198 in Ffuncall (nargs=3, args=0x7fffffff67e0) at eval.c:3108
#57 0x00007fffdf8a03aa in F6a69742d6c6f636b2d666f6e746966792d6e6f77_jit_lock_fontify_now_0 () at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/jit-lock-8a988e43-86e09700.eln
#58 0x0000555555758fb3 in funcall_subr (subr=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffffff69a8) at eval.c:3178
#59 0x000055555575b08a in funcall_general (fun=<optimized out>, numargs=numargs@entry=2, args=args@entry=0x7fffffff69a8) at /home/yantar92/Git/emacs/src/lisp.h:2332
#60 0x0000555555757198 in Ffuncall (nargs=3, args=0x7fffffff69a0) at eval.c:3108
#61 0x00007fffdf89f837 in F6a69742d6c6f636b2d66756e6374696f6e_jit_lock_function_0 () at /home/yantar92/Git/emacs/src/../native-lisp/31.0.50-fc0e2b3f/preloaded/jit-lock-8a988e43-86e09700.eln
#62 0x0000555555758fa0 in funcall_subr (subr=<optimized out>, numargs=numargs@entry=1, args=args@entry=0x7fffffff6b68) at eval.c:3176
#63 0x000055555575b08a in funcall_general (fun=<optimized out>, numargs=numargs@entry=1, args=args@entry=0x7fffffff6b68) at /home/yantar92/Git/emacs/src/lisp.h:2332
#64 0x0000555555757198 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffff6b60) at eval.c:3108
#65 0x0000555555755c66 in internal_condition_case_n
    (bfun=bfun@entry=0x55555575708c <Ffuncall>, nargs=nargs@entry=2, args=args@entry=0x7fffffff6b60, handlers=handlers@entry=XIL(0x38), hfun=hfun@entry=0x5555555d2ae3 <dsafe_eval_handler>) at eval.c:1707
#66 0x00005555555be7d5 in dsafe__call (inhibit_quit=inhibit_quit@entry=false, f=0x55555575708c <Ffuncall>, nargs=nargs@entry=2, args=args@entry=0x7fffffff6b60) at xdisp.c:3095
#67 0x00005555555be84a in dsafe_call1 (f=<optimized out>, arg=arg@entry=make_fixnum(12548850)) at xdisp.c:3125
#68 0x00005555555d1120 in handle_fontified_prop (it=<optimized out>) at xdisp.c:4644
#69 0x00005555555d4c6e in handle_stop (it=it@entry=0x7fffffff9500) at xdisp.c:4164
#70 0x00005555555e3318 in next_element_from_buffer (it=0x7fffffff9500) at xdisp.c:9752
#71 0x00005555555e1aad in get_next_display_element (it=it@entry=0x7fffffff9500) at xdisp.c:8308
#72 0x00005555555e2a70 in forward_to_next_line_start (it=0x7fffffff9500, skipped_p=skipped_p@entry=0x7fffffff770f, bidi_it_prev=bidi_it_prev@entry=0x0) at xdisp.c:7649
#73 0x00005555555e2f8a in reseat_at_next_visible_line_start (it=it@entry=0x7fffffff9500, on_newline_p=on_newline_p@entry=false) at xdisp.c:7780
#74 0x00005555555e07c4 in move_it_to (it=it@entry=0x7fffffff9500, to_charpos=5143293, to_x=to_x@entry=0, to_y=<optimized out>, to_vpos=to_vpos@entry=-1, op=op@entry=11) at xdisp.c:10964
#75 0x0000555555608676 in redisplay_window (window=XIL(0x7ffe9eccdd4d), just_this_one_p=just_this_one_p@entry=false) at xdisp.c:20258
#76 0x000055555560c4f3 in redisplay_window_0 (window=window@entry=XIL(0x7ffe9eccdd4d)) at xdisp.c:18111
#77 0x0000555555755b5e in internal_condition_case_1
    (bfun=bfun@entry=0x55555560c4c0 <redisplay_window_0>, arg=arg@entry=XIL(0x7ffe9eccdd4d), handlers=<optimized out>, hfun=hfun@entry=0x5555555c24fd <redisplay_window_error>) at eval.c:1651
#78 0x00005555555bfeee in redisplay_windows (window=XIL(0x7ffe9eccdd4d)) at xdisp.c:18080
#79 0x00005555555bfe9c in redisplay_windows (window=XIL(0x7ffdf43cbaed)) at xdisp.c:18074
#80 0x00005555555f2be4 in redisplay_internal () at xdisp.c:17497
#81 0x00005555555f3f3e in resize_echo_area_exactly () at xdisp.c:13017
#82 0x00005555556e4c46 in command_loop_1 () at keyboard.c:1584
#83 0x0000555555755ae6 in internal_condition_case (bfun=bfun@entry=0x5555556e4905 <command_loop_1>, handlers=handlers@entry=XIL(0xa8), hfun=hfun@entry=0x5555556d5870 <cmd_error>) at eval.c:1627
#84 0x00005555556d0687 in command_loop_2 (handlers=handlers@entry=XIL(0xa8)) at keyboard.c:1174
#85 0x0000555555755a21 in internal_catch (tag=tag@entry=XIL(0x153f0), func=func@entry=0x5555556d0657 <command_loop_2>, arg=arg@entry=XIL(0xa8)) at eval.c:1306
#86 0x00005555556d0634 in command_loop () at keyboard.c:1152
#87 0x00005555556d53e3 in recursive_edit_1 () at keyboard.c:760
#88 0x00005555556d578b in Frecursive_edit () at keyboard.c:843
#89 0x00005555556cf8ab in main (argc=1, argv=0x7fffffffd5d8) at emacs.c:2658

Lisp Backtrace:
"org-fold-core-get-folding-spec" (0xdedff0c0)
"org-activate-folds" (0xffff5e68)
"font-lock-fontify-keywords-region" (0xffff6188)
"font-lock-default-fontify-region" (0xffff6308)
"font-lock-fontify-region" (0xdedff040)
0xf852f918 PVEC_CLOSURE
"jit-lock--run-functions" (0xffff67e8)
"jit-lock-fontify-now" (0xffff69a8)
"jit-lock-function" (0xffff6b68)
"redisplay_internal (C function)" (0x0)
(gdb) 
(gdb) q

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.42, cairo version 1.18.2) of 2025-01-12 built on localhost
Repository revision: b82707d70fd5bb78be5766e247e9629eb6553c30
Repository branch: scratch/igc
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: Gentoo Linux

Configured using:
 'configure --with-mps=yes --with-native-compilation 'CFLAGS=-g3
 -I/opt/mps/include -L/opt/mps/lib'
 JAVAC=/etc/java-config-2/current-system-vm/bin/javac
 PKG_CONFIG_PATH=/usr/share/guile-data/3.0/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LCMS2 LIBXML2 MODULES MPS NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XINPUT2 XPM GTK3 ZLIB

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
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>