From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70059: 30.0.50; c-ts-mode crashes emacs Date: Sun, 31 Mar 2024 10:09:33 +0200 Message-ID: <87a5mex1oi.fsf@web.de> References: <877chmccux.fsf@web.de> <86edbtfvge.fsf@gnu.org> <87il15wbtx.fsf@web.de> <86zfuhe0uo.fsf@gnu.org> <878r218e1s.fsf@web.de> <86wmpldyve.fsf@gnu.org> <92195FEF-E940-41F7-B1A8-EC1607D9473E@gmail.com> Reply-To: Felix 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="36274"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.2; emacs 30.0.50 Cc: Eli Zaretskii , 70059@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 31 10:10:25 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 1rqqGm-0009Eb-Tk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Mar 2024 10:10:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqqGR-00046K-Cc; Sun, 31 Mar 2024 04:10:03 -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 1rqqGO-000461-N6 for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:10:00 -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 1rqqGO-0008Th-5j for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:10:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqqGQ-0003Fv-AR for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felix Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2024 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70059 X-GNU-PR-Package: emacs Original-Received: via spool by 70059-submit@debbugs.gnu.org id=B70059.171187258612479 (code B ref 70059); Sun, 31 Mar 2024 08:10:02 +0000 Original-Received: (at 70059) by debbugs.gnu.org; 31 Mar 2024 08:09:46 +0000 Original-Received: from localhost ([127.0.0.1]:46527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqqG9-0003FC-Oq for submit@debbugs.gnu.org; Sun, 31 Mar 2024 04:09:46 -0400 Original-Received: from mout.web.de ([212.227.15.14]:38207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqqG7-0003Et-NG for 70059@debbugs.gnu.org; Sun, 31 Mar 2024 04:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1711872574; x=1712477374; i=felix.dick@web.de; bh=jDhBG3DjP2ES7WyyO1mY37JhGMXYAnQtPsUEamJMZ6M=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=t4M+RMBXYmohWTrSLXdsYibJhw+OlwdF9rh65R/uJ6VQRngzTN7C3ZrBGpoQ/f3l z8rLJ62+HEnnJ6R+0h1rMdwOTtfZjafDDGB8qKSrFXli+MnxneNKfpBsDBRA+J2W3 Qw+Z4Y8x2BxsDcaSJ/uQYqKXYmrHI5GPpGDAHhp7MtrA84QVlvQs9mqXpdKaoXItS 4KSTY+l2+hR6l9m515CaEmwzxVK80qaJvHcDBYtZw3i597EmJ1kpda9XlbXep+FqW Ft18XI9biIbMhpG+I8JCPuCyAg4TG3HlC5IqPPktIUnAolnxU7QdoCJXqyimWjSrh NvdT3ETAJniRe8gqcA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from felix-lifebooka531.web.de ([95.91.213.243]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M5j1q-1rtZ0W1NW6-00FhcJ; Sun, 31 Mar 2024 10:09:34 +0200 In-Reply-To: <92195FEF-E940-41F7-B1A8-EC1607D9473E@gmail.com> (Yuan Fu's message of "Sat, 30 Mar 2024 22:52:55 -0700") X-Provags-ID: V03:K1:K4N+CNxafI48sOIhUOc5bNQg71FczJgO7JC2E9QVxoycHoQPEnG TwUcQmn1BXbaH+D45RTui2NQUWphfrYb/clLdNI4W54feuWzbTraSmbcqY4JVL1d9s2Z8Xk d2dkljX72pVPi00mDUH0XxxhO7BGCa2vBtF0NV5Szv026WreOJGwsJ2dzS+c9bBg7jeM1c8 Xw9UysnaQcZqWZhpdG0kw== UI-OutboundReport: notjunk:1;M01:P0:CB4dUng7Zow=;1VkWd84PdC3JkBayxt59ZaKsOop ZXH+MObOv5Wv050AjT69CLlP+3lms4qrPKmmqNKKhPG0HnLM+PK+Zmkk9zoHVYh/bcETTXsNk rySZxGzafBXui8ccqO0laT6bjhw2FjQke/qbMESt4oeWHxDQaB4U0ClvEIH6vqM23Oc727ZCx AfaFl7OixZWcJDiNSXKO7qsr8Vy7NFDQf+8ukilvPL0vB8TZg6M8lcQ/ODBSndDy4QPPofcJe voj6JiShUpTeUI6ZGLPehrYmA6ivQqD1jZmU4mWfIqKzSd920iwkjP+nYyJpyleACxGP4eoEk 8v7KGtmwHrigFxV3gscHLmvr6xprXK0++Ujl7RgxCZp/8uRtju7cgBEtLl3ZbmAywUe+OvZjA t70+D/4FKIoOaUXEKFazsh06u3qptHG0oETe4bRPSjbEG8jvUl/1WbDksPe3K/gOEp6/pumwv NMNC9k7aH5BSVus0PUSlaWiigjQf69cWx229tsfEaLIkb12fGKpUQiRkHfZuo75VCbPB+9yzq wLCa4xYvXWkh3TBu3nJAyzoxmpuqdOjq6pulzUKez2gWxlCcrEbMb2Ffpk2TUP3O45sCbx2B1 rsHQZde7duPIswj+w2TxsH5Go9PzRC1gm+1HenOM7gZ5XtW3/nwLlnfQ+8ri9oU0Pi3EwM24g 5ox0yfqqVLLb0BQY68CsDOBkR1kcRMbpUBQzww/z6dqXXmQedYMrP6gzqrG4bWLyDj0Y2E3zb FgQ7FbULVsdTh37uAsHMfPVk+v0O22yYUieumvwaLI/nmBLYZuKr1IyxTtN+/GIowhdPh0DZ 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:282418 Archived-At: Yuan Fu writes: >> On Mar 29, 2024, at 5:08 AM, Eli Zaretskii wrote: >> >>> From: Felix >>> Cc: Yuan Fu , 70059@debbugs.gnu.org >>> Date: Fri, 29 Mar 2024 12:37:03 +0100 >>> >>> Eli Zaretskii writes: >>> >>>>> From: Felix >>>>> Cc: Andrea Corallo , 70059@debbugs.gnu.org >>>>> Date: Fri, 29 Mar 2024 11:51:06 +0100 >>>>> >>>>> I rebuild it without native-compilation, and it still crashes. >>>>> Backtrace: >>>>> >>>>> #0 0x000077b79c65c32c in ??? () at /usr/lib/libc.so.6 >>>>> #1 0x000077b79c60b6c8 in raise () at /usr/lib/libc.so.6 >>>>> #2 0x00005a5a428f94a2 in terminate_due_to_signal () >>>>> #3 0x00005a5a42933c23 in emacs_abort () >>>>> #4 0x00005a5a429ec268 in signal_or_quit () >>>>> #5 0x00005a5a429eb422 in Fsignal () >>>>> #6 0x00005a5a429eb401 in xsignal () >>>>> #7 0x00005a5a429e9aa2 in xsignal2 () >>>>> #8 0x00005a5a429c0865 in wrong_type_argument () >>>>> #9 0x00005a5a42965e1f in Fexpand_file_name () >>>>> #10 0x00005a5a42b3d200 in Fdo_auto_save.7873 () >>>>> #11 0x00005a5a428f9738 in shut_down_emacs () >>>>> #12 0x00005a5a428f946a in terminate_due_to_signal () >>>>> #13 0x00005a5a42935924 in handle_sigsegv () >>>>> #14 0x000077b79c60b770 in () at /usr/lib/libc= .so.6 >>>>> #15 0x00005a5a429a57f6 in process_mark_stack () >>>>> #16 0x00005a5a429a677b in mark_char_table () >>>>> #17 0x00005a5a429a68c6 in mark_char_table () >>>>> #18 0x00005a5a429a55bd in process_mark_stack () >>>>> #19 0x00005a5a429a677b in mark_char_table () >>>>> #20 0x00005a5a429a68c6 in mark_char_table () >>>>> #21 0x00005a5a429a55bd in process_mark_stack () >>>>> #22 0x00005a5a429a677b in mark_char_table () >>>>> #23 0x00005a5a429a68c6 in mark_char_table () >>>>> #24 0x00005a5a429a55bd in process_mark_stack () >>>>> #25 0x00005a5a429a677b in mark_char_table () >>>>> #26 0x00005a5a429a68c6 in mark_char_table () >>>>> #27 0x00005a5a429a55bd in process_mark_stack () >>>>> #28 0x00005a5a429a569b in process_mark_stack () >>>>> #29 0x00005a5a429a569b in process_mark_stack () >>>>> #30 0x00005a5a429a569b in process_mark_stack () >>>>> #31 0x00005a5a429a7b8e in garbage_collect () >>>>> #32 0x00005a5a429e76e7 in Ffuncall () >>>>> #33 0x00005a5a42a094f7 in mapcar1 () >>>>> #34 0x00005a5a42a091bf in Fmapconcat () >>>>> #35 0x00005a5a42ac9d90 in Ftreesit_pattern_expand () >>>>> #36 0x00005a5a429e87b3 in funcall_subr () >>>>> #37 0x00005a5a429e77f6 in Ffuncall () >>>>> #38 0x00005a5a42a094f7 in mapcar1 () >>>>> #39 0x00005a5a42a091bf in Fmapconcat () >>>>> #40 0x00005a5a42ac9d90 in Ftreesit_pattern_expand () >>>>> #41 0x00005a5a429e87b3 in funcall_subr () >>>>> #42 0x00005a5a429e77f6 in Ffuncall () >>>>> #43 0x00005a5a42a094f7 in mapcar1 () >>>>> #44 0x00005a5a42a091bf in Fmapconcat () >>>>> #45 0x00005a5a42aca243 in treesit_ensure_query_compiled () >>>>> #46 0x00005a5a42aca5c0 in Ftreesit_query_capture () >>>> >>>> Then it's strange, since it doesn't happen here. Does it happen for >>>> you with any C source file, including those in the Emacs source tree? >>>> If this happens only for some files, can you post one such file? >>>> >>>> Also, what version of the tree-sitter library are you using, and what >>>> version of the C grammar library? >>>> >>>> If you can build the emacs-29 branch, can you try reproducing there? >>>> >>>> Yuan, any ideas, based on the backtrace? >>> >>> I was using tree-sitter build from the git repository, when i use it >>> from the official arch linux repos, it doesn't crash (at least until >>> now). >>> I think this is tree-sitter related, but it shouldn't be able to crash >>> emacs, should it? >> >> It shouldn't, unless there's some memory-related snafu (which could >> explain why the crash is always in GC). I hope Yuan will be able to >> tell. > > It=E2=80=99s a bit strange since Ftreesit_pattern_expand doesn=E2=80=99t = call > tree-sitter function. This function just expands a sexp query like > '(function_definition @capture) to a string =E2=80=9C(function_definition > @capture)=E2=80=9D. > > Perhaps something it does triggers GC and GC tries to collect some tree-s= itter node or parser, and there=E2=80=99s some problem when freeing the nod= e or parser with that version of tree-sitter library. > > Also, I couldn=E2=80=99t reproduce with upstream tree-sitter plus emacs m= aster > either. I=E2=80=99m using commit 0b4403294981ffb6a51d153a5509a389b91fed86= for > tree-sitter and commit 411f46fd365bc0008c58e1fa6bee6a60d841da75 for > emacs. Felix, what commit are you using? > > Yuan It still crashes on my computer if i use: GNU Emacs 30.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cai= ro version 1.18.0) of 2024-03-31 and tree-sitter 0.22.2 (fc15f621334a262039ffaded5937e2844f88da61) But as i wrote, it doesn't crash with tree-sitter from the official arch linux repos, and because i program in C every day, i switched to the stable tree-sitter and had no problems since. That's why i asked if a faulty tree-sitter should be able to crash emacs. If that is acceptable, this bug report can be closed.