From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Clemente Newsgroups: gmane.emacs.bugs Subject: bug#71289: 30.0.50; cmcheckmagic aborts when tty_write_glyphs writes "Garbage collecting..." in some cases Date: Mon, 3 Jun 2024 15:36:05 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40552"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii To: 71289@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 03 17:38:03 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sE9l4-000AL1-9H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jun 2024 17:38:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE9kv-0008Fb-JM; Mon, 03 Jun 2024 11:37:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sE9kt-0008Dv-7k for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 11:37:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sE9ks-0001KL-Lz for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 11:37:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sE9l4-0008Fv-6s for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2024 11:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Clemente Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jun 2024 15:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71289 X-GNU-PR-Package: emacs Original-Received: via spool by 71289-submit@debbugs.gnu.org id=B71289.171742907631715 (code B ref 71289); Mon, 03 Jun 2024 15:38:02 +0000 Original-Received: (at 71289) by debbugs.gnu.org; 3 Jun 2024 15:37:56 +0000 Original-Received: from localhost ([127.0.0.1]:44001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sE9kx-0008FQ-KS for submit@debbugs.gnu.org; Mon, 03 Jun 2024 11:37:56 -0400 Original-Received: from mail-vk1-f175.google.com ([209.85.221.175]:55766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sE9ku-0008Ev-QF for 71289@debbugs.gnu.org; Mon, 03 Jun 2024 11:37:53 -0400 Original-Received: by mail-vk1-f175.google.com with SMTP id 71dfb90a1353d-4eb05e29e69so1046628e0c.3 for <71289@debbugs.gnu.org>; Mon, 03 Jun 2024 08:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717428994; x=1718033794; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4Q/LMv0wiu1FXh8nByXtquv/1d9TWSdIDreDOhIgZd4=; b=XkzR4ystPfq64Wt9Iqg3caP4bv/xNEzF8qYg23N30oBYnbNqEEfdA53I/rkoB0D6EM obxB18a3/c1XCFTKAObr22ph5uz/WPepzZoiyj+AEM3a2QeWE6d6p+a5cehtvF4WW6CQ YHPNKVYs2tb5ugUJRoW4ec6hv6QxIug2dwmMw0HVEhpexFhEOQ31n9ug0jFzNWtpIoxl OGn5RWpStlJjGo6CVgsio0L98GotJhV5c4VwghminaihNnzaL9EKLsmRUV5hb5x45S2J h4b9ZfWnzSmWq5lGsuctLIaiSX3Ry7wSpxLZqouJxXJcbNntBZLbJTAjYJrswsmLw5F4 VctQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717428994; x=1718033794; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Q/LMv0wiu1FXh8nByXtquv/1d9TWSdIDreDOhIgZd4=; b=WOgUoXrdvWkbAr8hJfOM+/3+pqr3c+IE97yvwNf67wwpj6w/NBsYXiiqaoqvZnCYGK bIxalblHzZ+usshfyewTLsHuEwFvdjdffCHl2ec5+X3iIZ5cNNFVGimQfzs/pqXjfTy4 0+shYPU5hSpnN234cIMwQRKxXt0uTgcIO69oJhyvxj56r+CdKjf+lT1n1jRvW3d0P6cv iqCfq54I1g7/VdI8eM8FEwgc7HxsZEjRt9gh//eolqxuHgfxQ+5V95p5ryw4KNjcuX+G gGdbaVLXpmnyGmuavmNzwLbbcKEYTelsc82x3uygIcOk4dgkk6V/9qaqTOBKwTNfm1CY Klmg== X-Gm-Message-State: AOJu0Yw+7GnGpSnYvskGWzPPamxWIuOxHAXw5cEzyj1Q/+bWB0uj9huZ Wd6Hgj4h3Db53hxIn2BOY8DhHc1aU/ecc6fEcdcMb2+TeF1fDPuoIVpG86FcuVvmJIj6nho1KMo RiwqCbguIQYRa3zzCCXoSenRkqCfaaQ== X-Google-Smtp-Source: AGHT+IEsHX1cLgOeAuHumfLsmavPn9kuLTQrMNka4EXwkPm823OQzJGM0jCToKqPjXj5/PSJTQCU0Qa5MdogVUHOPoo= X-Received: by 2002:a05:6122:4685:b0:4ea:f3ae:6349 with SMTP id 71dfb90a1353d-4eb02dbe332mr10195426e0c.7.1717428994085; Mon, 03 Jun 2024 08:36:34 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286453 Archived-At: Many of the backtraces I'm sending (more below) point to the same issue: resizing the terminal while the GC messages are being displayed can make the asserts fail. Depending on the time I 'catch' it it shows an error or another in the backtrace. I still don't have a way to reproduce this, but the following recipe seems to improve the chances: (setq garbage-collection-messages t) Then run some operation that clearly triggers GC. For instance I'm using this formula (better ideas welcome): (setq gc-cons-threshold 100000) (cl-loop for i from 3000000 downto 1 do (+ 2.00 (+ 2.0 (+ 2.0 (+ 2.0 (+ 2.0 2.0)))))) While that operation is running (you'll repeatedly see "Garbage collecting" "=E2=80=A6 done"), resize the terminal constantly until it crashes. But sometimes I can't reproduce it at all with this method! And never could I in emacs -Q But I'm getting tired of manually testing. I may have to automate the resiz= ing. Anyway this is a very rare bug which probably only happens when GC messages are enabled, in TTY emacs, and while resizing the terminal. An obvious workaround if this affects others is disabling garbage-collection-messages, which seems buggy. Maybe the problem is in message3_nolog. Here's are two backtraces of two crashes in different points that I didn't report yet. I suspect they are all this same bug because they involve GC. dispnew.c:3155: Emacs fatal error: assertion failed: vpos >=3D 0 && vpos <=3D FRAME_TOTAL_LINES (XFRAME (w->frame)) Breakpoint 1, terminate_due_to_signal (sig=3D6, backtrace_limit=3D2147483647) at emacs.c:443 443 signal (sig, SIG_DFL); (gdb) bt #0 terminate_due_to_signal (sig=3D6, backtrace_limit=3D2147483647) at emac= s.c:443 #1 0x0000555555735c81 in die (msg=3D0x55555584e908 "vpos >=3D 0 && vpos <=3D FRAME_TOTAL_LINES (XFRAME (w->frame))", file=3D0x55555584e231 "dispnew.c", line=3D3155) at alloc.c:8082 #2 0x000055555558cc96 in window_to_frame_vpos (w=3D0x555556559190, vpos=3D26) at dispnew.c:3155 #3 0x0000555555590ea9 in update_frame_1 (f=3D0x5555560374b8, force_p=3Dtrue, inhibit_id_p=3Dtrue, set_cursor_p=3Dtrue, updating_menu_p=3Dfalse) at dispnew.c:5089 #4 0x000055555558cfad in update_frame (f=3D0x5555560374b8, force_p=3Dtrue, inhibit_hairy_id_p=3Dtrue) at dispnew.c:3346 #5 0x00005555555ca441 in echo_area_display (update_frame_p=3Dtrue) at xdisp.c:13487 #6 0x00005555555c63fb in message3_nolog (m=3DXIL(0x555557424cf4)) at xdisp.c:12385 #7 0x00005555555c97d8 in restore_message () at xdisp.c:13166 #8 0x0000555555732cd2 in garbage_collect () at alloc.c:6690 #9 0x0000555555732817 in maybe_garbage_collect () at alloc.c:6507 #10 0x0000555555769a95 in maybe_gc () at /w/emacs/src/lisp.h:5927 #11 0x000055555576f4d7 in eval_sub (form=3DXIL(0x555556d39bf3)) at eval.c:2= 502 dispnew.c:2649: Emacs fatal error: assertion failed: glyph_row_slice_p (window_row, frame_row) Breakpoint 1, terminate_due_to_signal (sig=3D6, backtrace_limit=3D2147483647) at emacs.c:443 443 signal (sig, SIG_DFL); (gdb) bt #0 terminate_due_to_signal (sig=3D6, backtrace_limit=3D2147483647) at emac= s.c:443 #1 0x0000555555735c81 in die (msg=3D0x55555584e838 "glyph_row_slice_p (window_row, frame_row)", file=3D0x55555584e231 "dispnew.c", line=3D2649) at alloc.c:8082 #2 0x000055555558b5f3 in build_frame_matrix_from_leaf_window (frame_matrix=3D0x55555607fc20, w=3D0x555556037970) at dispnew.c:2649 #3 0x000055555558b10f in build_frame_matrix_from_window_tree (matrix=3D0x55555607fc20, w=3D0x555556037970) at dispnew.c:2538 #4 0x000055555558b0a4 in build_frame_matrix (f=3D0x5555560374b8) at dispnew.c:2522 #5 0x000055555558cf68 in update_frame (f=3D0x5555560374b8, force_p=3Dtrue, inhibit_hairy_id_p=3Dtrue) at dispnew.c:3336 #6 0x00005555555ca441 in echo_area_display (update_frame_p=3Dtrue) at xdisp.c:13487 #7 0x00005555555c63fb in message3_nolog (m=3DXIL(0x555559663284)) at xdisp.c:12385 #8 0x00005555555c64a7 in message1_nolog (m=3D0x55555586f976 "Garbage collecting...") at xdisp.c:12413 #9 0x0000555555732a80 in garbage_collect () at alloc.c:6587 #10 0x0000555555732817 in maybe_garbage_collect () at alloc.c:6507 #11 0x0000555555769a95 in maybe_gc () at /w/emacs/src/lisp.h:5927 #12 0x000055555576f4d7 in eval_sub (form=3DXIL(0x555559b8e323)) at eval.c:2= 502 #13 0x000055555576a6f5 in Fprogn (body=3DXIL(0)) at eval.c:439 #14 0x000055555576a725 in prog_ignore (body=3DXIL(0x555559b8e3c3)) at eval.= c:450 #15 0x000055555576c30a in Fwhile (args=3DXIL(0x555559b8e453)) at eval.c:113= 0 #16 0x000055555576f82d in eval_sub (form=3DXIL(0x555559b8e463)) at eval.c:2= 549 #17 0x000055555576a6f5 in Fprogn (body=3DXIL(0x555559b8e393)) at eval.c:439 #18 0x000055555576beb8 in FletX (args=3DXIL(0x555559b8e4b3)) at eval.c:1042 #19 0x000055555576f82d in eval_sub (form=3DXIL(0x555559b8e4c3)) at eval.c:2= 549 #20 0x000055555576f2ad in Feval (form=3DXIL(0x555559b8e4c3), lexical=3DXIL(0)) at eval.c:2462 #21 0x0000555555771416 in funcall_subr (subr=3D0x555555ec5a80 , numargs=3D2, args=3D0x7fffffffc8c8) at eval.c:3163 #22 0x0000555555770db6 in funcall_general (fun=3DXIL(0x555555ec5a85), numargs=3D2, args=3D0x7fffffffc8c8) at eval.c:3040 #23 0x00005555557710bf in Ffuncall (nargs=3D3, args=3D0x7fffffffc8c0) at ev= al.c:3093 #24 0x00007ffff1488d94 in F656c6973702d2d6576616c2d6c6173742d73657870_elisp__eval_last_sexp_0 () from /opt/dc/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-3670981c= /preloaded/elisp-mode-90dbfe40-73c5a2ea.eln #25 0x00005555557713ef in funcall_subr (subr=3D0x7ffff1d49010, numargs=3D1, args=3D0x7ffff05ff038) at eval.c:3161 #26 0x00005555557cd7bc in exec_byte_code (fun=3DXIL(0x5555599b90fd), args_template=3D0, nargs=3D0, args=3D0x7fffffffcfd0) at bytecode.c:812 #27 0x0000555555771a68 in funcall_lambda (fun=3DXIL(0x5555599b90fd), nargs=3D0, arg_vector=3D0x7fffffffcfd0) at eval.c:3252 #28 0x0000555555770e02 in funcall_general (fun=3DXIL(0x5555599b90fd), numargs=3D0, args=3D0x7fffffffcfd0) at eval.c:3044 #29 0x00005555557710bf in Ffuncall (nargs=3D1, args=3D0x7fffffffcfc8) at ev= al.c:3093 #30 0x000055555576937e in call0 (fn=3DXIL(0x5555599b90fd)) at /w/emacs/src/lisp.h:3515 #31 0x000055555576cbe2 in Fhandler_bind_1 (nargs=3D3, args=3D0x7fffffffd050) at eval.c:1478 #32 0x00007ffff14892c4 in F6576616c2d6c6173742d73657870_eval_last_sexp_0 () from /opt/dc/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-3670981c= /preloaded/elisp-mode-90dbfe40-73c5a2ea.eln #33 0x00005555557713ef in funcall_subr (subr=3D0x7ffff1d056e0, numargs=3D1, args=3D0x7fffffffd330) at eval.c:3161 #34 0x0000555555770db6 in funcall_general (fun=3DXIL(0x7ffff1d056e5), numargs=3D1, args=3D0x7fffffffd330) at eval.c:3040 #35 0x00005555557710bf in Ffuncall (nargs=3D2, args=3D0x7fffffffd328) at ev= al.c:3093 #36 0x00005555557656ec in Ffuncall_interactively (nargs=3D2, args=3D0x7fffffffd328) at callint.c:250 #37 0x000055555577164f in funcall_subr (subr=3D0x555555ec4d00 , numargs=3D2, args=3D0x7fffffffd328) at eval.c:3184 #38 0x0000555555770db6 in funcall_general (fun=3DXIL(0x555555ec4d05), numargs=3D2, args=3D0x7fffffffd328) at eval.c:3040 #39 0x00005555557710bf in Ffuncall (nargs=3D3, args=3D0x7fffffffd320) at ev= al.c:3093 #40 0x0000555555767d88 in Fcall_interactively (function=3DXIL(0x2aaa9bdbe9b0), record_flag=3DXIL(0), keys=3DXIL(0x5555596dec2d)) at callint.c:789 #41 0x00007ffff16848fd in F636f6d6d616e642d65786563757465_command_execute_0= () from /opt/dc/emacs/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-3670981c= /preloaded/simple-fab5b0cf-651091ae.eln #42 0x0000555555771484 in funcall_subr (subr=3D0x7ffff212eff8, numargs=3D1, args=3D0x7fffffffda98) at eval.c:3167 #43 0x0000555555770db6 in funcall_general (fun=3DXIL(0x7ffff212effd), numargs=3D1, args=3D0x7fffffffda98) at eval.c:3040 #44 0x00005555557710bf in Ffuncall (nargs=3D2, args=3D0x7fffffffda90) at ev= al.c:3093 #45 0x0000555555691eb7 in command_loop_1 () at keyboard.c:1550 #46 0x000055555576d295 in internal_condition_case (bfun=3D0x55555569167e , handlers=3DXIL(0x90), hfun=3D0x555555690b29 ) at eval.c:1613 #47 0x000055555569125c in command_loop_2 (handlers=3DXIL(0x90)) at keyboard= .c:1168 #48 0x000055555576c6c2 in internal_catch (tag=3DXIL(0xfc60), func=3D0x555555691232 , arg=3DXIL(0x90)) at eval.c:1292 #49 0x00005555556911ee in command_loop () at keyboard.c:1146 #50 0x00005555556905cb in recursive_edit_1 () at keyboard.c:754 #51 0x00005555556907f7 in Frecursive_edit () at keyboard.c:837 --Type for more, q to quit, c to continue without paging--q Quit (gdb) xbacktrace DCL: step0 in handle_window_change_signal, sig 28 DCL: handle_window_change_signal, tty "Automatic GC" (0x0) "while" (0xffffc430) "let*" (0xffffc630) "eval" (0xffffc8c8) "elisp--eval-last-sexp" (0xf05ff038) 0x599b90f8 PVEC_CLOSURE "eval-last-sexp" (0xffffd330) "funcall-interactively" (0xffffd328) "command-execute" (0xffffda98) (gdb) bt full #0 terminate_due_to_signal (sig=3D6, backtrace_limit=3D2147483647) at emac= s.c:443 No locals. #1 0x0000555555735c81 in die (msg=3D0x55555584e838 "glyph_row_slice_p (window_row, frame_row)", file=3D0x55555584e231 "dispnew.c", line=3D2649) at alloc.c:8082 No locals. #2 0x000055555558b5f3 in build_frame_matrix_from_leaf_window (frame_matrix=3D0x55555607fc20, w=3D0x555556037970) at dispnew.c:2649 frame_row =3D 0x555559e21520 window_row =3D 0x55555a498010 current_row_p =3D false window_matrix =3D 0x55555925ac50 window_y =3D 0 frame_y =3D 12 right_border_glyph =3D { ch =3D 0, face_id =3D 0 } #3 0x000055555558b10f in build_frame_matrix_from_window_tree (matrix=3D0x55555607fc20, w=3D0x555556037970) at dispnew.c:2538 No locals. #4 0x000055555558b0a4 in build_frame_matrix (f=3D0x5555560374b8) at dispnew.c:2522 i =3D 13 #5 0x000055555558cf68 in update_frame (f=3D0x5555560374b8, force_p=3Dtrue, inhibit_hairy_id_p=3Dtrue) at dispnew.c:3336 paused_p =3D false root_window =3D 0x555556082ac0 #6 0x00005555555ca441 in echo_area_display (update_frame_p=3Dtrue) at xdisp.c:13487 n =3D 0 mini_window =3D XIL(0x555556037975) w =3D 0x555556037970 f =3D 0x5555560374b8 window_height_changed_p =3D false sf =3D 0x5555560374b8 #7 0x00005555555c63fb in message3_nolog (m=3DXIL(0x555559663284)) at xdisp.c:12385 mini_window =3D XIL(0x555556037975) frame =3D XIL(0x5555560374bd) f =3D 0x5555560374b8 sf =3D 0x5555560374b8 #8 0x00005555555c64a7 in message1_nolog (m=3D0x55555586f976 "Garbage collecting...") at xdisp.c:12413 No locals. #9 0x0000555555732a80 in garbage_collect () at alloc.c:6587 tail =3D XIL(0) buffer =3D XIL(0x555557a3418d) stack_top_variable =3D 0 '\000' message_p =3D true count =3D { bytes =3D 480 } start =3D { tv_sec =3D 1717410695, tv_nsec =3D 985484457 } tot_before =3D 18446744073709551615 visitor =3D { visit =3D 0x7fffffffc180, data =3D 0x555555732639 }