From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#71012: 30.0.50; tree-sitter crash Date: Tue, 28 May 2024 22:15:05 -0700 Message-ID: References: <87ttiwpng0.fsf@gmail.com> <86wmnsfodz.fsf@gnu.org> <6F195712-81CE-4C75-8983-D1D909646CAC@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25344"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71012@debbugs.gnu.org, Helmut Eller To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 29 07:17:58 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCBhF-0006OJ-IW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 May 2024 07:17:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCBgI-0000eH-Fy; Wed, 29 May 2024 01:16:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCBgD-0000cl-Hq for bug-gnu-emacs@gnu.org; Wed, 29 May 2024 01:16:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCBgD-0005T3-4L for bug-gnu-emacs@gnu.org; Wed, 29 May 2024 01:16:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCBgM-0005SA-G0 for bug-gnu-emacs@gnu.org; Wed, 29 May 2024 01:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 May 2024 05:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71012 X-GNU-PR-Package: emacs Original-Received: via spool by 71012-submit@debbugs.gnu.org id=B71012.171695979720905 (code B ref 71012); Wed, 29 May 2024 05:17:02 +0000 Original-Received: (at 71012) by debbugs.gnu.org; 29 May 2024 05:16:37 +0000 Original-Received: from localhost ([127.0.0.1]:45811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCBfw-0005R6-Gy for submit@debbugs.gnu.org; Wed, 29 May 2024 01:16:36 -0400 Original-Received: from mail-pf1-f174.google.com ([209.85.210.174]:48421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCBfu-0005Qn-Ub for 71012@debbugs.gnu.org; Wed, 29 May 2024 01:16:35 -0400 Original-Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6f693306b7cso1511216b3a.1 for <71012@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) Original-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) In-Reply-To: <6F195712-81CE-4C75-8983-D1D909646CAC@gmail.com> X-Mailer: Apple Mail (2.3774.600.62) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286138 Archived-At: > On May 27, 2024, at 3:10=E2=80=AFPM, Yuan Fu = wrote: >=20 >=20 >=20 >> On May 17, 2024, at 11:07=E2=80=AFPM, Yuan Fu = wrote: >>=20 >>=20 >>=20 >>> On May 17, 2024, at 8:29 AM, Eli Zaretskii wrote: >>>=20 >>>> From: Helmut Eller >>>> 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