From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#70059: 30.0.50; c-ts-mode crashes emacs Date: Sat, 30 Mar 2024 22:52:55 -0700 Message-ID: <92195FEF-E940-41F7-B1A8-EC1607D9473E@gmail.com> 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> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="3761"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Felix , 70059@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 31 07:54:17 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 1rqo93-0000r0-Dq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Mar 2024 07:54:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqo8n-00075g-97; Sun, 31 Mar 2024 01:54:01 -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 1rqo8m-00075V-EM for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 01:54: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 1rqo8l-0001WJ-Sf for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 01:53:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqo8n-0000oV-Nq for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 01:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2024 05:54:01 +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.17118644003041 (code B ref 70059); Sun, 31 Mar 2024 05:54:01 +0000 Original-Received: (at 70059) by debbugs.gnu.org; 31 Mar 2024 05:53:20 +0000 Original-Received: from localhost ([127.0.0.1]:46461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqo87-0000mx-Oh for submit@debbugs.gnu.org; Sun, 31 Mar 2024 01:53:20 -0400 Original-Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]:50249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqo82-0000me-Mp for 70059@debbugs.gnu.org; Sun, 31 Mar 2024 01:53:18 -0400 Original-Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3688676cc70so13240885ab.0 for <70059@debbugs.gnu.org>; Sat, 30 Mar 2024 22:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711864386; x=1712469186; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=M3Syhgm3BgBz5qmwa3izEUd6nGsVyjYlREYjMUlswkI=; b=ZrvWXY3rhvtQul0CKjQuPrOQENSYu8rmQdOUbz1l8SHZsfqZTwfV3d1Vy9m9gxsxSi D27lSk7q+62yNkyRxe1n3T2FOhho+IRXlWVILQ3LdJiWLJf1wNBQDmrN08xlyuYlO2/f zLgIu27ThMWJS4Vnc/tIAcNO75bFX5ncjXL08MDydw0iUUAwH1SBLD0AjhBCpxH5HokF X5U7TpCmvA1saDQXlZzVGo9ewSuqDaqqxLFOZ0COYUW4/KgPW/3YuWf1RODLOdMrad+1 n2bHh8GN8MEi07ec7h40ZKHtWAxtIGIkl6Qomp1GXpgFhoWymE0lVjHx4ryEYiTaUbhv aUhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711864386; x=1712469186; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M3Syhgm3BgBz5qmwa3izEUd6nGsVyjYlREYjMUlswkI=; b=MgozUIKeCiWbISI/YyKAbcVla4701tdvG3GCWyxiJjqiJLoqdWF+ylOTKhFoBiKaua mKDbwuhiQKOCCW2BvYmryNi/e0HnN5GOMoCgfpmS4btST7mUr5i+0aWvHA66X9QEQEal Dez9koCQuuClq8yf7inTZGusY0BDhCjEagjGbGdlKb3oHIQs1HkZ7zjg0P+03h6Ay/Rc QWTFDcLlK7u2mbMhVbMv4+zIWCRQlVpvnb0D1N+5D/f/UJU3vokRfUUUME8Lj/iuynRn aVUswmWZgVeQ3J1d3oVRLYVvK0qc6hsV2eBeuY64s1CIY1hBDJhkWvUs1DZgAUnmO/kv 9krw== X-Forwarded-Encrypted: i=1; AJvYcCXFmLDf/JRAfH0iPvjIGwN5r3+yKl/lDtBJ2qhH+DIeHD2UpsXBXLOmxQ8Kvwc2MEVfqo4Mj6Lp6Z1+MHW6rO55q7z0erg= X-Gm-Message-State: AOJu0YwscCKJnOgim+KBZduPterKM2S+SIfGrmwN93tdvw78vXHRlnIL QL5p7cvasnPEhEit4KuFkt9g6cWoTVo3oS2xhuxpk4AqG4xg3H1F X-Google-Smtp-Source: AGHT+IFUL31lXFiDr9dLhcxOIBgHUUsjBp3ssohS1hK7VcIFiW1fmvgKcvPVKrbf6Aocr6rudcAwsQ== X-Received: by 2002:a92:c548:0:b0:368:efa4:bdf4 with SMTP id a8-20020a92c548000000b00368efa4bdf4mr6241902ilj.19.1711864386628; Sat, 30 Mar 2024 22:53:06 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:641:300:4910:a0c7:e3e9:cfdc:38fe]) by smtp.gmail.com with ESMTPSA id f17-20020a170902ce9100b001e0e977f655sm6173016plg.159.2024.03.30.22.53.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2024 22:53:06 -0700 (PDT) In-Reply-To: <86wmpldyve.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.700.6) 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:282411 Archived-At: > On Mar 29, 2024, at 5:08 AM, Eli Zaretskii wrote: >=20 >> From: Felix >> Cc: Yuan Fu , 70059@debbugs.gnu.org >> Date: Fri, 29 Mar 2024 12:37:03 +0100 >>=20 >> Eli Zaretskii writes: >>=20 >>>> From: Felix >>>> Cc: Andrea Corallo , 70059@debbugs.gnu.org >>>> Date: Fri, 29 Mar 2024 11:51:06 +0100 >>>>=20 >>>> I rebuild it without native-compilation, and it still crashes. >>>> Backtrace: >>>>=20 >>>> #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 () >>>=20 >>> 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? >>>=20 >>> Also, what version of the tree-sitter library are you using, and = what >>> version of the C grammar library? >>>=20 >>> If you can build the emacs-29 branch, can you try reproducing there? >>>=20 >>> Yuan, any ideas, based on the backtrace? >>=20 >> 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? >=20 > 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.=20 Perhaps something it does triggers GC and GC tries to collect some = tree-sitter node or parser, and there=E2=80=99s some problem when = freeing the node or parser with that version of tree-sitter library. Also, I couldn=E2=80=99t reproduce with upstream tree-sitter plus emacs = master either. I=E2=80=99m using commit = 0b4403294981ffb6a51d153a5509a389b91fed86 for tree-sitter and commit = 411f46fd365bc0008c58e1fa6bee6a60d841da75 for emacs. Felix, what commit = are you using? Yuan=