GNU bug report logs - #71012
30.0.50; tree-sitter crash

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Helmut Eller <eller.helmut@HIDDEN>; Done: Yuan Fu <casouri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 24 Jul 2024 14:58:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 24 10:58:12 2024
Received: from localhost ([127.0.0.1]:34318 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sWdRU-0007hC-28
	for submit <at> debbugs.gnu.org; Wed, 24 Jul 2024 10:58:12 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:39701)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <basil.conto@HIDDEN>) id 1sWdRO-0007gi-S7
 for 71012 <at> debbugs.gnu.org; Wed, 24 Jul 2024 10:58:10 -0400
Received: by mail-wr1-f51.google.com with SMTP id
 ffacd0b85a97d-3687f91b7cfso231445f8f.3
 for <71012 <at> debbugs.gnu.org>; Wed, 24 Jul 2024 07:58:00 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1721833075; x=1722437875;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=qztgSutAfBd/35Xphs7ggpGZvXMVo4YOoezqIVONMbo=;
 b=urTAoRhAa0duF6Phx34pcbgvmbnYYAeosqOdqN1Ep7vzc5YWRDQZbwqmz/S9PJVd6C
 qzVndlnxr4DYGsF4Ewb/pFW44rOr8/IFhcC2y5Bq+mF8u9ay857VtdVJVsIw6a6AdBcV
 a4j0fvBYfsAsgZ4l0rR5nZJsgo7icEzj22vAMdI6M8aAcDsBtFBDZU5t7BWY4ok3DFN2
 Wz5Ce+Dqcf1khFINmIss462vS7byLOQgcl9Y1Ry6GzL9hxK6Ir/gPrl6bdMvNaCQT2CG
 Mcv1YDy5xbXuv2yXuaakGOxIr0Dm7ekZ4K9d2OqxT9KrvyXUKfybAq9ZUNoCQQIXqgW3
 hW3w==
X-Gm-Message-State: AOJu0Yx8sSIikm5VP1cOykv76XwzTOVZ1ltpWdGAbDZF/Nk6h2xTUXYQ
 CXVJtNJ8je0OS5MpiOnLKp9XAFl2kACvBvd73h3mwxjZAEdHAd7QVggiW1BJ
X-Google-Smtp-Source: AGHT+IH9SFArx4HvqiYHSTzeIUQkTt5KoZgbhVVAAZGTmpzPyUOGhTaEuiVXjAyH3fKy8Y4CJBRpdw==
X-Received: by 2002:a5d:47c7:0:b0:367:95e3:e4c6 with SMTP id
 ffacd0b85a97d-369b676ec17mr6168865f8f.1.1721833074597; 
 Wed, 24 Jul 2024 07:57:54 -0700 (PDT)
Received: from localhost ([2001:620:618:5c0:2:80b3:0:25c])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3687868aa6esm14615443f8f.26.2024.07.24.07.57.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 24 Jul 2024 07:57:54 -0700 (PDT)
From: "Basil L. Contovounesios" <basil@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <87r0d12hlw.fsf@HIDDEN> (Basil L. Contovounesios's message of
 "Thu, 13 Jun 2024 13:43:23 +0200")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
 <87h6e52lkw.fsf@HIDDEN>
 <C61DD1E2-375B-4029-B990-89193BB54C08@HIDDEN>
 <87r0d12hlw.fsf@HIDDEN>
Date: Wed, 24 Jul 2024 16:57:53 +0200
Message-ID: <87y15qrg5q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ping: thoughts on whether this is an issue?

