From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71012: 30.0.50; tree-sitter crash Date: Thu, 25 Jul 2024 13:40:38 +0300 Message-ID: <868qxp69g9.fsf@gnu.org> References: <87ttiwpng0.fsf@gmail.com> <86wmnsfodz.fsf@gnu.org> <6F195712-81CE-4C75-8983-D1D909646CAC@gmail.com> <86zfs8ssyj.fsf@gnu.org> <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@gmail.com> <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@gmail.com> <87h6e52lkw.fsf@epfl.ch> <87r0d12hlw.fsf@epfl.ch> <87y15qrg5q.fsf@epfl.ch> <86cyn27nuo.fsf@gnu.org> <87frrywemm.fsf@epfl.ch> <86sevy59dj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71012@debbugs.gnu.org, eller.helmut@gmail.com, basil@contovou.net To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 25 12:42:16 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 1sWvvL-000485-3A for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Jul 2024 12:42:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWvv5-0005ws-5b; Thu, 25 Jul 2024 06:41:59 -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 1sWvv2-0005wg-Ei for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 06:41:57 -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 1sWvv1-0006fz-IC for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 06:41:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWvv7-0007aH-MX for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2024 06:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2024 10:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71012 X-GNU-PR-Package: emacs Original-Received: via spool by 71012-submit@debbugs.gnu.org id=B71012.172190406429084 (code B ref 71012); Thu, 25 Jul 2024 10:42:01 +0000 Original-Received: (at 71012) by debbugs.gnu.org; 25 Jul 2024 10:41:04 +0000 Original-Received: from localhost ([127.0.0.1]:35582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWvuB-0007Z2-SB for submit@debbugs.gnu.org; Thu, 25 Jul 2024 06:41:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWvu9-0007YP-06 for 71012@debbugs.gnu.org; Thu, 25 Jul 2024 06:41:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWvtv-0006Br-GM; Thu, 25 Jul 2024 06:40:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=w4oq/Fbpk+UXVKDlxeKo6ONedPruGnUuzuliEgWzBtM=; b=loKLnZYKXhBEpNUbFU2E c6DAOsHWV0PnVLVcj4NbjLEsTDb5V4zgo1rkZc1f8dqASJSRA638otlEYE2HTvoaVLzXCZSvyQt9I 9KRU5Gy+a/vCDn3Ss42I8cNjZwExNU5rCWKafJyfYVK6gjBM/IORxqjGrVwzQ79kylMWK1CZxZ5MJ L7I9HBvgDYSRjRZYVgjTrO9X6wWxdiP+csxHgYB1lIoPekDrH/g7Huskd2dU/5gkKh+h5F8OOzm+s FE+PJBDatUav2xV9Y6D2lACOAoJCLPJgmDuIb08IvV+N3NcQCObLNzl8PRF4HAy6Nnv7UnQTaijbT KMHPkNSbUAdB/g==; In-Reply-To: (message from Yuan Fu on Thu, 25 Jul 2024 00:26:30 -0700) 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:289297 Archived-At: > From: Yuan Fu > Date: Thu, 25 Jul 2024 00:26:30 -0700 > Cc: "Basil L. Contovounesios" , > 71012@debbugs.gnu.org, > Helmut Eller > > > On Jul 24, 2024, at 10:27 PM, Eli Zaretskii wrote: > > > >> From: "Basil L. Contovounesios" > >> Cc: casouri@gmail.com, 71012@debbugs.gnu.org, eller.helmut@gmail.com > >> Date: Thu, 25 Jul 2024 01:32:01 +0200 > >> > >> Eli Zaretskii [2024-07-24 19:31 +0300] wrote: > >> > >>>> Cc: 71012@debbugs.gnu.org, eller.helmut@gmail.com > >>>> From: "Basil L. Contovounesios" > >>>> Date: Wed, 24 Jul 2024 16:57:53 +0200 > >>>> > >>>> Ping: thoughts on whether this is an issue? > >>> > >>> Thoughts about what? what is deemed to be a problem in this case? > >> > >> That each call to treesit-parse-string now allocates a new internal > >> buffer which is not automatically GCed. > >> > >> If this cannot be avoided, I think the docs should at least warn that > >> it's the caller's responsibility to kill the return node's buffer when > >> finished with it. > > > > If the buffers aren't killed by the code, it's indeed an issue that > > needs to be solved. At the time I suggested that the node's buffer is > > killed when the node is GC'ed or deleted -- have this not been done? > > No. I think it’s best to implement treesit-parse-string in C with ts_parse_string now. That way we don’t need to worry about the temp buffer. That'd be fine as well, yes.