From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70385: Crash in note_fringe_highlight Date: Mon, 15 Apr 2024 20:04:02 +0300 Message-ID: <44873.2785343722$1713200728@news.gmane.org> References: <86h6g49cdv.fsf@mail.linkov.net> <87jzkz1kdn.fsf@yahoo.com> <86r0f6lv76.fsf@gnu.org> <8734rm25zb.fsf@yahoo.com> <86edb6lqw0.fsf@gnu.org> <87y19ezq14.fsf@yahoo.com> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24638"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, vekazanov@gmail.com, eliz@gnu.org, juri@linkov.net To: 70385@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 19:05:20 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 1rwPlf-000683-Bh for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 19:05:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwPlM-00024u-Bo; Mon, 15 Apr 2024 13:05:00 -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 1rwPlG-0001yx-C4 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 13:04:55 -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 1rwPlG-0007uW-3V for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 13:04:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rwPlR-0005lk-G5 for bug-gnu-emacs@gnu.org; Mon, 15 Apr 2024 13:05:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Apr 2024 17:05:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70385 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Po Lu , vekazanov@gmail.com, Eli Zaretskii , 70385@debbugs.gnu.org, juri@linkov.net Original-Received: via spool by 70385-submit@debbugs.gnu.org id=B70385.171320066821844 (code B ref 70385); Mon, 15 Apr 2024 17:05:05 +0000 Original-Received: (at 70385) by debbugs.gnu.org; 15 Apr 2024 17:04:28 +0000 Original-Received: from localhost ([127.0.0.1]:38365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwPkp-0005gF-Ee for submit@debbugs.gnu.org; Mon, 15 Apr 2024 13:04:28 -0400 Original-Received: from thaodan.de ([2a03:4000:4f:f15::1]:37366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rwPkj-0005eJ-7a for 70385@debbugs.gnu.org; Mon, 15 Apr 2024 13:04:25 -0400 Original-Received: from odin (dsl-trebng12-50dc75-154.dhcp.inet.fi [80.220.117.154]) by thaodan.de (Postfix) with ESMTPSA id 7EF51D00051; Mon, 15 Apr 2024 20:04:03 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1713200643; bh=WA2wFOLuRuvQtrnR4kPg4wfIXO6Ltv1oYfUKLC3jkYU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Ixpm0r6MFuODZbmgboLXEU7bOmYW2haBpkLf4OUadjGfNVYuGVWH0+s82U4RKJMKb PaTCypjV9mzVwpMlsaj5g7oqpUJXKhy7oe0nfgjARDj0dfmi92J8PR6L2CPMUNB4CY YF+ynuwa03obo7YeSVZuwFG5RO4e8K21wMcL45wSaPHiLPisJow8u5EdCUZi3LNeeb VKgFgcIbKqcwaCVdE9ljPjce2u/KAq7waB0FOV1us5Y+0qpQiIOHKPRehjqFXnRM71 EM7xojH+GZXzeSvhfH2QhHGlWAJAo/CE1mJIkCfBI/CeMxBTH31zBYGj+DciIJuSSW xhHFQRb1jiYos0lcoGXlGObQczVYs1LylwsDUzctCSsrpENwQa1WWjCQMhnGAZ3vpv vzRvd7Vbw/1uRJcIQk3rF2M6NNsSNHy9DD5j0LwrjjaDjy94I7BRYtUoOpSG4H+usy 6oJHprRPqXHF+4Z92mNkCsU8MUVvrt0hGBNyVDq1RKMD59EYFauCXbewgOq/Sg9iq8 8JDReyGjzTuk9eLUeys8AwV7FCOrCRl4GEAlwsoMrMffmonqV3QkyU8vj6BNXTR8ij lvoC6PPUF25Uv45LoNktaipFJv0x98MDvEB3WNRWj7rAI/7sI6zr1nZzjsFLHZhnTj 6b+2c81JcxcTjnSjI8l+PBUY= In-Reply-To: <87y19ezq14.fsf@yahoo.com> (Po Lu via's message of "Mon, 15 Apr 2024 21:58:15 +0800") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH 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:283385 Archived-At: --=-=-= Content-Type: text/plain Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Eli Zaretskii writes: > >> I think this should be >> >> if ((window_outdated (w) >> || !w->window_end_valid >> || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, >> vpos))) > > Yes, sorry. > >> I'm not sure it will help, because it seems the segfault happens in >> the MATRIX_ROW_DISPLAYS_TEXT_P macro. So I think we are somehow >> dealing with w->current_matrix whose 'nrows' is too small. The >> mouse-highlight code detects that case in x_y_to_hpos_vpos. > > Right. What about this? > > diff --git a/src/xdisp.c b/src/xdisp.c > index d984c12d1aa..dcecc2b09d4 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -35772,6 +35772,7 @@ note_fringe_highlight (struct frame *f, Lisp_Object window, int x, int y, > /* Don't access the TEXT_AREA of a row that does not display text, or > when the window is outdated. (bug#70385) */ > if (window_outdated (w) > + || (vpos >= w->current_matrix->nrows) > || !MATRIX_ROW_DISPLAYS_TEXT_P (MATRIX_ROW (w->current_matrix, > vpos))) > return; > > It's the same test x_y_to_hpos_vpos applies to decide whether to punt > and return NULL. Tried the change but it wasn't enough: --=-=-= Content-Type: text/x-log Content-Disposition: inline; filename=emacs.gdb.note_fringe.3rd.log #0 __pthread_kill_implementation (threadid=, signo=signo@entry=11, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x00007f0ca9294a73 in __pthread_kill_internal (signo=11, threadid=) at pthread_kill.c:78 #2 0x00007f0ca9241176 in __GI_raise (sig=sig@entry=11) at ../sysdeps/posix/raise.c:26 #3 0x00005591d8759f70 in terminate_due_to_signal (sig=11, backtrace_limit=) at ../../emacs-30.0.50.5968.24957ea566b/src/emacs.c:479 #4 0x00005591d875a603 in handle_fatal_signal (sig=) at ../../emacs-30.0.50.5968.24957ea566b/src/sysdep.c:1800 #5 0x00005591d8a235e8 in deliver_thread_signal.constprop.0 (sig=sig@entry=11, handler=) at ../../emacs-30.0.50.5968.24957ea566b/src/sysdep.c:1792 #6 0x00005591d88beb29 in deliver_fatal_thread_signal (sig=11) at ../../emacs-30.0.50.5968.24957ea566b/src/sysdep.c:1812 #7 handle_sigsegv (sig=11, siginfo=, arg=) at ../../emacs-30.0.50.5968.24957ea566b/src/sysdep.c:1950 #8 0x00007f0ca9241240 in () at /lib64/libc.so.6 #9 0x00005591d87d0799 in note_fringe_highlight (part=, y=, x=, window=XIL(0x5591dfb7bc85), f=0x5591dfb7b988) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:35776 #10 note_mouse_highlight (f=0x5591dfb7b988, x=, y=) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:36037 #11 0x00005591d8859710 in x_note_mouse_movement (frame=0x5591dfb7b988, event=0x7ffc900620e0, device=) at ../../emacs-30.0.50.5986.55a200d7071/src/xterm.c:14667 #12 0x00005591d886470a in handle_one_xevent (dpyinfo=0x5591e83799f0, event=, finish=, hold_quit=0x7ffc90062860) at ../../emacs-30.0.50.5986.55a200d7071/src/xterm.c:23162 #13 0x00005591d885c401 in event_handler_gdk (gxev=0x7ffc900625d0, ev=, data=) at ../../emacs-30.0.50.5986.55a200d7071/src/xterm.c:17890 #14 0x00007f0cb418b82f in gdk_event_apply_filters (xevent=xevent@entry=0x7ffc900625d0, event=event@entry=0x5591de546770, window=window@entry=0x0) at ../gdk/x11/gdkeventsource.c:79 #15 0x00007f0cb419303f in gdk_event_source_translate_event (xevent=0x7ffc900625d0, event_source=0x5591e114da10) at ../gdk/x11/gdkeventsource.c:198 #16 _gdk_x11_display_queue_events (display=0x5591ebef2f00) at ../gdk/x11/gdkeventsource.c:341 #17 0x00007f0cb413b9b9 in gdk_display_get_event (display=0x5591ebef2f00) at ../gdk/gdkdisplay.c:442 #18 0x00007f0cb4193412 in gdk_event_source_dispatch.lto_priv () at ../gdk/x11/gdkeventsource.c:354 #19 0x00007f0cb3ae9710 in () at /lib64/libglib-2.0.so.0 #20 0x00007f0cb3aeb358 in () at /lib64/libglib-2.0.so.0 #21 0x00007f0cb3aeba0c in g_main_context_iteration () at /lib64/libglib-2.0.so.0 #22 0x00007f0cb43f6b95 in gtk_main_iteration () at ../gtk/gtkmain.c:1433 #23 0x00005591d886c022 in XTread_socket (terminal=, hold_quit=0x7ffc90062860) at ../../emacs-30.0.50.5986.55a200d7071/src/xterm.c:25657 #24 0x00005591d88ae662 in gobble_input () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:7898 #25 0x00005591d88ae965 in handle_async_input () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:8137 #26 process_pending_signals () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:8151 #27 unblock_input_to (level=) at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:8166 #28 unblock_input_to (level=) at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:8160 #29 unblock_input () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:8185 #30 0x00005591d891f163 in garbage_collect () at ../../emacs-30.0.50.5968.24957ea566b/src/alloc.c:6685 #31 0x00005591d891f685 in maybe_garbage_collect () at ../../emacs-30.0.50.5968.24957ea566b/src/alloc.c:6507 #32 0x00005591d8999842 in maybe_gc () at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/lisp.h:5891 #33 exec_byte_code (fun=, args_template=, nargs=, args=) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/bytecode.c:789 #34 0x00005591d894614a in funcall_lambda (fun=fun@entry=XIL(0x5591dcada08d), nargs=nargs@entry=0, arg_vector=arg_vector@entry=0x7ffc90062b20) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:3190 #35 0x00005591d89462d9 in apply_lambda (fun=, args=, count=count@entry=...) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:3144 #36 0x00005591d89439fb in eval_sub (form=form@entry=XIL(0x7f0ca217a4a3)) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:2615 #37 0x00005591d8945baf in Feval (form=XIL(0x7f0ca217a4a3), lexical=) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:2389 #38 0x00005591d894340d in funcall_subr (subr=0x5591d8fa1760 , numargs=numargs@entry=2, args=args@entry=0x7ffc90062e68) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:3092 #39 0x00005591d8940ad0 in funcall_general (fun=, numargs=numargs@entry=2, args=args@entry=0x7ffc90062e68) at ../../emacs-30.0.50.5986.55a200d7071/src/lisp.h:2242 #40 0x00005591d8940cc6 in Ffuncall (nargs=nargs@entry=3, args=args@entry=0x7ffc90062e60) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:3022 #41 0x00005591d89401a1 in internal_condition_case_n (bfun=0x5591d8940bd0 , nargs=3, args=0x7ffc90062e60, handlers=, hfun=0x5591d8787420 ) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:1617 #42 0x00005591d87d4c54 in dsafe__call.part.0.lto_priv.0 (inhibit_quit=true, f=0x5591d8940bd0 , nargs=3, args=0x7ffc90062e60) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:3067 #43 0x00005591d87c3c04 in dsafe__call (args=0x7ffc90062e60, nargs=3, f=, inhibit_quit=true) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:3056 #44 dsafe_eval (sexpr=) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:3103 #45 display_mode_element (it=it@entry=0x7ffc90063020, depth=2, depth@entry=1, field_width=0, precision=precision@entry=0, elt=XIL(0x7f0ca217a4c3), props=props@entry=XIL(0), risky=false) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:27876 #46 0x00005591d87c3cdc in display_mode_element (it=0x7ffc90063020, depth=1, field_width=0, precision=0, elt=, props=XIL(0), risky=false) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:27962 #47 0x00005591d87b92ca in display_mode_line (w=w@entry=0x5591dfb7bc80, face_id=MODE_LINE_ACTIVE_FACE_ID, format=XIL(0x7f0ca217a4e3)) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:27387 #48 0x00005591d87b9b12 in display_mode_lines (w=0x5591dfb7bc80) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:27300 #49 0x00005591d87abdd9 in redisplay_window (window=, just_this_one_p=just_this_one_p@entry=false) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:20921 #50 0x00005591d87af5fb in redisplay_window_0 (window=window@entry=XIL(0x5591dfb7bc85)) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:18012 #51 0x00005591d894004c in internal_condition_case_1 (bfun=0x5591d87af5d0 , arg=XIL(0x5591dfb7bc85), handlers=, hfun=0x5591d87a2890 ) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:1561 #52 0x00005591d87a2a09 in redisplay_windows (window=XIL(0x5591dfb7bc85)) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:17981 #53 0x00005591d87a5d8e in redisplay_internal () at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:17381 #54 0x00005591d87a726a in redisplay_preserve_echo_area (from_where=) at /usr/src/debug/emacs-30.0.50.5990.9b755244bf0/src/xdisp.c:17740 #55 0x00005591d89ae509 in wait_reading_process_output (time_limit=, nsecs=, read_kbd=, do_display=, wait_for_cell=, wait_proc=, just_wait_proc=) at ../../emacs-30.0.50.5968.24957ea566b/src/process.c:5434 #56 0x00005591d876ffb6 in sit_for (timeout=, reading=true, display_option=) at ../../emacs-30.0.50.5986.55a200d7071/src/dispnew.c:6318 #57 0x00005591d88aaac2 in read_char (commandflag=1, map=XIL(0x5591f0dda9f3), prev_event=XIL(0), used_mouse_menu=0x7ffc90068cfb, end_time=0x0) at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:2922 #58 0x00005591d88bbc3f in read_key_sequence (keybuf=0x7ffc90068e90, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false, disable_text_conversion_p=false) at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:10722 #59 0x00005591d88a2fe7 in command_loop_1 () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:1428 #60 0x00005591d893ffb7 in internal_condition_case (bfun=0x5591d88a2e10 , handlers=, hfun=0x5591d88a1ef0 ) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:1537 #61 0x00005591d88a232e in command_loop_2 (handlers=handlers@entry=XIL(0x90)) at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:1167 #62 0x00005591d893fec1 in internal_catch (tag=, func=0x5591d88a2300 , arg=XIL(0x90)) at ../../emacs-30.0.50.5986.55a200d7071/src/eval.c:1217 #63 0x00005591d88a0e99 in command_loop () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:1145 #64 0x00005591d88a19d6 in recursive_edit_1 () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:753 #65 0x00005591d88a1dec in Frecursive_edit () at ../../emacs-30.0.50.5968.24957ea566b/src/keyboard.c:836 #66 0x00005591d8764adc in main (argc=2, argv=0x7ffc90069348) at ../../emacs-30.0.50.5968.24957ea566b/src/emacs.c:2626 You can't do that without a process to debug. quit --=-=-=--