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: Wed, 17 Apr 2024 15:13:30 +0200 Message-ID: <87zftsnnd1.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> <87a5mex1oi.fsf@web.de> <57C4D40E-15B1-4A8C-8FA7-C01A16A81BA9@gmail.com> <865xwzaa1t.fsf@gnu.org> <08F912D5-CCC4-42C8-8C27-B1CB2085FEA0@gmail.com> <868r1oytlt.fsf@gnu.org> 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="4000"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.4; emacs 30.0.50 Cc: Yuan Fu , 70059@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 17 15:14:19 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 1rx57C-0000l1-G9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Apr 2024 15:14:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx56n-0003QY-VI; Wed, 17 Apr 2024 09:13:54 -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 1rx56k-0003Q5-Ms for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 09:13:50 -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 1rx56j-0001wN-HR for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 09:13:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rx56v-0000Cr-UF for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 09:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Felix Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Apr 2024 13:14: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.1713359635717 (code B ref 70059); Wed, 17 Apr 2024 13:14:01 +0000 Original-Received: (at 70059) by debbugs.gnu.org; 17 Apr 2024 13:13:55 +0000 Original-Received: from localhost ([127.0.0.1]:46053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx56o-0000BV-ID for submit@debbugs.gnu.org; Wed, 17 Apr 2024 09:13:54 -0400 Original-Received: from mout.web.de ([212.227.15.3]:39527) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rx56l-0000BD-1p for 70059@debbugs.gnu.org; Wed, 17 Apr 2024 09:13:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1713359611; x=1713964411; i=felix.dick@web.de; bh=Ga/DZySX2ZiRcMm8oranhV95a5LQf3hBHMV0c9/DiIM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=bwTo28svc4DJPXoEBm54DDMtl0y0F1aQgJHxVfvEkyUYaDagZFeXodcPgRyZ3Ili yhL608bBKlselxUrPFlYlvU7tKQG65bA9uobXxQvBwpw6xVDkMZlmj6eGlfq2lD4t khhfPWAQz37i11fBjLn3PpoSC+hKB15evSRKJ1qnME4YmqeSyajWuTot4f8W33m7v ijAziOrOicFASF5L6cecyJ3Gs76s9WD+Ve5DtPQcD8DtfsXJYDI6tzgO6bbEXxvr/ MqmpOYwLBL3Y7rUA3xp48e0qvEs21LUHCrqRQsAiNSfpCPnB3x0wE8JHtk0DQFwdk GfNJGRNmoyRuN0xrPg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from felix-lifebooka531.web.de ([95.91.244.254]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MBB3y-1s23hl1xkc-00A0nY; Wed, 17 Apr 2024 15:13:31 +0200 In-Reply-To: <868r1oytlt.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 08 Apr 2024 14:35:58 +0300") X-Provags-ID: V03:K1:kSkpdazFcp7ioic4OU3eZhw2fKPHCX312CpoDqletvmdk+CwNKA AOLSNL1d4lgffj/ftMvbaH0McVu45eRrRlmYLZar9MIWJ/YkIdNGcgNxHTcvaU5zmjHq56U F/i9x7JsgINPsenlN6QVRnnGkmgYH/RVZvTlphlIT895W6iWfgCogohxlm4DMDhmnnhIXS6 JNqP4gh+h4O5JVS2PlQUg== UI-OutboundReport: notjunk:1;M01:P0:nd4jEhUmIdc=;cMwGFPb/1VVv8Rlq2m+vWPYB760 fFKzXmGH2nTeZUsY+zq0U0y/f+B6Yfb81yu9NEzxP6rCBuXhvTzm4aB40NA/Ck3WPaD7I6mZ8 k67rb1AF/pc8kfGGXbJIZqLYSuR85ly37H2f1wPnrpYjlV6o9ZCH2UPOtvcQSuYQ+UbTi8u0S gQ3PkXfI1TmkI7NfQgljavtE5EEjqCYf7NZ8bSeAJWgFeqsOo4nxgbcUQTk4ahbyzQc1ORmZo tmSBWiaxXSkhHdTCt6IlJZESbKVxB8G9npL70LjD611ldVdQ8pMuWNCDVmVIr0HstuHpIE1Rz qulUZO+LPGxrCGn+fhi4mDKC9yUToGm8w3/zyTnRFQkiAkE8fJv1vaPIoRzUwS37SIv9kk9b6 Ec+OAhN2rlLhv7BT2aeZN99xWZkzCCQhMsBFzJPwFoZINdjd6tQJxGbKa8K8QhKuA9GsK3vz5 O2amzrUbUsZCFgyOEOIm97xpMcg45Ir53kR6gRH+1PP9ZApdtjlxcofLReWeDhEJIILGY5N4v sGKKbkVwG5BXXNe57in3Ci3/2RiL+5/EotRkTjrxtnSN+YJbYMPeZI5fAMLwFK9umhsIWMX3K xmiBQUfI0fcT7Won3y1aGQa1uLDpZiDBrRrB8QYIoog9WyFZLWO9kxuLC890DCAVYl+R+hmMQ Xcyh3jnWZ0x55PFxsPQQLqY7QX+9mL8PI6GFyG6IKis8ZjHGHxaCR0NlkLjcufZI7EbZY4Lld xRr55llt8dyix4A2cS3gjvXq6ARWtKyj+G6/S9dc+AbdxBHZcsXsptJ8Rmi7XMYE6jle6Xu/ 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:283492 Archived-At: I think this problem posted on reddit might be related to this issue: https://www.reddit.com/r/emacs/comments/1c3wpbt/emacs_crashes_with_treesitt= er_update/ Eli Zaretskii writes: >> From: Yuan Fu >> Date: Sun, 7 Apr 2024 23:32:01 -0700 >> Cc: Felix , >> 70059@debbugs.gnu.org >>=20 >> > On Apr 2, 2024, at 11:34 AM, Eli Zaretskii wrote: >> >=20 >> >> I mean tree-sitter (the library) runs in the main thread, if it trigg= ers a segfault, AFAIK Emacs currently can=E2=80=99t really do anything. Is = that right Eli? >> >=20 >> > You are right. But these crashes seem to be inside GC, which >> > processes our objects, so if tree-sitter somehow causes us to create >> > invalid Lisp objects, it's our fault, at least to some extent. >>=20 >> If the crash happens in ts_node_delete, ts_parser_delete or >> ts_tree_delete, would the backtrace record that? (Given that the >> tree-sitter library probably isn=E2=80=99g compile with symbols.) If the >> crash happens in those functions I think it=E2=80=99s not our fault. > > Even if tree-sitter was not compiled with debug symbols, we'd see the > library name in the backtrace. Like here: > > #14 0x0000723f608fd770 in () at /usr/lib/libc.s= o.6 > #15 0x000062534d063429 in process_mark_stack () > #16 0x000062534d1649f1 in traverse_intervals_noorder () > #17 0x000062534d063e5e in process_mark_stack () > #18 0x000062534d063ceb in process_mark_stack () > #19 0x000062534d063ceb in process_mark_stack () > #20 0x000062534d064fab in mark_char_table () > #21 0x000062534d0650f6 in mark_char_table () > > As you see, the fact that the crash happened in libc is shown, even > though we have no symbols for libc. > > Looking at the two backtraces posted in this bug, I see that each time > the crashes were while processing some char-table. I don't think > treesit-related code manipulates char-table's, does it? So I don't > think treesit-related code is to blame here, it just so happened that > calling treesit-pattern-expand triggered GC; the invalid object was > probably created by some unrelated code.