Basil L. Contovounesios [2024-06-13 13:43 +0200] wrote:
> Yuan Fu [2024-06-11 22:38 -0700] wrote:
>>> On Jun 7, 2024, at 1:39=E2=80=AFAM, Basil L. Contovounesios <basil@cont=
ovou.net> wrote:
>>>=20
>>> Just curious: since generate-new-buffer creates a new buffer each time
>>> it is called, is it guaranteed that this buffer will eventually be GCed,
>>> once the caller of treesit-parse-string is done with it?
>>
>> Yeah, from my testing that seems to be the case.
>
> What did you try?
> I'm putting the following in an emacs -Q *scratch* buffer:
>
>   (require 'treesit)
>   (message "# of buffers before : %d" (length (buffer-list)))
>   (dotimes-with-progress-reporter (i 10000) "Parsing"
>     (treesit-parse-string "int c =3D 0;" 'c))
>   (garbage-collect)
>   (message "# of buffers after  : %d" (length (buffer-list)))
>
> Each time I M-x eval-buffer:
> - the list of buffers grows
> - the memory usage grows
> - loop iterations slow down noticeably
>
> Am I missing something?

Thanks,
--=20
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.
bug unarchived. Request was from "Basil L. Contovounesios" <basil@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug archived. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 13 Jun 2024 11:53:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 07:53:53 2024
Received: from localhost ([127.0.0.1]:46077 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sHj1d-0004BS-DW
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2024 07:53:53 -0400
Received: from mail-ej1-f49.google.com ([209.85.218.49]:39899)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <basil.conto@HIDDEN>) id 1sHj1b-0004B7-BC
 for 71012 <at> debbugs.gnu.org; Thu, 13 Jun 2024 07:53:51 -0400
Received: by mail-ej1-f49.google.com with SMTP id
 a640c23a62f3a-a6f3b629b4dso10662566b.3
 for <71012 <at> debbugs.gnu.org>; Thu, 13 Jun 2024 04:53:51 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718279626; x=1718884426;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=H1MbU7H43y7tXjpWzNYOQrqZrD3UGN5pOQ1MadkSyS0=;
 b=vDpVifrp43PSnaVqDQqN7Iiu0buKcN+g7THPMm2OaAgEMn0Z+NWSgw4TVhi7i6tWbD
 Wt5bLxBuMN+vlNoksTMvJD1Kn9azgMua+heluFmq67LnfMVMJijrLx06CfDuaWf7hB++
 JI+G2ND9j5QbEHlpDrKi6oJpuvdCoDnfXF11jykplTRecpQiR5UjJPcY19JpiY9uFlkC
 UsCbySCFUk/TW3KpCslaaQRqV9vUSRHao4YGnilOmxiVmTf2zeHQZ9WAI+mtabI3zjOJ
 8+33nlkATgHpKN0A1ApwhsogDl8fAqC+1Q4x61COdOHl1WBvYqG+lsIOj8p8/oT9wl4x
 n7dA==
X-Gm-Message-State: AOJu0YxOFM7/WIv0dyAX2EjB/PuO2sGphSxKTTnTcdPl/qANSsupCTdc
 nnODDq+j47sn4+GLoirTko4J/LH6RYKD1d7XbL7LxwrYj9cLmUF3msOJcQ==
X-Google-Smtp-Source: AGHT+IFWCWG45uJ3V/+4gmYtGHMNFxzLvAP0rgAocu2Crl9MPKDs9ZWyytZbxfwhA362Typ8PEOn6Q==
X-Received: by 2002:a17:907:1751:b0:a6f:1395:440e with SMTP id
 a640c23a62f3a-a6f5f41a7a0mr6476666b.3.1718279625778; 
 Thu, 13 Jun 2024 04:53:45 -0700 (PDT)
Received: from localhost ([2001:620:618:5c0:2:80b3:0:e5c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a6f56ed356fsm64197166b.121.2024.06.13.04.53.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jun 2024 04:53:45 -0700 (PDT)
From: "Basil L. Contovounesios" <basil@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <87r0d12hlw.fsf@HIDDEN> (Basil L. Contovounesios's message of
 "Thu, 13 Jun 2024 13:43:23 +0200")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
 <87h6e52lkw.fsf@HIDDEN>
 <C61DD1E2-375B-4029-B990-89193BB54C08@HIDDEN>
 <87r0d12hlw.fsf@HIDDEN>
Date: Thu, 13 Jun 2024 13:53:44 +0200
Message-ID: <87jzit2h4n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

By the way, this shouldn't make a big difference by default, but did you
consider calling generate-new-buffer with a non-nil optional argument (=C3=
=A0
la with-temp-buffer) in treesit-parse-string?

--=20
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 13 Jun 2024 11:43:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 07:43:33 2024
Received: from localhost ([127.0.0.1]:45483 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sHird-0003jR-84
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2024 07:43:33 -0400
Received: from mail-ed1-f50.google.com ([209.85.208.50]:38390)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <basil.conto@HIDDEN>) id 1sHirb-0003j8-RA
 for 71012 <at> debbugs.gnu.org; Thu, 13 Jun 2024 07:43:32 -0400
Received: by mail-ed1-f50.google.com with SMTP id
 4fb4d7f45d1cf-57c70940e90so125932a12.1
 for <71012 <at> debbugs.gnu.org>; Thu, 13 Jun 2024 04:43:32 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718279006; x=1718883806;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=AKF9VQLaZvvhNl3uKl7KozGlt9BA8THrisQYJgDJs8c=;
 b=WzzWv4zJNhzNf9G70IttmYlwP4fZ52vdzVveUdxDXtyJJymt9XRTbkHN7pguDIf9s/
 LfQVOCUCQHclIXKquIzh2A5QViDP8ejX5K7sxupgAwxfSDEwxjEy37MvSaUic14qXuwJ
 qieXyRbQlJGBTJCHY2Hf7i1/spqNuoYSBqdWXpL9bYbPltU+PTJzDnU9SdU5bfjcOpuB
 GH5tJb0oezSSbiLOoeZsKpPei3eo2gBifkApRjpC/wU3jn++BGQqv912CbKiOrAswV7u
 wHYUuuvIKEk+tQ7pjmESyv863Jy+ic7VlqCM6hvEeRQSBHdD02E+oHHpQSqsBc4KTRAX
 d3qw==
X-Gm-Message-State: AOJu0YzjnOKrK7XwBOrj/95LJNo6RW3dUiMXsNKEZb9rbWkbRnTvb8wc
 Fd749Gspu0sX6f78y+NdKXbhnyy1dQkXFRvL7ae75nXsF3VvmJ5w
X-Google-Smtp-Source: AGHT+IGKMBEC7XRLCYWbFIvFbCsp9tEfDIvd7d4bhrvVlxvXKa0F/iR+1nawubjredgcNtWDygOEYg==
X-Received: by 2002:a17:907:1751:b0:a6f:53cf:b45a with SMTP id
 a640c23a62f3a-a6f5f214178mr8792666b.0.1718279005999; 
 Thu, 13 Jun 2024 04:43:25 -0700 (PDT)
Received: from localhost ([2001:620:618:5c0:2:80b3:0:e5c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a6f56f4170bsm62978366b.157.2024.06.13.04.43.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 13 Jun 2024 04:43:25 -0700 (PDT)
From: "Basil L. Contovounesios" <basil@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <C61DD1E2-375B-4029-B990-89193BB54C08@HIDDEN> (Yuan Fu's
 message of "Tue, 11 Jun 2024 22:38:43 -0700")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
 <87h6e52lkw.fsf@HIDDEN>
 <C61DD1E2-375B-4029-B990-89193BB54C08@HIDDEN>
Date: Thu, 13 Jun 2024 13:43:23 +0200
Message-ID: <87r0d12hlw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Yuan Fu [2024-06-11 22:38 -0700] wrote:

>> On Jun 7, 2024, at 1:39=E2=80=AFAM, Basil L. Contovounesios <basil@conto=
vou.net> wrote:
>>=20
>> Just curious: since generate-new-buffer creates a new buffer each time
>> it is called, is it guaranteed that this buffer will eventually be GCed,
>> once the caller of treesit-parse-string is done with it?
>
> Yeah, from my testing that seems to be the case.

What did you try?
I'm putting the following in an emacs -Q *scratch* buffer:

  (require 'treesit)
  (message "# of buffers before : %d" (length (buffer-list)))
  (dotimes-with-progress-reporter (i 10000) "Parsing"
    (treesit-parse-string "int c =3D 0;" 'c))
  (garbage-collect)
  (message "# of buffers after  : %d" (length (buffer-list)))

Each time I M-x eval-buffer:
- the list of buffers grows
- the memory usage grows
- loop iterations slow down noticeably

Am I missing something?

--=20
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012-done <at> debbugs.gnu.org:


Received: (at 71012-done) by debbugs.gnu.org; 12 Jun 2024 05:39:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 01:39:32 2024
Received: from localhost ([127.0.0.1]:37354 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sHGho-00010Y-9W
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2024 01:39:32 -0400
Received: from mail-pj1-f50.google.com ([209.85.216.50]:52455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sHGhm-00010J-5G
 for 71012-done <at> debbugs.gnu.org; Wed, 12 Jun 2024 01:39:31 -0400
Received: by mail-pj1-f50.google.com with SMTP id
 98e67ed59e1d1-2c2c9199568so3972017a91.0
 for <71012-done <at> debbugs.gnu.org>; Tue, 11 Jun 2024 22:39:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1718170705; x=1718775505; 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=Nm5TD/UPbt4XIFW3aZ9AI23j+En3EhJ46SFYABmwimQ=;
 b=gc7ZwAMi0ylNH3yNcNyMox1Fddu+cCTpznOe3k9a2CBKf6zYJpx4FkHizJ/jQnQIyw
 h4SyhUfidXLkhsnJq+MnUaSXZDP5yDDw+LgGbF6BI+80M2P0uqSYu15dPqd+NOwAGGuz
 1qVAe3CZBOFw6y5vgZWDtv2owi1EwYWhL9DOdr5uGReciGbGm9NNCNBAcmzu1yWdBipu
 OLt6jLwvjne4XCT8GNvEf3+88C67rJHJjSz/OkCZIOi8xH0LRtwt2yh68JLruDDg4KOJ
 ZlZZ/Ir/Rljc5X2Yi9pAi3xoU5p2KVIoCN9vlIuGHhUgSL+JkS9Y96rLQXtuAHfEaehr
 7nRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718170705; x=1718775505;
 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=Nm5TD/UPbt4XIFW3aZ9AI23j+En3EhJ46SFYABmwimQ=;
 b=Tf8D5FfVF6Kf3qWpDavfS72AXdIMorPOwBXh2tyXVdT2UozbVA20Q41tMVSJdLbFNO
 IVtFOU436wuJaKOFstFKcSfyyYvcssUl0ATit9ZIP5PSPQ9AtgOAu5fZoVTInKy6dMZq
 RfgYtzXYZ4gjsKS8yd/JI/3ObRqIpvNvuxQxj1Zst669nZCpb8TmShPDKjLMAqOt5qrx
 2Jhs/zpWKTJHA743PY98w203kc8baNlJ9RADX912fbMZO/SVvaw3Fcuxh1m4S+tluEE9
 BnfU2QgzmiTh0MfaWZ3CJnb7MFOgVm5fKqxM9MSDC3erNUh/pMpaHwYd5Et/+l5AWft8
 nRrA==
X-Forwarded-Encrypted: i=1;
 AJvYcCW5gseNgaz05Bz7o/ScJATYj1rDJwhzfesPLtgVVg0/NfKdftmJiJZPkXUrNKfkecXeSqA32ejnAoGJ0165u55HK2O6pWwWwEWGTg==
X-Gm-Message-State: AOJu0YzuXR4crDqy/6gxTz5OS9SuDz8rMDThuUi1FzHN04AXJH+OU9C5
 eMowQB7N0Lq14fChxX6Nap1SMhjgvU0whsKQdKeND4VVgmLfTz+S
X-Google-Smtp-Source: AGHT+IHeVf1pjAE8MkNIHsZezi9yoWl3YUqceBZKMTU6uUpfJvpbGZQIfIMLb/j9eKv6Jzq2jo987g==
X-Received: by 2002:a17:90a:70ce:b0:2c4:af82:32af with SMTP id
 98e67ed59e1d1-2c4af823379mr119979a91.22.1718170705457; 
 Tue, 11 Jun 2024 22:38:25 -0700 (PDT)
Received: from smtpclient.apple ([98.47.187.88])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-2c4a762ca1dsm682995a91.48.2024.06.11.22.38.24
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 11 Jun 2024 22:38:24 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86zfrs7iz3.fsf@HIDDEN>
Date: Tue, 11 Jun 2024 22:38:13 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <6D1AB83D-19EF-4387-9461-028233E2454E@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN> <87h6e52lkw.fsf@HIDDEN>
 <87jzixi5bw.fsf@HIDDEN> <86zfrs7iz3.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 71012-done
Cc: 71012-done <at> debbugs.gnu.org, eller.helmut@HIDDEN,
 "Basil L. Contovounesios" <basil@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jun 10, 2024, at 11:25=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
>> From: "Basil L. Contovounesios" <basil@HIDDEN>
>> Date: Mon, 10 Jun 2024 10:12:51 +0200
>>=20
>> BTW, not sure if this is the right bug report, but currently on =
master I
>> see the following test failure:
>>=20
>>  make TEST_LOAD_EL=3Dno test/treesit-tests
>>  make -C test treesit-tests
>>  make[1]: Entering directory '/home/blc/.local/src/emacs/test'
>>  make[2]: Entering directory '/home/blc/.local/src/emacs/test'
>>    GEN      src/treesit-tests.log
>>  Running 28 tests (2024-06-10 10:11:18+0200, selector `(not (or (tag =
:unstable) (tag :nativecomp)))')
>>     passed   1/28  treesit-basic-parsing (0.000398 sec)
>>     passed   2/28  treesit-cross-boundary (0.000307 sec)
>>     passed   3/28  treesit-cursor-helper-with-missing-node (0.000217 =
sec)
>>  Can't guess python-indent-offset, using defaults: 4
>>     passed   4/28  treesit-defun-navigation-nested-1 (0.038371 sec)
>>     passed   5/28  treesit-defun-navigation-nested-2 (0.058591 sec)
>>     passed   6/28  treesit-defun-navigation-nested-3 (0.002775 sec)
>>     passed   7/28  treesit-defun-navigation-nested-4 (0.003478 sec)
>>  Can't guess python-indent-offset, using defaults: 4
>>     passed   8/28  treesit-defun-navigation-top-level (0.003415 sec)
>>     passed   9/28  treesit-indirect-buffer (0.000249 sec)
>>     passed  10/28  treesit-multi-lang (0.000739 sec)
>>     passed  11/28  treesit-narrow (0.000216 sec)
>>  Test treesit-node-api backtrace:
>>  make[2]: *** [Makefile:185: src/treesit-tests.log] Aborted (core =
dumped)
>>  make[2]: Leaving directory '/home/blc/.local/src/emacs/test'
>>  make[1]: *** [Makefile:251: src/treesit-tests] Error 2
>>  make[1]: Leaving directory '/home/blc/.local/src/emacs/test'
>>  make: *** [Makefile:1133: test/treesit-tests] Error 2
>>=20
>> And no treesit-tests.log file is generated.
>=20
> Mattias fixed the crash, and I then fixed the test not to fail.
>=20
> So I'm now closing this bug.

Thank you!

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 12 Jun 2024 05:40:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 12 01:40:01 2024
Received: from localhost ([127.0.0.1]:37357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sHGiG-00011N-Lz
	for submit <at> debbugs.gnu.org; Wed, 12 Jun 2024 01:40:00 -0400
Received: from mail-pf1-f181.google.com ([209.85.210.181]:45137)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sHGiF-000119-5H
 for 71012 <at> debbugs.gnu.org; Wed, 12 Jun 2024 01:39:59 -0400
Received: by mail-pf1-f181.google.com with SMTP id
 d2e1a72fcca58-7042882e741so3166072b3a.2
 for <71012 <at> debbugs.gnu.org>; Tue, 11 Jun 2024 22:40:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1718170735; x=1718775535; 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=HPyHmrZwVtK5DG8TuqAxIGW0XYK30TFBiJ/de3bs9Dg=;
 b=K+ZVzZtINUsxN/exifbV78DjC17qIwgskm0WMIVdXl0hLA5GlNxs3WmItvxeMG7P2k
 Kk3EVaajKFvC+bhKFTVpO5Yuaz8FhHKegByHIMdlHK+0tYJkP9BJLN1ajabKJtjzBNLG
 oQmJapETp/OBhYg0Fd61I3/4gGuCZsnQB0DFp+AQgzBgMmtHavD6YSAcxOkHfbLpc5YR
 8EZe9LhfvgtHbKihThdgn+r3hzb9P5bo6K/fHKlBkICE3itdhc2pHpTb1xp5HDIPGHm8
 UAVQbmvYvoDLxj3gQczbaHW5DF9xq1tay8tWKZ4RV65J/rwkyzWy9/XCdh1pKoY6xJtW
 ahTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718170735; x=1718775535;
 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=HPyHmrZwVtK5DG8TuqAxIGW0XYK30TFBiJ/de3bs9Dg=;
 b=Y2J6AC9wzk6K1g+g8faP1q4PaX6jvfxwZtIdPvmSJuzOEE5WMg+yG1SeVzM6Hvkq7v
 nnJCDkIxVanfubFu2+qsGtzDBRhd0muRDzFuVYD+VYq2CAwsgQwbpj6HBXLpZtLoL/7S
 P5lz9TXH4oRmaUVag2GfvXWRgsnhkKsp3q9H1WwmtJJrIV+adFzorI3vV8IzjKuToLyF
 TD+UOtIedmJj6vL4RbsrHdsmA/2TmYEsuJT37xO9zHHqDBupSwApVzhnrqyisP5kNcmD
 s14EcQA4n3JXngA+dsxi89QWij4J0MBPgbYXjLeKr0ntzHU6QJ59QWHC13OVWd8u05RQ
 BLew==
X-Gm-Message-State: AOJu0YwzOcVijgH5nw0tsXJKcDSMlmOGLVRZTP2IAMvAijhAaq4eHQnD
 E1R5QWxnz2GmUvBFCbhBwzigvvOuHzggWzDySbVoBxU9zdI/W0KbKyTuqA==
X-Google-Smtp-Source: AGHT+IE24ikQTNdad/jqwGn7C2EJt7L1m8MFgomnd8JT21b+ihMaj5LCOckTwXMdZlZ5t6hZ5Oca+w==
X-Received: by 2002:a05:6a20:5647:b0:1b8:5e44:ea3c with SMTP id
 adf61e73a8af0-1b8ab685d62mr828647637.48.1718170734547; 
 Tue, 11 Jun 2024 22:38:54 -0700 (PDT)
Received: from smtpclient.apple ([98.47.187.88])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-2c4a762ca1dsm682995a91.48.2024.06.11.22.38.53
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 11 Jun 2024 22:38:53 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87h6e52lkw.fsf@HIDDEN>
Date: Tue, 11 Jun 2024 22:38:43 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <C61DD1E2-375B-4029-B990-89193BB54C08@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN> <87h6e52lkw.fsf@HIDDEN>
To: "Basil L. Contovounesios" <basil@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jun 7, 2024, at 1:39=E2=80=AFAM, Basil L. Contovounesios =
<basil@HIDDEN> wrote:
>=20
> Just curious: since generate-new-buffer creates a new buffer each time
> it is called, is it guaranteed that this buffer will eventually be =
GCed,
> once the caller of treesit-parse-string is done with it?

Yeah, from my testing that seems to be the case.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012-done <at> debbugs.gnu.org:


Received: (at 71012-done) by debbugs.gnu.org; 10 Jun 2024 18:26:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 10 14:26:51 2024
Received: from localhost ([127.0.0.1]:51237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sGjjH-0007II-Hq
	for submit <at> debbugs.gnu.org; Mon, 10 Jun 2024 14:26:51 -0400
Received: from eggs.gnu.org ([209.51.188.92]:40712)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sGjjF-0007Hj-Lm
 for 71012-done <at> debbugs.gnu.org; Mon, 10 Jun 2024 14:26:50 -0400
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 <eliz@HIDDEN>)
 id 1sGjit-0006kw-1i; Mon, 10 Jun 2024 14:26:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=j3Vm8M08VoTB4Kh14t5zFccedYU+b+y6SG4fdlypDLw=; b=iEWMg0CNQ8q2
 jkZ/xXzM+6CMhSZY6yojrmGQb9I2Jhk4OYWvQEtbWZ5uNViu+rx1le8ul0DTiODTJvfsPKydzMc32
 MeMswlfvy/Y+gUQvjRQBYVBDsJVy4m7bPf0ndSvTR+raOBs5uP+sUdtLqiJJ96efBZK5w/Pyly0cZ
 2S6vY66TSnWzqOiO6MnYH27rH++BfQJ3XuzAgFNNz67Z+NdnVG6Xm2iQCt3rXymXFvamc4PxcAQhQ
 DlR1L5oOMyFGFUkt7TPdBtj8S6HLcqVpBgGCRc4TmhauwpRckL5maj4Jh61nmecqxiqpWmo0IH385
 mIDFQ1Vf9KM1LqniDsv8lw==;
Date: Mon, 10 Jun 2024 21:25:52 +0300
Message-Id: <86zfrs7iz3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Basil L. Contovounesios" <basil@HIDDEN>
In-Reply-To: <87jzixi5bw.fsf@HIDDEN> (basil@HIDDEN)
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
 <87h6e52lkw.fsf@HIDDEN> <87jzixi5bw.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71012-done
Cc: casouri@HIDDEN, eller.helmut@HIDDEN, 71012-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
> From: "Basil L. Contovounesios" <basil@HIDDEN>
> Date: Mon, 10 Jun 2024 10:12:51 +0200
> 
> BTW, not sure if this is the right bug report, but currently on master I
> see the following test failure:
> 
>   make TEST_LOAD_EL=no test/treesit-tests
>   make -C test treesit-tests
>   make[1]: Entering directory '/home/blc/.local/src/emacs/test'
>   make[2]: Entering directory '/home/blc/.local/src/emacs/test'
>     GEN      src/treesit-tests.log
>   Running 28 tests (2024-06-10 10:11:18+0200, selector `(not (or (tag :unstable) (tag :nativecomp)))')
>      passed   1/28  treesit-basic-parsing (0.000398 sec)
>      passed   2/28  treesit-cross-boundary (0.000307 sec)
>      passed   3/28  treesit-cursor-helper-with-missing-node (0.000217 sec)
>   Can't guess python-indent-offset, using defaults: 4
>      passed   4/28  treesit-defun-navigation-nested-1 (0.038371 sec)
>      passed   5/28  treesit-defun-navigation-nested-2 (0.058591 sec)
>      passed   6/28  treesit-defun-navigation-nested-3 (0.002775 sec)
>      passed   7/28  treesit-defun-navigation-nested-4 (0.003478 sec)
>   Can't guess python-indent-offset, using defaults: 4
>      passed   8/28  treesit-defun-navigation-top-level (0.003415 sec)
>      passed   9/28  treesit-indirect-buffer (0.000249 sec)
>      passed  10/28  treesit-multi-lang (0.000739 sec)
>      passed  11/28  treesit-narrow (0.000216 sec)
>   Test treesit-node-api backtrace:
>   make[2]: *** [Makefile:185: src/treesit-tests.log] Aborted (core dumped)
>   make[2]: Leaving directory '/home/blc/.local/src/emacs/test'
>   make[1]: *** [Makefile:251: src/treesit-tests] Error 2
>   make[1]: Leaving directory '/home/blc/.local/src/emacs/test'
>   make: *** [Makefile:1133: test/treesit-tests] Error 2
> 
> And no treesit-tests.log file is generated.

Mattias fixed the crash, and I then fixed the test not to fail.

So I'm now closing this bug.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 10 Jun 2024 08:42:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 10 04:42:32 2024
Received: from localhost ([127.0.0.1]:45912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sGabo-00041J-Ei
	for submit <at> debbugs.gnu.org; Mon, 10 Jun 2024 04:42:32 -0400
Received: from mail-lj1-f169.google.com ([209.85.208.169]:40243)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <basil.conto@HIDDEN>) id 1sGabm-00040o-Ov
 for 71012 <at> debbugs.gnu.org; Mon, 10 Jun 2024 04:42:31 -0400
Received: by mail-lj1-f169.google.com with SMTP id
 38308e7fff4ca-2ebd590a79cso481001fa.1
 for <71012 <at> debbugs.gnu.org>; Mon, 10 Jun 2024 01:42:13 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718008928; x=1718613728;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=CShEhpCBeiisZ29cvV5QiOOHAEEuwkd3gEisx+m1e5I=;
 b=eoJZl858mVpvsj2jvAByHyu9cXQAmldM6DOyEHmpPfbjds+rw60W/oMm0JpbLxi3jl
 /UUHEHhpbuvLqvmZbgAIkLL0kpmiHwiXvRENjTda+7P4IuW5NN7eFtuJXvIyboEyOPwi
 hICzMtOq0J2LMwmMyQPFrX5XZEVPO8c0AfGERwH8BC0/r4WeQX8Os9X+2D+wMpCm0DRl
 HbCBNDbTPEOmcibSZJR6l6OBxV2DUlyBGMis3KxXCDyBqPqQl/+d6WHkyWINIZf6ZwUJ
 yq7W/wyiNg63C2Gk7z4Dqqvk0sP0zedMZkQ5A7F4AzoDG8V7eUwz0K18vzP8sKya++Kk
 N8Og==
X-Gm-Message-State: AOJu0YxkZ9ojPVSJpFvSSLOjY2wYNET/rjfP9MqB3RYonyIc+I3voOmD
 1ozh2xHK/XrIqrCFE5KvglTKBFoJxEESJJUH4pGuYkLj+EfFDQzJ0U9Epg==
X-Google-Smtp-Source: AGHT+IERLkeW+yEioC9zRIIAaFTsVtewMwpFRuVUnumQImWsT4ty6kArwxOKFlxxK+bLb95J6S4rJQ==
X-Received: by 2002:a17:906:b07:b0:a6e:f419:5456 with SMTP id
 a640c23a62f3a-a6ef4195592mr385784466b.6.1718007173128; 
 Mon, 10 Jun 2024 01:12:53 -0700 (PDT)
Received: from localhost ([2001:620:618:5c0:2:80b3:0:e5c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a6efb27aa95sm355715866b.11.2024.06.10.01.12.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 10 Jun 2024 01:12:52 -0700 (PDT)
From: "Basil L. Contovounesios" <basil@HIDDEN>
To: casouri@HIDDEN
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <87h6e52lkw.fsf@HIDDEN> (Basil L. Contovounesios's message of
 "Fri, 07 Jun 2024 10:39:27 +0200")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
 <87h6e52lkw.fsf@HIDDEN>
Date: Mon, 10 Jun 2024 10:12:51 +0200
Message-ID: <87jzixi5bw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

BTW, not sure if this is the right bug report, but currently on master I
see the following test failure:

  make TEST_LOAD_EL=no test/treesit-tests
  make -C test treesit-tests
  make[1]: Entering directory '/home/blc/.local/src/emacs/test'
  make[2]: Entering directory '/home/blc/.local/src/emacs/test'
    GEN      src/treesit-tests.log
  Running 28 tests (2024-06-10 10:11:18+0200, selector `(not (or (tag :unstable) (tag :nativecomp)))')
     passed   1/28  treesit-basic-parsing (0.000398 sec)
     passed   2/28  treesit-cross-boundary (0.000307 sec)
     passed   3/28  treesit-cursor-helper-with-missing-node (0.000217 sec)
  Can't guess python-indent-offset, using defaults: 4
     passed   4/28  treesit-defun-navigation-nested-1 (0.038371 sec)
     passed   5/28  treesit-defun-navigation-nested-2 (0.058591 sec)
     passed   6/28  treesit-defun-navigation-nested-3 (0.002775 sec)
     passed   7/28  treesit-defun-navigation-nested-4 (0.003478 sec)
  Can't guess python-indent-offset, using defaults: 4
     passed   8/28  treesit-defun-navigation-top-level (0.003415 sec)
     passed   9/28  treesit-indirect-buffer (0.000249 sec)
     passed  10/28  treesit-multi-lang (0.000739 sec)
     passed  11/28  treesit-narrow (0.000216 sec)
  Test treesit-node-api backtrace:
  make[2]: *** [Makefile:185: src/treesit-tests.log] Aborted (core dumped)
  make[2]: Leaving directory '/home/blc/.local/src/emacs/test'
  make[1]: *** [Makefile:251: src/treesit-tests] Error 2
  make[1]: Leaving directory '/home/blc/.local/src/emacs/test'
  make: *** [Makefile:1133: test/treesit-tests] Error 2

And no treesit-tests.log file is generated.

-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 7 Jun 2024 08:39:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 07 04:39:53 2024
Received: from localhost ([127.0.0.1]:35893 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sFV8b-0006mO-4I
	for submit <at> debbugs.gnu.org; Fri, 07 Jun 2024 04:39:53 -0400
Received: from mail-ej1-f47.google.com ([209.85.218.47]:40847)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <basil.conto@HIDDEN>) id 1sFV8Y-0006lz-K6
 for 71012 <at> debbugs.gnu.org; Fri, 07 Jun 2024 04:39:51 -0400
Received: by mail-ej1-f47.google.com with SMTP id
 a640c23a62f3a-a6ee5995549so1057166b.3
 for <71012 <at> debbugs.gnu.org>; Fri, 07 Jun 2024 01:39:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717749568; x=1718354368;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=OwGMtgYpwE29ZB8pMPshHdlOaJoh+PIfIxtngMYsWqQ=;
 b=wnDm7Pqy6nV8PesPz+MmkyvyxldogqhjyYYGU+hPFjQpbtJeQeVwbS+4Qn5hOQuwOT
 xMB/bKMTMdNAl0XolWShRsyaVwbNGjH34Z5NJ6AxgLX7Fd/Pu1pJIPkOPA3Q+9Gh4WnQ
 yQvJNNUciWhY/NaVafpfvPhAHf2+KeNuMX+PAWgHq0p9E0aLeh7wOgAjN8bkjTg9haP6
 rNVDlyLCrS7Uw1++HTNoIFTCW87DGOlY3TlKhaUAY0UX2AXA6pqxxE/N9FTFxchyQIL1
 zg/Hhjvlr91d3smoToFEhq3h4aVi8jCXeHCrVi1E9pk0D/rEUzNId+VxA756gYixe7Io
 42Lg==
X-Gm-Message-State: AOJu0YxqjuCEtenhMl6lgFiUP4WSRWXE+0xj937unKy5e/gTnPkv6FfD
 0qZDkAEFs8216J5B99tY3f+Y5gTesh0aBVPTNgvtI+ElMWQams+AY8MZmg==
X-Google-Smtp-Source: AGHT+IEh/T5bm9KFbjM2kFiJn2USsnHrcIuQ+pfdCcsUww6v/ZnHyvSB+BkQgbv2Msll2kiDigplFQ==
X-Received: by 2002:a17:906:fd85:b0:a67:a2e0:9dd9 with SMTP id
 a640c23a62f3a-a6cd561889emr157763066b.2.1717749568235; 
 Fri, 07 Jun 2024 01:39:28 -0700 (PDT)
Received: from localhost ([2001:620:618:5c0:2:80b3:0:65c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a6c8070e2cesm209203566b.163.2024.06.07.01.39.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jun 2024 01:39:27 -0700 (PDT)
From: "Basil L. Contovounesios" <basil@HIDDEN>
To: 71012 <at> debbugs.gnu.org
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN> (Yuan Fu's
 message of "Wed, 5 Jun 2024 22:31:04 -0700")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
 <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
 <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
Date: Fri, 07 Jun 2024 10:39:27 +0200
Message-ID: <87h6e52lkw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 71012
Cc: casouri@HIDDEN, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Just curious: since generate-new-buffer creates a new buffer each time
it is called, is it guaranteed that this buffer will eventually be GCed,
once the caller of treesit-parse-string is done with it?

Thanks,
-- 
Basil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012-done <at> debbugs.gnu.org:


Received: (at 71012-done) by debbugs.gnu.org; 6 Jun 2024 05:32:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 06 01:32:38 2024
Received: from localhost ([127.0.0.1]:39340 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sF5jp-0007Rf-Tt
	for submit <at> debbugs.gnu.org; Thu, 06 Jun 2024 01:32:38 -0400
Received: from mail-pg1-f171.google.com ([209.85.215.171]:59665)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sF5jo-0007RO-Oi
 for 71012-done <at> debbugs.gnu.org; Thu, 06 Jun 2024 01:32:37 -0400
Received: by mail-pg1-f171.google.com with SMTP id
 41be03b00d2f7-6c9d747be82so456534a12.3
 for <71012-done <at> debbugs.gnu.org>; Wed, 05 Jun 2024 22:32:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717651876; x=1718256676; 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=Aqsd1CAKzELC33JPInqAgdOCX2SBPajPMSX1A10fsKo=;
 b=H/kn+QpB+Q3MMeK1qI8m69n+tw5rc/Pe6lnEOkGpFdBAXeIX94WLwbM5BG8dQAql2J
 HMjhwmSM/Ap2/GsTRu9nOCDXWYNjtQYIEhMc2BzcwY2ES4EerTMhKAY7hMzcIpu8gJA0
 E9yWgmdLZtJPt12CheloUvwYAw5b/MUMANmxDqV9I3Kor3qGYiGFnuTZOOo3/NvVY5u0
 8u0sCxM258T1emNrE6bv8id7MWKTBlRn22R/qqwj8FWWRob9krm2ODpeKuvU7QqsnCpa
 36jtQOvgnT4wr78jXpVJLxlp2LbffUEGILlobenZqEiTnIGA5XOR6aAK80Qt4hKGDlWD
 n8ng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717651876; x=1718256676;
 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=Aqsd1CAKzELC33JPInqAgdOCX2SBPajPMSX1A10fsKo=;
 b=ppcgKSP29VCiKU03Z/CkyST7LaKqUykr7mummijcQMk+JmuQQqrK86KAvTddvPDNyX
 /PC/nzYaP8ooT9V54YUlIEVsAz4uTDfe6CMDVC54L1XfCvgocNCHNA4bFwXYpR01XmZQ
 cZegjjo2bpArRZGrBvhMrGyAzMYheQAns7y9fZw/8+kD53+qp+bku7ZdpuEt7ufWadxd
 ixYza9RQ4MslO6n7PONG7BxCc2sQICvbezlk+20x3SiJchG51jh/M0HAorUVQIUiD48m
 rWEF9c/uOTN8Vwe3PLJtmIEWNGS5c1ldk6psLAo6WM/kO6AkET6LnR8mkoZjcaRm3Jbr
 KuuA==
X-Forwarded-Encrypted: i=1;
 AJvYcCUWHpOuW/wF3GQBMkDxn9ng5vhPegJz+Q/qL/WKca20iU/2amwn2axlHEniJ3AL7e4XJDL9lK58+gYcgJMWurqeRNOOnm2fcEy12A==
X-Gm-Message-State: AOJu0Yxufz8nlk+gZrmomL3ryc8NWz5M+SNRfCT0sQpuGGUVvrVgeBFf
 wJdoN3l5/5HnKii4IJ2dlbqxnNy2jsK7SDWOodun38eY22cJlnm9nnJYdw==
X-Google-Smtp-Source: AGHT+IEiCfpDK7GGsvWhCYI1mMBLHvRus2y4Xb2XEECuqftbHdAL3J7WkG+L4HnNMx+LBjaukK9qxA==
X-Received: by 2002:a05:6a20:3caa:b0:1b1:d400:1967 with SMTP id
 adf61e73a8af0-1b2b715fd1emr5612650637.53.1717651876311; 
 Wed, 05 Jun 2024 22:31:16 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:8f81:f810:6d47:6e61:bc5f:51a3])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-1f6bd7e30a9sm4970965ad.198.2024.06.05.22.31.15
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 05 Jun 2024 22:31:15 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
Date: Wed, 5 Jun 2024 22:31:04 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <792DB4FC-EB1E-4094-A4CF-14500DDA82C1@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
 <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012-done
Cc: 71012-done <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jun 1, 2024, at 10:43=E2=80=AFAM, Yuan Fu <casouri@HIDDEN> =
wrote:
>=20
>=20
>=20
>> On Jun 1, 2024, at 10:15=E2=80=AFAM, Yuan Fu <casouri@HIDDEN> =
wrote:
>>=20
>>=20
>>=20
>>> On May 29, 2024, at 5:28=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>>>=20
>>>> From: Yuan Fu <casouri@HIDDEN>
>>>> Date: Tue, 28 May 2024 22:15:05 -0700
>>>> Cc: Helmut Eller <eller.helmut@HIDDEN>,
>>>> 71012 <at> debbugs.gnu.org
>>>>=20
>>>> =46rom what I can gather, the crash seems to be because the temp =
buffer is garbage collected=E2=80=94the inserted lisp.h is a large file, =
so the temp buffer is probably immediately collected, before Emacs tries =
to print the node in the next line. I replaced the insert-file-content =
with some smaller file and it didn=E2=80=99t crash.
>>>=20
>>> It is unthinkable that a buffer is GC'ed while it is being used.
>>>=20
>>>> But that theory has critical flaws: a) Emacs certainly doesn't =
collect the temp buffer before the with-temp-buffer form returns; b) I =
can=E2=80=99t crash Emacs in my non-debug build by inserting =
(garbage-collect) in front of the message line in the example; c) debug =
build Emacs still crashes even if I enlarge gc-cons-threshold.
>>>>=20
>>>> Eli, is there anything different regarding temp buffers in debug =
builds?
>>>=20
>>> No.
>>>=20
>>> But note that there are _two_ temporary buffers involved here: one =
is
>>> created in ts-bug.el, and it remains intact and valid; the other is
>>> the temporary buffer created by treesit-parse-string.  That one is
>>> killed by the time treesit-parse-string returns, so =
treesit-node-start
>>> attempts to access positions of a killed buffer!
>>>=20
>>> So I think this is a bug in treesit-parse-string: it cannot use
>>> with-temp-buffer; instead, it should make the buffer into which it
>>> inserts the string part of the parser, so that the buffer is killed
>>> and GC'ed only when the parser is no longer referenced.  Otherwise =
the
>>> syntax tree returned by treesit-parse-string is unsafe to use.
>>=20
>> I see, you=E2=80=99re absolutely right, thanks for the analysis! On =
top of that I need to make sure all the treesit function checks for =
buffer liveness before accessing the buffer. I was under the impression =
that a killed buffer would keep its content around until it=E2=80=99s =
collected. Turns out that wasn=E2=80=99t the case.
>>=20
>> Yuan
>=20
> Pushed the fix to emacs-29.
>=20
> Yuan
>=20

The fix works for me so I=E2=80=99m closing this report. Feel free to =
followup if new problems occur :-)

Yuan





Notification sent to Helmut Eller <eller.helmut@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Yuan Fu <casouri@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 1 Jun 2024 17:45:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 01 13:45:06 2024
Received: from localhost ([127.0.0.1]:57338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sDSmv-0003xn-Is
	for submit <at> debbugs.gnu.org; Sat, 01 Jun 2024 13:45:05 -0400
Received: from mail-pl1-f169.google.com ([209.85.214.169]:42446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sDSmt-0003wz-Ba
 for 71012 <at> debbugs.gnu.org; Sat, 01 Jun 2024 13:45:04 -0400
Received: by mail-pl1-f169.google.com with SMTP id
 d9443c01a7336-1f4a5344ec7so22929385ad.1
 for <71012 <at> debbugs.gnu.org>; Sat, 01 Jun 2024 10:44:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717263826; x=1717868626; 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=50CGOYjcQ3yfkMFf/wrLgeUBU21apmMW2DWSQOUBupQ=;
 b=ISvzxUABufPUqtdyaUGMgjCT3Oybc0G06S8A9HP40lurNfJmotJc1Cpc4D2fo+5NjV
 RIK2yYycKEtaF3dE/8PTc3QMHckVYvqTVQN8dVWTyHUpKU1571ci+MjVS/5TDqeMU5U3
 J+2W/txmOj34yXxBZDVzHDKUZ8yU74RSMgUHpkwiazuYwN/McKNmfXD6vGolOE3FaURn
 7ptEoireGuPQmd+ipdPb3n6Y8AhL4/WQ+LxJd2FrOaJn4E0XUr4aIGDpwgESmgVD0EKF
 DL8dON0OarRuN+2rd8KcHx8q5ZJx7QRg9503etQwf+d4UscGK78C9Zdr1WwqdX0+l4V7
 0V+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717263826; x=1717868626;
 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=50CGOYjcQ3yfkMFf/wrLgeUBU21apmMW2DWSQOUBupQ=;
 b=R66Wc2teoNKzJicl5Z8uvmeOgSlBW2ONCpTJMgWDZVbbHC3kGMspVDKzNdot5frmSR
 0jic9ZBTjiw3N8l7uCOUcx4ZN0xv+C+AJFiSfGAMpnWuvmrhnNIqVxK+mi4MeRFNFlY5
 MHiK41vIoH6hVBtjgk7+h8dMm1gc95RjY5ZulNDeL3OzAmXeXniW4mQcVQVcJJIlGO3c
 dIeToygsuEG0y8C0gDEs48jQq5K1PhLWl4L24Lwc6omVoDHmowWsDi6eHU3biIbn2GHh
 egdkycB6xgn8hlPA3BGdWND0yGGsPtxQOBFISbaSmyRl5bTGD5PxNZdNxdRdfiNdWCm5
 9vhA==
X-Forwarded-Encrypted: i=1;
 AJvYcCWt3EUJ5CGSbkHmwRKlu5E36wYLX6p5f3Ngru5jVj5SHzOVQtQYTw4Rq0bkIKVb9g/JjEk7va0SI6isK+IT/GqIt/GYFbQ=
X-Gm-Message-State: AOJu0YwlcmciUF2WAn9LLAvbZgvI7lpw+ZA6a9TbecYcSpHiwIxPzmPd
 A/12wMVuq6Upr4rl2EKOiljGOx0vNtzJ6Lp6GohyUUX0qEja56DYyurxxw==
X-Google-Smtp-Source: AGHT+IEmygYnC4a872QtygqMa/3BcQJbKjj5NuKlPCzHKUuf2rzktfwhaXmBUW1ePpTE9baeehTbpw==
X-Received: by 2002:a17:902:c401:b0:1f0:8cbf:c1b5 with SMTP id
 d9443c01a7336-1f6359c9c78mr84183425ad.16.1717263825614; 
 Sat, 01 Jun 2024 10:43:45 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:8f81:f810:8583:e600:bd04:ee0f])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-1f63232f1b0sm35376485ad.32.2024.06.01.10.43.44
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 01 Jun 2024 10:43:44 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
Date: Sat, 1 Jun 2024 10:43:33 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <DABEECD0-1B76-4450-B14F-4957FC4B017E@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> <86zfs8ssyj.fsf@HIDDEN>
 <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Jun 1, 2024, at 10:15=E2=80=AFAM, Yuan Fu <casouri@HIDDEN> =
wrote:
>=20
>=20
>=20
>> On May 29, 2024, at 5:28=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>>=20
>>> From: Yuan Fu <casouri@HIDDEN>
>>> Date: Tue, 28 May 2024 22:15:05 -0700
>>> Cc: Helmut Eller <eller.helmut@HIDDEN>,
>>> 71012 <at> debbugs.gnu.org
>>>=20
>>> =46rom what I can gather, the crash seems to be because the temp =
buffer is garbage collected=E2=80=94the inserted lisp.h is a large file, =
so the temp buffer is probably immediately collected, before Emacs tries =
to print the node in the next line. I replaced the insert-file-content =
with some smaller file and it didn=E2=80=99t crash.
>>=20
>> It is unthinkable that a buffer is GC'ed while it is being used.
>>=20
>>> But that theory has critical flaws: a) Emacs certainly doesn't =
collect the temp buffer before the with-temp-buffer form returns; b) I =
can=E2=80=99t crash Emacs in my non-debug build by inserting =
(garbage-collect) in front of the message line in the example; c) debug =
build Emacs still crashes even if I enlarge gc-cons-threshold.
>>>=20
>>> Eli, is there anything different regarding temp buffers in debug =
builds?
>>=20
>> No.
>>=20
>> But note that there are _two_ temporary buffers involved here: one is
>> created in ts-bug.el, and it remains intact and valid; the other is
>> the temporary buffer created by treesit-parse-string.  That one is
>> killed by the time treesit-parse-string returns, so =
treesit-node-start
>> attempts to access positions of a killed buffer!
>>=20
>> So I think this is a bug in treesit-parse-string: it cannot use
>> with-temp-buffer; instead, it should make the buffer into which it
>> inserts the string part of the parser, so that the buffer is killed
>> and GC'ed only when the parser is no longer referenced.  Otherwise =
the
>> syntax tree returned by treesit-parse-string is unsafe to use.
>=20
> I see, you=E2=80=99re absolutely right, thanks for the analysis! On =
top of that I need to make sure all the treesit function checks for =
buffer liveness before accessing the buffer. I was under the impression =
that a killed buffer would keep its content around until it=E2=80=99s =
collected. Turns out that wasn=E2=80=99t the case.
>=20
> Yuan

Pushed the fix to emacs-29.

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 1 Jun 2024 17:16:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 01 13:16:52 2024
Received: from localhost ([127.0.0.1]:57325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sDSLc-0003Fq-0V
	for submit <at> debbugs.gnu.org; Sat, 01 Jun 2024 13:16:52 -0400
Received: from mail-pf1-f179.google.com ([209.85.210.179]:42293)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sDSLZ-0003Fd-I1
 for 71012 <at> debbugs.gnu.org; Sat, 01 Jun 2024 13:16:51 -0400
Received: by mail-pf1-f179.google.com with SMTP id
 d2e1a72fcca58-70260814b2dso132336b3a.1
 for <71012 <at> debbugs.gnu.org>; Sat, 01 Jun 2024 10:16:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1717262132; x=1717866932; 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=rolcEmHMnP+WAQI14Tnt8qzPar/XKjANIrvyAH34314=;
 b=JDWXVJCXqI+HKuzCgpxJT+Eg28o5igko2fF6P1rTyhdDWU8I/gOz4b62xUedATwzM7
 hUQlYR8PC47+1WBY4XKHFh6WUpt2q4ZFNYe6uBmoWkTW9yI1d5VlMVkILki/+AQXmKdX
 pQaUNA3bZwurHwLUXHbGk7CmVGDrahdkJWQb3wPBi0G4+EtJUclere1CVMKUY7ddILGe
 psknIT/Ua7oPvMvUsVwLxa6wRj1evs+gBBHA22WpOSILQsdH14D2EgUO5mPol3IxDeVC
 yTeNQh6AB+HkUJXlUyTyrTmHvXNE/DOA/6V3932OMAwUqysZsS5BPxsUSrQS0GA1dnc8
 WwDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1717262132; x=1717866932;
 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=rolcEmHMnP+WAQI14Tnt8qzPar/XKjANIrvyAH34314=;
 b=HV0zn0jwbg7XF9OMjehJrpU29N3RjuixQa1rTpa9qcv7A2m7apeiuLz48vtHOfPnWL
 x07MbF+Re64xdIcwdVPU2VneDhNm5ahDK4k1PhrAp9+D9UlDnQdBNRayR5G9ZBmd477S
 Gp+oxe6sg1Tph4jo1pxPAUIDwzzmz6UFlRmBuV6K1OXVelGfXLxtKPy51TEhDe6vaqpC
 OzFD+ncEFmCgvej7An0jx7mB9vVlf/9o422LbWVeGgvxA5PmoacKH4+VsgyZHm6v/3BV
 74Ckh15bMO07DNea1koV4rnqq5/ZsBkKbxSUKWo6xpuAUekppGrMh3fqyZuHjYw+SYAK
 mESw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUeebEXCZCdKWI+j/Zwvd/1XhabFlDhtbLqujyAKQWJV2GJyJwm3bRxGKLIrWtcx95t9Y8YXut5q4Jb47SedYcbAeJWtrw=
X-Gm-Message-State: AOJu0YymAzMbEv/8qFjE3/HqpRKIVaTAcIXWbjjVNZdw9gvzwy3g07Cr
 N2JCGagqBlN8wCgKEPlTT9l1aJGQYzb2WT669cGBey0mezpzAEtd
X-Google-Smtp-Source: AGHT+IGOStR9wCT64Xv2n/Ifawfn6qBz7tzq4hI2WOJBCsoU0bUEhTe8ZESxyIe28Su9+3fK/OrgOw==
X-Received: by 2002:a05:6a20:5601:b0:1ac:dead:68 with SMTP id
 adf61e73a8af0-1b26f253aaamr5755537637.24.1717262131750; 
 Sat, 01 Jun 2024 10:15:31 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:8f81:f810:8583:e600:bd04:ee0f])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7025a955dd1sm1001922b3a.64.2024.06.01.10.15.30
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 01 Jun 2024 10:15:31 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86zfs8ssyj.fsf@HIDDEN>
Date: Sat, 1 Jun 2024 10:15:20 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <6FC1345F-B7CE-4A95-84BA-E559D5A963E1@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> <86zfs8ssyj.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On May 29, 2024, at 5:28=E2=80=AFAM, Eli Zaretskii <eliz@HIDDEN> =
wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Tue, 28 May 2024 22:15:05 -0700
>> Cc: Helmut Eller <eller.helmut@HIDDEN>,
>> 71012 <at> debbugs.gnu.org
>>=20
>> =46rom what I can gather, the crash seems to be because the temp =
buffer is garbage collected=E2=80=94the inserted lisp.h is a large file, =
so the temp buffer is probably immediately collected, before Emacs tries =
to print the node in the next line. I replaced the insert-file-content =
with some smaller file and it didn=E2=80=99t crash.
>=20
> It is unthinkable that a buffer is GC'ed while it is being used.
>=20
>> But that theory has critical flaws: a) Emacs certainly doesn't =
collect the temp buffer before the with-temp-buffer form returns; b) I =
can=E2=80=99t crash Emacs in my non-debug build by inserting =
(garbage-collect) in front of the message line in the example; c) debug =
build Emacs still crashes even if I enlarge gc-cons-threshold.
>>=20
>> Eli, is there anything different regarding temp buffers in debug =
builds?
>=20
> No.
>=20
> But note that there are _two_ temporary buffers involved here: one is
> created in ts-bug.el, and it remains intact and valid; the other is
> the temporary buffer created by treesit-parse-string.  That one is
> killed by the time treesit-parse-string returns, so treesit-node-start
> attempts to access positions of a killed buffer!
>=20
> So I think this is a bug in treesit-parse-string: it cannot use
> with-temp-buffer; instead, it should make the buffer into which it
> inserts the string part of the parser, so that the buffer is killed
> and GC'ed only when the parser is no longer referenced.  Otherwise the
> syntax tree returned by treesit-parse-string is unsafe to use.

I see, you=E2=80=99re absolutely right, thanks for the analysis! On top =
of that I need to make sure all the treesit function checks for buffer =
liveness before accessing the buffer. I was under the impression that a =
killed buffer would keep its content around until it=E2=80=99s =
collected. Turns out that wasn=E2=80=99t the case.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 29 May 2024 12:29:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 29 08:29:00 2024
Received: from localhost ([127.0.0.1]:59909 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCIQB-0005hm-RB
	for submit <at> debbugs.gnu.org; Wed, 29 May 2024 08:29:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38632)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sCIQ3-0005hE-KH
 for 71012 <at> debbugs.gnu.org; Wed, 29 May 2024 08:28:47 -0400
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 <eliz@HIDDEN>)
 id 1sCIPn-0004Bx-ES; Wed, 29 May 2024 08:28:23 -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=NPngea3dDuOEpY3oFKfSKP3ds6lCdXuI/Zc2XAq/tLI=; b=Xh18jKfcfm3fWcjr8Fi0
 y7oUYnvh79CD5CSq4TuN0xb4O0TKcxDpyP3yarKuZD0crP4MGaK9KVPFv1rq/+QgWnoEy8MqlPX6u
 s7QnDbEiOrgAfR5Kd7MEZMKWW3LUOaJo/2+LSHZSkzJ1XLuw0TmDqG8MOsS2gCr+lHW+Jbn52C148
 JZXkmR+nCa+BOQC/44HvC7fB/BR2VQvBftezYw2WIdvF/5CCA46NtazzR1I5oLFFZRImmemfAKWdW
 Si0q+cborXPLF/fw9nrB7r3uffgdsS+DjmTuZKEwuMoe11cOspxUZOb137/7RLZPMV11UZpJd3vb4
 ISiMpI7E9otW8A==;
Date: Wed, 29 May 2024 15:28:20 +0300
Message-Id: <86zfs8ssyj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN> (message from
 Yuan Fu on Tue, 28 May 2024 22:15:05 -0700)
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
 <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, eller.helmut@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Tue, 28 May 2024 22:15:05 -0700
> Cc: Helmut Eller <eller.helmut@HIDDEN>,
>  71012 <at> debbugs.gnu.org
> 
> From what I can gather, the crash seems to be because the temp buffer is garbage collected—the inserted lisp.h is a large file, so the temp buffer is probably immediately collected, before Emacs tries to print the node in the next line. I replaced the insert-file-content with some smaller file and it didn’t crash.

It is unthinkable that a buffer is GC'ed while it is being used.

> But that theory has critical flaws: a) Emacs certainly doesn't collect the temp buffer before the with-temp-buffer form returns; b) I can’t crash Emacs in my non-debug build by inserting (garbage-collect) in front of the message line in the example; c) debug build Emacs still crashes even if I enlarge gc-cons-threshold.
> 
> Eli, is there anything different regarding temp buffers in debug builds?

No.

But note that there are _two_ temporary buffers involved here: one is
created in ts-bug.el, and it remains intact and valid; the other is
the temporary buffer created by treesit-parse-string.  That one is
killed by the time treesit-parse-string returns, so treesit-node-start
attempts to access positions of a killed buffer!

So I think this is a bug in treesit-parse-string: it cannot use
with-temp-buffer; instead, it should make the buffer into which it
inserts the string part of the parser, so that the buffer is killed
and GC'ed only when the parser is no longer referenced.  Otherwise the
syntax tree returned by treesit-parse-string is unsafe to use.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 29 May 2024 05:16:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 29 01:16:36 2024
Received: from localhost ([127.0.0.1]:45811 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sCBfw-0005R6-Gy
	for submit <at> debbugs.gnu.org; Wed, 29 May 2024 01:16:36 -0400
Received: from mail-pf1-f174.google.com ([209.85.210.174]:48421)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sCBfu-0005Qn-Ub
 for 71012 <at> debbugs.gnu.org; Wed, 29 May 2024 01:16:35 -0400
Received: by mail-pf1-f174.google.com with SMTP id
 d2e1a72fcca58-6f693306b7cso1511216b3a.1
 for <71012 <at> debbugs.gnu.org>; Tue, 28 May 2024 22:16:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716959718; x=1717564518; 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=Z3A+UQS8RnnwMyOky4XodMO9pqjpfTij8Mzy4PMzJrA=;
 b=dXdgpMGwCU18uqar63J/2vEyxbFl3u+L93D/rIF4wxsefWo/79tLa2RsJRE2nDWIpB
 qL0FV7TSZ6pf1OUQpjNPFXBIyHY3aDPfnrWOYw2O05wvQwEMUeE/cINZR3eIH0lpZbfZ
 oQDkWJ/IvDlTXxdrwk+tmAvflFS/SOjHzPAO83wxsM6sW5WI5UmgDdMW6pgC/aTmNyjZ
 LgDWeQOejgq0OmS+nZ1Vj+fg1Y4FF1CGXAoV7SHw9J/2szvj90xU4YFtw+iY5oIAWO8j
 yk2C9zUb1+T7jMn+YK7pCOrQaqERdd3Qg1q92lsMiGB//H5R0FuVDLR2zVkziK3stnR3
 EimQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716959718; x=1717564518;
 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=Z3A+UQS8RnnwMyOky4XodMO9pqjpfTij8Mzy4PMzJrA=;
 b=QDInKEviTyS8jKj5zX9CptKCoiljglGUcslNx7Wzi3EuraHbxqAOgnOSN8FoVeYrh0
 /BOKs1E2WVHNQu0yTOW2RelffdhdYxxXkDlP9HGbsKrZ7ueuw9sHWTewtCtOhjsRLXoi
 8PtAK3uZL1C4ftZyPd8Dn25H5v/wSEsdShMg85EO/HbGJ0L+4UQFt/W4vCcb08fRmLir
 qTaG9jVg6sGeJJ6PR8zcMyi4NVRg8M3aEelzo8kpfDkUMsoN3D+Oxudq7a3Rke4OKjje
 zf/fxo+16eZJuMf+UvXMNp7S6FCb/SRkIJUqtwyrPEp8f9A6kihkWqVsPzvvsphK0XGI
 chpA==
X-Forwarded-Encrypted: i=1;
 AJvYcCXqxMtw0FVQS9WZhpw8EjM3ruRfOBDdRlcm4scEMfvNEAr4HomVEnMB1odREeEsJpu+nVWmxjDQtZLgJCmltx78n+/W8zc=
X-Gm-Message-State: AOJu0Yzz0k8BxDRGldHkL9Sz92Fry4wSGt0KIRrQxld2PQXjU1vCIU2N
 alml0Eg++e90prkPJicV57nnFeuoXaJ7OcZ0jzvCFcq1hL7KskHM
X-Google-Smtp-Source: AGHT+IH1zAEH/JcbB0q2YxhTnJZIr1JPGHKECF9CDk/gnm47TIzR7rmTEpJc5xqq4lFKzyBnfVznhA==
X-Received: by 2002:a05:6a00:450a:b0:6ea:74d4:a01c with SMTP id
 d2e1a72fcca58-6f8f34aa591mr15632696b3a.14.1716959718226; 
 Tue, 28 May 2024 22:15:18 -0700 (PDT)
Received: from smtpclient.apple ([2601:641:300:4910:13e:d5cf:5baa:e78a])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-701d8321050sm1748235b3a.35.2024.05.28.22.15.17
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 28 May 2024 22:15:17 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
Date: Tue, 28 May 2024 22:15:05 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <FC18A048-3DE1-4C54-9ECC-91DB50280F11@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
 <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On May 27, 2024, at 3:10=E2=80=AFPM, Yuan Fu <casouri@HIDDEN> =
wrote:
>=20
>=20
>=20
>> On May 17, 2024, at 11:07=E2=80=AFPM, Yuan Fu <casouri@HIDDEN> =
wrote:
>>=20
>>=20
>>=20
>>> On May 17, 2024, at 8:29 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>>>=20
>>>> From: Helmut Eller <eller.helmut@HIDDEN>
>>>> Date: Fri, 17 May 2024 15:39:27 +0200
>>>>=20
>>>> The code in the attached file tries to parse src/lisp.h but crashes
>>>> while printing the result:  emacs --batch -l ts-bug.el
>>>=20
>>> Yuan, can you help, please?
>>>=20
>>> Btw, why do you use treesit-parse-string?  The Emacs integration =
with
>>> tree-sitter can parse a buffer without making a string from its
>>> contents.
>>=20
>> Yep, I=E2=80=99ll look into it.
>>=20
>> Yuan
>=20
> Just an update, I didn=E2=80=99t forget about this. If I didn=E2=80=99t =
reply back today, I will in a few days :-)
>=20
> Yuan

=46rom what I can gather, the crash seems to be because the temp buffer =
is garbage collected=E2=80=94the inserted lisp.h is a large file, so the =
temp buffer is probably immediately collected, before Emacs tries to =
print the node in the next line. I replaced the insert-file-content with =
some smaller file and it didn=E2=80=99t crash.

But that theory has critical flaws: a) Emacs certainly doesn't collect =
the temp buffer before the with-temp-buffer form returns; b) I can=E2=80=99=
t crash Emacs in my non-debug build by inserting (garbage-collect) in =
front of the message line in the example; c) debug build Emacs still =
crashes even if I enlarge gc-cons-threshold.

Eli, is there anything different regarding temp buffers in debug builds?

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 27 May 2024 22:12:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 18:12:05 2024
Received: from localhost ([127.0.0.1]:45395 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBiZZ-0008Kn-9Q
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 18:12:05 -0400
Received: from mail-pl1-f169.google.com ([209.85.214.169]:59766)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sBiZX-0008KJ-5q
 for 71012 <at> debbugs.gnu.org; Mon, 27 May 2024 18:12:04 -0400
Received: by mail-pl1-f169.google.com with SMTP id
 d9443c01a7336-1f4a52d2688so1882475ad.3
 for <71012 <at> debbugs.gnu.org>; Mon, 27 May 2024 15:11:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716847848; x=1717452648; 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=dnBHH9OMzUbLs5YLwKRcE77jmFEcFWVHH/gLTWC5WfA=;
 b=kXaNJHArsir3jWonKfn5DCDoDKmSg5nUH2Cd7b4bzcQEwnJSzCsMTpNJJr3yq3jDkH
 Cdn7EmL2hfEEFW0fUKP2vKI+G3Ks68T5pDH/doLCraGUmXUlDVaPk5GLfHTj8eeTI36E
 oVYL/8FNay3AUzdSdrgFFJEHpkHcv4l1Cwn428fsvmSQQe5kqMRrqrwwxpm13Qpev1Ds
 TkgPOw8/xsLktVZUe10ZHMgWU4Fy+V2rWJiis09gFnU5ZpjYpAp1vBMzCdNF684d+hW4
 0awS6Ve/LqgockSLsliir98xd9W5wxKDwCMLrut7MpoTcQfMxHWj3oogP7hs1iQPKSBo
 ZPmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716847848; x=1717452648;
 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=dnBHH9OMzUbLs5YLwKRcE77jmFEcFWVHH/gLTWC5WfA=;
 b=XSHYmoqxihrE9ZoAedx3h+p2HWWVPqyMYE6RDDk1rKVFcjFqr1Oac1UV63Ukd4SiC2
 GWuwpG7pPIiEHbNmy5INZUFMURcbfXZSXX7kd4zcprmeL3GUlSWbDjwCeBO3GVtfx/8D
 oJPVm39359pBnmyC5M56oXAwxh/1cmVwex6+Lj9AuXTsyz2C12xpG3PRQWVqLP/FcCOD
 Ct9DFBrgq0r1t4u/M1EDxSxlOsLvYSNE3tF6qQFxhrIIJC5ekp8VnuL/RzkOdN5bKuTn
 4TD0K9wEIk0nlZMxNzuwU03roukO+H+dIgzldWcXmlaxUNDVx5DH/w97OLcyQI3RaIAN
 sgQA==
X-Forwarded-Encrypted: i=1;
 AJvYcCViL0kRwE4Z3P4YOVmNkY8JPX2x1Q4+cGFOl1NVJkC0iZdVYYWez26xcI/Wcq7lF6hAU+YUFYnBOeRRwnk5ryAgRu+YEj8=
X-Gm-Message-State: AOJu0YxXyKZ6rrKThpOvTrGMoIaQx+gwEP48Ub9wlt0z7CNoRVaF5rhg
 0uyzyO/3dVBxh+Dzf9MuQwHQTHmrOCztpxkVI/JJTVbgekbkvHPO
X-Google-Smtp-Source: AGHT+IHXJVCPtk0vSpJ/MkbxGJedCUMNB6tixu8ux0aimKkZa/+f77FuxWMwOLF29qBEysjGBMe2Tw==
X-Received: by 2002:a17:902:f68d:b0:1f4:af72:35da with SMTP id
 d9443c01a7336-1f4af723895mr32211605ad.65.1716847848113; 
 Mon, 27 May 2024 15:10:48 -0700 (PDT)
Received: from smtpclient.apple ([2601:641:300:4910:3097:2bb7:97eb:9759])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-1f44c7592f3sm65961425ad.38.2024.05.27.15.10.47
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 27 May 2024 15:10:47 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
Date: Mon, 27 May 2024 15:10:36 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <6F195712-81CE-4C75-8983-D1D909646CAC@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On May 17, 2024, at 11:07=E2=80=AFPM, Yuan Fu <casouri@HIDDEN> =
wrote:
>=20
>=20
>=20
>> On May 17, 2024, at 8:29 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>>=20
>>> From: Helmut Eller <eller.helmut@HIDDEN>
>>> Date: Fri, 17 May 2024 15:39:27 +0200
>>>=20
>>> The code in the attached file tries to parse src/lisp.h but crashes
>>> while printing the result:  emacs --batch -l ts-bug.el
>>=20
>> Yuan, can you help, please?
>>=20
>> Btw, why do you use treesit-parse-string?  The Emacs integration with
>> tree-sitter can parse a buffer without making a string from its
>> contents.
>=20
> Yep, I=E2=80=99ll look into it.
>=20
> Yuan

Just an update, I didn=E2=80=99t forget about this. If I didn=E2=80=99t =
reply back today, I will in a few days :-)

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 18 May 2024 06:08:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 18 02:08:34 2024
Received: from localhost ([127.0.0.1]:59438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s8DFB-0002yj-Sh
	for submit <at> debbugs.gnu.org; Sat, 18 May 2024 02:08:34 -0400
Received: from mail-oo1-f42.google.com ([209.85.161.42]:56804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1s8DF9-0002yX-BJ
 for 71012 <at> debbugs.gnu.org; Sat, 18 May 2024 02:08:32 -0400
Received: by mail-oo1-f42.google.com with SMTP id
 006d021491bc7-5b2a66dce8fso1561900eaf.1
 for <71012 <at> debbugs.gnu.org>; Fri, 17 May 2024 23:08:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716012442; x=1716617242; 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=/7MDo4bqy31Y/Ds3X1SzMyD2MFkEEFdhvOJDrqosAno=;
 b=CqiDHukhlAhC5rzLn2njqC+SBTHGUoqitooWEQHTyjWJct94Yt0YBotgqHH6FML+VM
 tRRiF209wp5joKAPKF0e40kotzJQobg3USVxpFnoX2ECDFF78ZnUM5YzAJcnKUghtChu
 8yhDXvOeVxtkiIujuONqFD4otktq/7JW8mXPb5dTi7IPIjiOdWMFGYOO4g5OYgcH73v2
 4WH9UUI+2s3fkdKQO272GLaZ39SUiee6VPwjmXlAmK8rrDRcfoEw3PUPM7lrDI6WMOz5
 cpp/Pk1eJnxJJebdv+agF5fb/Ew1QaiAnO2plPFs/MbvHjvuc3CEFQyGNEugGR0j/cOR
 yfmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716012442; x=1716617242;
 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=/7MDo4bqy31Y/Ds3X1SzMyD2MFkEEFdhvOJDrqosAno=;
 b=bkJyJBniS1EDzdx4L/51fbmpKkPDBtOkqj7U5JmgJnEPO4gysRbwV9jJkWcO8k50Kj
 NjMSjPIGGz9eUJeOWuRd/9gYlehFrksg41Qj374cc2kL/+K4M40uUPGrgjVN1A6VGTqJ
 jfRi9eyOqaCU3EAq0iHskNoV2/haJVhkyTQpS7NYWuJiGlpXv3/GqiPjg/ixhdsSAPNI
 A3U2PkH8YwK/gpvwAYFyiTiTFF53G4RE7qG2yJC8yuxnt4v/Ah++waWLLB9N4Yu7IvgH
 t4cxU05Ys6hIB1q8uKElg0rSGECAbinajxQFqSnH19qwBRBsD/Vo06QvXxZe4MfHVKJ2
 2HJQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCVx8fjUm0CI6sLIdw60jXLFWzUkDTNcvcwJewyH50IJ0Et9h6VFN9rGziJnZN38GjQOuaUi7YE9XMAjJAH9rLTElX0PCuE=
X-Gm-Message-State: AOJu0Yx3Zv3Z4F/11fVnBEUB2WSmk0W2+9IXTnWMGqgv4XGcsOq9B6/8
 DjKuvPo1qZMrPQja48rs564N30+Zf+aXszVkvOw6M1uq0fP+PFW1yhEEBA==
X-Google-Smtp-Source: AGHT+IHvSO2uXlLxtPSoLxk7/bHEtdFJp9D2rzgGyTu0xUPqBnNg0NxNjTdAxYhVwIxj0j9XYmt54w==
X-Received: by 2002:a05:6870:1715:b0:240:f3ee:6fd8 with SMTP id
 586e51a60fabf-24172be01aamr27103317fac.43.1716012442372; 
 Fri, 17 May 2024 23:07:22 -0700 (PDT)
Received: from smtpclient.apple ([2601:641:300:4910:1d2:975d:d754:85c2])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-6f4d2b300d9sm15644490b3a.215.2024.05.17.23.07.21
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 17 May 2024 23:07:21 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.1\))
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86wmnsfodz.fsf@HIDDEN>
Date: Fri, 17 May 2024 23:07:10 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <CA0E3316-8A35-4F3B-8E12-77F70AB96039@HIDDEN>
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3731.700.6.1.1)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org, Helmut Eller <eller.helmut@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On May 17, 2024, at 8:29 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Helmut Eller <eller.helmut@HIDDEN>
>> Date: Fri, 17 May 2024 15:39:27 +0200
>>=20
>> The code in the attached file tries to parse src/lisp.h but crashes
>> while printing the result:  emacs --batch -l ts-bug.el
>=20
> Yuan, can you help, please?
>=20
> Btw, why do you use treesit-parse-string?  The Emacs integration with
> tree-sitter can parse a buffer without making a string from its
> contents.

Yep, I=E2=80=99ll look into it.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 17 May 2024 16:00:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 17 12:00:49 2024
Received: from localhost ([127.0.0.1]:55938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s800n-0008NB-48
	for submit <at> debbugs.gnu.org; Fri, 17 May 2024 12:00:49 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s800l-00089k-Hy
 for 71012 <at> debbugs.gnu.org; Fri, 17 May 2024 12:00:48 -0400
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 <eliz@HIDDEN>)
 id 1s800d-0000dW-94; Fri, 17 May 2024 12:00:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=V6jrLH5MTKw/eAPVOewKtHg3BCoz0Laj6n4B+dhHQKQ=; b=H+TN6jkHosLi
 +FjeLwlI5P+f+ohEgEODkmQPfbDgzv3pa8XmAHpNV4z0LipH+c4F7WxO8QFjEiteSAHsqxxbQOmXx
 WYqgdvC0/wTRWS67OQJ+9ORJFhEn/vXFBsFgDy8HEMsLE2tDccvfIrALxhCkZeSxr0nc5VjKQrDXU
 I0buR9s4ta1fXRuxt7euvtw6v3v/6w4gTQgCUMWm+K+Hb7HWcD5Xs8Ek6rwLDXtOwQN8v4fm0cIVh
 VzcM//kfQJFM9tnXBbjQyb1gVbzZBZNG5vfoGuw7I6vk3UEj4bLGyDiyWRU4+Yy4KELtDTRVKtDQH
 T8c8CjBMYzi/CnF/O/5i0Q==;
Date: Fri, 17 May 2024 19:00:36 +0300
Message-Id: <86seygfmxn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Helmut Eller <eller.helmut@HIDDEN>
In-Reply-To: <878r08o3kj.fsf@HIDDEN> (message from Helmut Eller on Fri, 17
 May 2024 17:34:04 +0200)
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
 <878r08o3kj.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71012
Cc: casouri@HIDDEN, 71012 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Helmut Eller <eller.helmut@HIDDEN>
> Cc: Yuan Fu <casouri@HIDDEN>,  71012 <at> debbugs.gnu.org
> Date: Fri, 17 May 2024 17:34:04 +0200
> 
> > Btw, why do you use treesit-parse-string?  The Emacs integration with
> > tree-sitter can parse a buffer without making a string from its
> > contents.
> 
> It's the first time that I use treesit.  I just tried a few things.

There's a chapter about it in the ELisp manual (the node "Parsing
Program Source"), in case you haven't read it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 17 May 2024 15:35:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 17 11:35:17 2024
Received: from localhost ([127.0.0.1]:55824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s7zc5-0005wm-6K
	for submit <at> debbugs.gnu.org; Fri, 17 May 2024 11:35:17 -0400
Received: from mail-wm1-f46.google.com ([209.85.128.46]:44439)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eller.helmut@HIDDEN>) id 1s7zc3-0005wd-8k
 for 71012 <at> debbugs.gnu.org; Fri, 17 May 2024 11:35:15 -0400
Received: by mail-wm1-f46.google.com with SMTP id
 5b1f17b1804b1-4202ca70289so2019505e9.1
 for <71012 <at> debbugs.gnu.org>; Fri, 17 May 2024 08:35:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1715960045; x=1716564845; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=a4JZx3myt7PBA6MvSwh0apZRoINY6is0h7a7nZA9IXE=;
 b=RuFzVbLVEjIU0jMwRPnZtoOUMYgQbMH4EbHNZl3veqDCsx6OGxpa3xi1aG4tG+BFF3
 E/IafEwshfNZkf6t7IdBiJf9CIB6gTTaayjUJE9N5Yu48Qk14EmQAiKqYOw2hLlHFm5c
 3UnlRrkl9w5fb/72dSbua9iUoqI0WfaR/s/Jrqa+F4hvQmJsgvddrqRlIDdGIJkw/CEr
 qsIL4ZmRY/WfxIjRgWazJbAl3c/+e3kf3K3E4EA7B8ahqFKNuTZ8Sg0ruu4YLEmM33Bn
 ATgFoLLOcma8+ffOaC127HR+NJULMeR3vjwmQRWn/rygH5LX0WJHUGp3yN/gO5fH6SnL
 ronw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1715960045; x=1716564845;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=a4JZx3myt7PBA6MvSwh0apZRoINY6is0h7a7nZA9IXE=;
 b=N3EjDtzrpScMcm268jjThs87ejaR9JV3BUIPjUGzcC661Da7VwS8tnMZbsWUYSdsZy
 kwK/L9hFIAl8ISIxpyWjMzicFzHBGCIG1kuR7xetKqrpieg6rSACRjJB79z7wLLvqmQH
 uh8ozgEf7Ya1i9HBldERVqI5v1IgA8gbAVxlFhILpqktdJZBspi6y0wCBvGRuxU6oEfE
 qrgn4FfAxElHU2kd2SuPWryR/R3OB1E2jBJYDyYG4sKEo2ZdGli4LRPXO7d/Ww/LxngR
 H/o9I4Sl5rvID414RcHAXRbP4F67giZvU+0+r4zy8TwMH6MgFzESm/0YFTXZ7Ekh3TDN
 5pRg==
X-Forwarded-Encrypted: i=1;
 AJvYcCVHCwmoGzku9TV9j+ap+WIb3GRh5a0jQQcQxuF6J/o3W98HqJZMmULq3NnkBhirlPsK4NTz7t79K0QRcaLdBrLxcWu6Z0s=
X-Gm-Message-State: AOJu0Yx1ovG9PAttQj/alZuo8tu/ow8PuIz2daIP4KmJcOfMHZtbhf7r
 qr6si+w868w/o2DpEHJINcIRfVyDLll0K1htAJTT/ysyi6GcfgiM8O8OdA==
X-Google-Smtp-Source: AGHT+IHX0C3nXU8ax9WXgPpG48MhLUivE1pZb45xK3DFqANmtrG0HzClb9i5HsnjaCm8dxwVukpRjw==
X-Received: by 2002:a05:600c:3b86:b0:41b:e84d:67a3 with SMTP id
 5b1f17b1804b1-41fea53887cmr171030775e9.0.1715960045172; 
 Fri, 17 May 2024 08:34:05 -0700 (PDT)
Received: from caladan ([89.107.106.224]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-41fccfe15b6sm301081985e9.47.2024.05.17.08.34.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 May 2024 08:34:04 -0700 (PDT)
From: Helmut Eller <eller.helmut@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
In-Reply-To: <86wmnsfodz.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 May
 2024 18:29:12 +0300")
References: <87ttiwpng0.fsf@HIDDEN> <86wmnsfodz.fsf@HIDDEN>
Date: Fri, 17 May 2024 17:34:04 +0200
Message-ID: <878r08o3kj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71012
Cc: Yuan Fu <casouri@HIDDEN>, 71012 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> Btw, why do you use treesit-parse-string?  The Emacs integration with
> tree-sitter can parse a buffer without making a string from its
> contents.

It's the first time that I use treesit.  I just tried a few things.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at 71012 <at> debbugs.gnu.org:


Received: (at 71012) by debbugs.gnu.org; 17 May 2024 15:29:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 17 11:29:26 2024
Received: from localhost ([127.0.0.1]:55798 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s7zWQ-0005qK-ES
	for submit <at> debbugs.gnu.org; Fri, 17 May 2024 11:29:26 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49670)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s7zWO-0005qE-Ay
 for 71012 <at> debbugs.gnu.org; Fri, 17 May 2024 11:29:24 -0400
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 <eliz@HIDDEN>)
 id 1s7zWG-000377-23; Fri, 17 May 2024 11:29:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ql1UC8/s3NPbNxGhQdLvtXWnB9a8gElxMNbeF4v/h+g=; b=pe0I8ureMDVM
 QoQDSH+IvdrQTJX4ejU6a8QL5/2YI8E0/2UEEOa9OZQGKswX5QLXDcM9a2zQDmY2kWqtI24/s8zNi
 GFxzHDU5Kwk0T0INJjbIIOR5jea/rCwFmYFyUwKFwTTJ6rtPqPmgPINwAumn8xZjXtSmylTkBQtKI
 UhDi6v3LnZXWopgjFrNaBfSJwY6zCwi1sAkQwEmKamG1LtZwel0tyffhMvuMmPbEmxtS43BfaZTZ5
 PwbmhGfFgwWfMCgLnBSjVQHYUIARMYRdh+c+HGMRSH4Kcb9S2fszaauhS8rA/2F6Bg5a4pv0RqmhS
 6W/l5Jmr2lxnzNvbQq8rNg==;
Date: Fri, 17 May 2024 18:29:12 +0300
Message-Id: <86wmnsfodz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Helmut Eller <eller.helmut@HIDDEN>,
 Yuan Fu <casouri@HIDDEN>
In-Reply-To: <87ttiwpng0.fsf@HIDDEN> (message from Helmut Eller on Fri, 17
 May 2024 15:39:27 +0200)
Subject: Re: bug#71012: 30.0.50; tree-sitter crash
References: <87ttiwpng0.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71012
Cc: 71012 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Helmut Eller <eller.helmut@HIDDEN>
> Date: Fri, 17 May 2024 15:39:27 +0200
> 
> The code in the attached file tries to parse src/lisp.h but crashes
> while printing the result:  emacs --batch -l ts-bug.el

Yuan, can you help, please?

Btw, why do you use treesit-parse-string?  The Emacs integration with
tree-sitter can parse a buffer without making a string from its
contents.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 May 2024 13:39:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 17 09:39:43 2024
Received: from localhost ([127.0.0.1]:55357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s7xoF-0004RB-7V
	for submit <at> debbugs.gnu.org; Fri, 17 May 2024 09:39:43 -0400
Received: from lists.gnu.org ([209.51.188.17]:33404)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eller.helmut@HIDDEN>) id 1s7xoD-0004R5-Iv
 for submit <at> debbugs.gnu.org; Fri, 17 May 2024 09:39:42 -0400
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 <eller.helmut@HIDDEN>)
 id 1s7xoA-0005kN-Da
 for bug-gnu-emacs@HIDDEN; Fri, 17 May 2024 09:39:38 -0400
Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <eller.helmut@HIDDEN>)
 id 1s7xo8-00059I-Bp
 for bug-gnu-emacs@HIDDEN; Fri, 17 May 2024 09:39:38 -0400
Received: by mail-wr1-x429.google.com with SMTP id
 ffacd0b85a97d-351dc6aa900so120823f8f.0
 for <bug-gnu-emacs@HIDDEN>; Fri, 17 May 2024 06:39:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1715953174; x=1716557974; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=NyqtKOJRy5DOWUxm06eGW15WPJCYfs2gBDKMp9p/10E=;
 b=kWKldaQe3hiPu0RaBTfuuP9KfpXHHPOsqXbEEm2VaIv/z9UzrbUg128aq+Pt+j2gz9
 KhBpuNxvS0y1o+iNn9HjHHj+//C+xQ4R++5WbVxlf/us61ppcy6VOEFlITHlyVBC9vxj
 W2gfN6GjBJ0L4eO0KuAkt6cKZtAUMKgVi2eM+vPddflzLMP2CwBL8OwiWhiRZEnADgZo
 +Iq8gmevdIqg8IN1MZxuLcBxjG+yXo773H3ECepkoBU7yvcoEw+AyQGmNOIklMUJncLL
 Aft+YwvfXw2pYq2NLHepcwri9lpfyGV7fA9Sx5zRb34j+qlhTunYajHdJUXjZsRYUwrL
 7C2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1715953174; x=1716557974;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=NyqtKOJRy5DOWUxm06eGW15WPJCYfs2gBDKMp9p/10E=;
 b=v2I+BtXGcV9ROHIwvQqToCOKNAvbwOvlr22D31sEwW20wmhYKVhUFf143cAsWRAro7
 esaFviXmfbOaXiRCCE01Cb0Lt9r0v6OQ9QjDc2hfzOXcx47Xn2c7nWpGTtpxINhqk7BD
 erGtZgeFOD/dhIvnnAK4hY0gmUzXDhMXR7elYhqH2LGy4hXIicqD8tcVVWp6O43RDfVY
 69jqd+DnwkV4TBMQXS79GqFbSULFBufpsqgNjxKV6zLK0qHdhWe+8jfvkS+TJIWQNvav
 sDIWdpktH83Gy6SeZCXRaW76AcW7tW4DOUiBhXjzhUCbhOTHZOGYG0nGsEUsSYm4J/M8
 AStg==
X-Gm-Message-State: AOJu0Yz4+Vzt3kbV2xi4WYz0n8ooYe+91X6UIak3P/FeAJ17X33zGCDf
 JR2l6FRz2BIJVOVjjZKORFV6QhUH5KSBEvMV2+iT91Q9pPevISWQcZkL0Q==
X-Google-Smtp-Source: AGHT+IGQTjlPFtVJsyaNEwUyjH8cFkOWv432J/SO+vWJcqt9O1xOrnCuQJC3zW8QOqAXVF7CBChxXw==
X-Received: by 2002:adf:e101:0:b0:351:d386:7356 with SMTP id
 ffacd0b85a97d-351d38673b2mr4208173f8f.37.1715953174282; 
 Fri, 17 May 2024 06:39:34 -0700 (PDT)
Received: from caladan ([89.107.106.224]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-351b79e8e6bsm14055652f8f.65.2024.05.17.06.39.33
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 May 2024 06:39:33 -0700 (PDT)
From: Helmut Eller <eller.helmut@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; tree-sitter crash
X-Debbugs-Cc: 
Date: Fri, 17 May 2024 15:39:27 +0200
Message-ID: <87ttiwpng0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::429;
 envelope-from=eller.helmut@HIDDEN; helo=mail-wr1-x429.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

The code in the attached file tries to parse src/lisp.h but crashes
while printing the result:  emacs --batch -l ts-bug.el


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=ts-bug.el
Content-Transfer-Encoding: quoted-printable

(require 'treesit)

(with-temp-buffer
  (insert-file-contents "lisp.h")
  (message "%s" (treesit-parse-string (buffer-string) 'c)))





--=-=-=
Content-Type: text/plain



Program received signal SIGSEGV, Segmentation fault.
0x000055555575c33a in buf_bytepos_to_charpos (b=0x555556074c60, bytepos=1)
    at marker.c:343
343       eassert (bytepos >= BUF_Z_BYTE (b)
(gdb) ba 10
#0  0x000055555575c33a in buf_bytepos_to_charpos (b=0x555556074c60, bytepos=1)
    at marker.c:343
#1  0x0000555555853509 in Ftreesit_node_start
    (node=node@entry=XIL(0x55555605b225)) at treesit.c:1927
#2  0x00005555557f3f8a in print_vectorlike_unreadable
    (obj=XIL(0x55555605b225), printcharfun=XIL(0), escapeflag=<optimized out>, buf=0x7fffffff7ef0 "dd\aVUU") at print.c:2051
#3  0x00005555557f1b85 in print_object
    (obj=<optimized out>, printcharfun=<optimized out>, escapeflag=false)
    at print.c:2642
#4  0x00005555557f2cf0 in Fprin1_to_string
    (object=object@entry=XIL(0x55555605b225), noescape=XIL(0x30), overrides=overrides@entry=XIL(0)) at print.c:814
#5  0x00005555557b7c30 in styled_format
    (nargs=2, args=args@entry=0x7fffffffda30, message=message@entry=true)
    at editfns.c:3635
#6  0x00005555557b933f in Fformat_message
    (args=0x7fffffffda30, nargs=<optimized out>) at editfns.c:3388
#7  Fmessage (args=0x7fffffffda30, nargs=<optimized out>) at editfns.c:3185
#8  Fmessage (nargs=<optimized out>, args=0x7fffffffda30) at editfns.c:3154
#9  0x00005555557c6b75 in eval_sub (form=<optimized out>)
    at /scratch/emacs/emacs-git/src/lisp.h:2243
(More stack frames follow...)



In GNU Emacs 30.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-05-17 built on caladan
Repository revision: 6ca3a60db3427bc6aef08144c1524920ff3d9c4d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --enable-checking --without-native-compiler
 --with-xpm=ifavailable --with-gif=ifavailable
 --with-native-compilation=no --with-tree-sitter'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM
XINPUT2 GTK3 ZLIB


--=-=-=--




Acknowledgement sent to Helmut Eller <eller.helmut@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#71012; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 24 Jul 2024 15:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.