GNU bug report logs - #71681
29.3.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: Juri Linkov <juri@HIDDEN>; dated Thu, 20 Jun 2024 16:43:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 71681) by debbugs.gnu.org; 23 Jun 2024 17:43:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 23 13:43:25 2024
Received: from localhost ([127.0.0.1]:42717 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLRFM-0004nN-Uy
	for submit <at> debbugs.gnu.org; Sun, 23 Jun 2024 13:43:25 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56901)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sLRFI-0004me-0s
 for 71681 <at> debbugs.gnu.org; Sun, 23 Jun 2024 13:43:20 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id C86C840003;
 Sun, 23 Jun 2024 17:43:12 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#71681: 29.3.50; tree-sitter crash
In-Reply-To: <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN> (Yuan Fu's
 message of "Sat, 22 Jun 2024 16:55:38 -0700")
Organization: LINKOV.NET
References: <86h6dny3om.fsf@HIDDEN>
 <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN>
Date: Sun, 23 Jun 2024 20:38:08 +0300
Message-ID: <86o77rpnjz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71681
Cc: 71681 <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.7 (-)

>> Evaluating this expression causes a crash:
>>
>> (progn
>>  (find-file (expand-file-name "src/treesit.c" installation-directory))
>>  (c-ts-mode)
>>  (font-lock-ensure 63209 63387))
>>
>> in latest master, but not in latest emacs-29 (only in 5-months old emacs-29).
>>
>> If this is not reproducible, I could provide more details.
>>
>> libtree-sitter is at the latest version.
>
> Hmm, I can’t reproduce with latest master and libtree-sitter. Maybe you can send me the exact commits that you used?
>
> Here’s mine:
>
> Emacs: 72f2b01e318
> Tree-sitter: 6ec478c1

Probably reproducibility depends on the content of the src/treesit.c file.
Then the most reliable way to reproduce it is this:

0. emacs -Q
1. eval: (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
2. C-x v L
3. in the *vc-change-log* buffer move point to the commit 20af58d3a13
4. type D
5. crash caused by diff-font-lock-syntax fontification that uses treesit

The numbers in (font-lock-ensure 63209 63387) above were extracted
from diff hunk boundaries that might be different when the file was edited.




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

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


Received: (at 71681) by debbugs.gnu.org; 23 Jun 2024 07:06:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 23 03:06:34 2024
Received: from localhost ([127.0.0.1]:47605 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLHJ3-0004Du-W8
	for submit <at> debbugs.gnu.org; Sun, 23 Jun 2024 03:06:34 -0400
Received: from relay5-d.mail.gandi.net ([217.70.183.197]:37061)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sLHJ1-0004Db-Kl
 for 71681 <at> debbugs.gnu.org; Sun, 23 Jun 2024 03:06:32 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 390C11C0006;
 Sun, 23 Jun 2024 07:06:03 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#71681: 29.3.50; tree-sitter crash
In-Reply-To: <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN> (Yuan Fu's
 message of "Sat, 22 Jun 2024 16:55:38 -0700")
Organization: LINKOV.NET
References: <86h6dny3om.fsf@HIDDEN>
 <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN>
Date: Sun, 23 Jun 2024 09:46:58 +0300
Message-ID: <86pls8m9j9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71681
Cc: 71681 <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.7 (-)

>> Evaluating this expression causes a crash:
>>
>> (progn
>>  (find-file (expand-file-name "src/treesit.c" installation-directory))
>>  (c-ts-mode)
>>  (font-lock-ensure 63209 63387))
>>
>> in latest master, but not in latest emacs-29 (only in 5-months old emacs-29).
>>
>> If this is not reproducible, I could provide more details.
>>
>> libtree-sitter is at the latest version.
>
> Hmm, I can’t reproduce with latest master and libtree-sitter.
> Maybe you can send me the exact commits that you used?
>
> Here’s mine:
>
> Emacs: 72f2b01e318
> Tree-sitter: 6ec478c1

The commit are:

Emacs: 6f2036243f2 (2024-06-23, latest master)
Tree-sitter: 3da7deed (2024-06-08, version 0.22.6)

Also fails on old commits:
Emacs: ef01b634d21 (2024-01-18, emacs-29)
Tree-sitter: 870fb877 (2022-11-16, version 0.6.3)

But doesn't fail on:
Emacs: ce85d3811da (2024-06-18, recent emacs-29)
Tree-sitter: 3da7deed (2024-06-08, version 0.22.6)

Maybe it doesn't fail on recent emacs-29 because of the fix in 20af58d3a13?
But the same fix exists in latest master as well.




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

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


Received: (at 71681) by debbugs.gnu.org; 23 Jun 2024 05:33:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 23 01:33:00 2024
Received: from localhost ([127.0.0.1]:45221 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLFqW-0006iu-3O
	for submit <at> debbugs.gnu.org; Sun, 23 Jun 2024 01:33:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42950)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sLFqT-0006if-PO
 for 71681 <at> debbugs.gnu.org; Sun, 23 Jun 2024 01:32:58 -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 1sLFqL-00073I-Tm; Sun, 23 Jun 2024 01:32:50 -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=RYiqRes6ZDyWApwN5IO7/cydfVFarj5YMfMQaXqW9rA=; b=M2jx2L3LMwHdv7/KKwg0
 CGnwSCq/NSyQtNcwgEp3AICPcw63ZTy5gaTG4qtP0nDwA0GsL8Ls5ZtGy5Rt7hyc+lS7hpozpF73E
 jMjCiNtMVFRGiuddAO7lTmRiVetAUy51LD1zfdf6I0DYXKgfeEYztMt+2N/ipCvsLymM/ZRjaQtiZ
 2wn27bVAl4B8ataVx/WALiNBlJfVxa2aUbBHQO91Jj9BJCkvRQY3bq2gTaJtGvvUMprP+6YNJrNXt
 VeKhwP3OMa/dHHFBV/d/H2iWWp8/KtP/dkDvpfcDxiru2hc041J2czquHMRbNBHLRKvECXiw+Sa2q
 tRB+KTvYqJDLhg==;
Date: Sun, 23 Jun 2024 08:32:47 +0300
Message-Id: <867cegfclc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN> (message from
 Yuan Fu on Sat, 22 Jun 2024 16:55:38 -0700)
Subject: Re: bug#71681: 29.3.50; tree-sitter crash
References: <86h6dny3om.fsf@HIDDEN>
 <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@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: 71681
Cc: 71681 <at> debbugs.gnu.org, juri@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 (---)

> Cc: 71681 <at> debbugs.gnu.org
> From: Yuan Fu <casouri@HIDDEN>
> Date: Sat, 22 Jun 2024 16:55:38 -0700
> 
> 
> 
> > On Jun 20, 2024, at 9:33 AM, Juri Linkov <juri@HIDDEN> wrote:
> > 
> > Evaluating this expression causes a crash:
> > 
> > (progn
> >  (find-file (expand-file-name "src/treesit.c" installation-directory))
> >  (c-ts-mode)
> >  (font-lock-ensure 63209 63387))
> > 
> > in latest master, but not in latest emacs-29 (only in 5-months old emacs-29).
> > 
> > If this is not reproducible, I could provide more details.
> > 
> > libtree-sitter is at the latest version.
> 
> Hmm, I can’t reproduce with latest master and libtree-sitter. Maybe you can send me the exact commits that you used?
> 
> Here’s mine:
> 
> Emacs: 72f2b01e318
> Tree-sitter: 6ec478c1

I can reproduce this with tree-sitter version 0.20.8.  Can you try
building Emacs with that version?  I know it's somewhat old, but given
the ABI breakage issue, I expect quite a few people avoid upgrading to
a later version (I didn't).




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

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


Received: (at 71681) by debbugs.gnu.org; 22 Jun 2024 23:56:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 22 19:56:59 2024
Received: from localhost ([127.0.0.1]:36606 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sLAbK-00018L-VO
	for submit <at> debbugs.gnu.org; Sat, 22 Jun 2024 19:56:59 -0400
Received: from mail-pf1-f175.google.com ([209.85.210.175]:50382)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1sLAbI-00017z-Aj
 for 71681 <at> debbugs.gnu.org; Sat, 22 Jun 2024 19:56:57 -0400
Received: by mail-pf1-f175.google.com with SMTP id
 d2e1a72fcca58-70667943931so606166b3a.0
 for <71681 <at> debbugs.gnu.org>; Sat, 22 Jun 2024 16:56:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1719100550; x=1719705350; 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=E/xIeWELfs7Jdnjeg3+U7JMKNuyBNPgUfQnFQOyrI84=;
 b=Am/5OXF/HLdi6X0CViv4c2TUXmFMoWrJxnFALbWaCnPCERWNtNUKG4rmXGO1OwRmtX
 dAXZ7bLjoN8KPtKnZmVr4g4qq7Ut7gxMJU1c1RsJFUDWQ0ul21pcf5JxLXCaBi5XNv3H
 hYmK+LHOrl/OLbzAanUAm9Yx74nMFHDjL4ovAnqL1Qw0WDJ0W4/x+nNKmBIecRVnzwn/
 Ibgg97L6hJtyyc3VG/GzStMZnIURkeOXNROAXTZcLojpGH9grLrko9+pwD88VM3jnf9j
 UJAGPLPfJJioRSZ74yljjCsAJN8u6tjn4Uc6AhBTIW2wJNX376MGmEGY6CgTk+IGVBx6
 jq2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1719100550; x=1719705350;
 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=E/xIeWELfs7Jdnjeg3+U7JMKNuyBNPgUfQnFQOyrI84=;
 b=FqfnsnKIYwu/S1+Qcm67G1W5Z3C+qyBtzEN5g5KVLuhMJlN7kBBrp2kIXHNhXwq2lv
 1Jp5Xd5lOgvzHyhYERppURQAxLidGCtzT2Vl5fpHrF5vaPtLgtucr2FdkHLxsZnly6+N
 DNryydE35g5SSCbc+7bAvVUBzdkP5sQpMI+jUi4d+GSE2EEmcpI7TsE5PET8+KXhg3S4
 lpYLTpAET/JTdH/fL5cOQKdsHzskyHBiIr/ZRj+TKBDpquKFxRa3JV/Fn1iCnzZvJC4U
 +/dtaMY9wSkrTEtHsE+MJ6QzSRy1sygPszU03LOuq52swZ2qG3gf01m1XXlwSx2GcTcI
 fBkA==
X-Gm-Message-State: AOJu0YwpQU7HRH4Rti+E5ptnjFu7o0e0rvvN5N/BKq0umJIkJ3nhAg3x
 5FbqOP5oM7TLPzyt2WOZTYylI5EbgkIzoV0vVpOBOcmU9UbrGjej
X-Google-Smtp-Source: AGHT+IFJhS6UiN9SnLezdWObCMTNhN2GuX6kDFqTfpmTqkuUJWDbSbCgXAj0vLylm/aBxkDcIO5S1Q==
X-Received: by 2002:aa7:99dc:0:b0:706:6525:6114 with SMTP id
 d2e1a72fcca58-706746f1974mr917945b3a.25.1719100550077; 
 Sat, 22 Jun 2024 16:55:50 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:8f81:6120:20fa:247c:4f0e:e2a2])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7065129bdb5sm3615614b3a.158.2024.06.22.16.55.49
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 22 Jun 2024 16:55:49 -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#71681: 29.3.50; tree-sitter crash
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <86h6dny3om.fsf@HIDDEN>
Date: Sat, 22 Jun 2024 16:55:38 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@HIDDEN>
References: <86h6dny3om.fsf@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
X-Mailer: Apple Mail (2.3774.600.62)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 71681
Cc: 71681 <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 (-)



> On Jun 20, 2024, at 9:33=E2=80=AFAM, Juri Linkov <juri@HIDDEN> =
wrote:
>=20
> Evaluating this expression causes a crash:
>=20
> (progn
>  (find-file (expand-file-name "src/treesit.c" installation-directory))
>  (c-ts-mode)
>  (font-lock-ensure 63209 63387))
>=20
> in latest master, but not in latest emacs-29 (only in 5-months old =
emacs-29).
>=20
> If this is not reproducible, I could provide more details.
>=20
> libtree-sitter is at the latest version.

Hmm, I can=E2=80=99t reproduce with latest master and libtree-sitter. =
Maybe you can send me the exact commits that you used?

Here=E2=80=99s mine:

Emacs: 72f2b01e318
Tree-sitter: 6ec478c1

Yuan=




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

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


Received: (at submit) by debbugs.gnu.org; 20 Jun 2024 16:42:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 20 12:42:32 2024
Received: from localhost ([127.0.0.1]:35971 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sKKro-0007Mb-0L
	for submit <at> debbugs.gnu.org; Thu, 20 Jun 2024 12:42:32 -0400
Received: from lists.gnu.org ([209.51.188.17]:43560)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sKKrl-0007MT-TN
 for submit <at> debbugs.gnu.org; Thu, 20 Jun 2024 12:42:30 -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 <juri@HIDDEN>) id 1sKKrg-0006vE-IB
 for bug-gnu-emacs@HIDDEN; Thu, 20 Jun 2024 12:42:24 -0400
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <juri@HIDDEN>) id 1sKKrd-0006Dt-OL
 for bug-gnu-emacs@HIDDEN; Thu, 20 Jun 2024 12:42:23 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id BD8DFE0002
 for <bug-gnu-emacs@HIDDEN>; Thu, 20 Jun 2024 16:42:17 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.3.50; tree-sitter crash
Organization: LINKOV.NET
X-Debbugs-Cc: Yuan Fu <casouri@HIDDEN>
Date: Thu, 20 Jun 2024 19:33:29 +0300
Message-ID: <86h6dny3om.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
Received-SPF: pass client-ip=2001:4b98:dc4:8::224;
 envelope-from=juri@HIDDEN; helo=relay4-d.mail.gandi.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
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.7 (--)

Evaluating this expression causes a crash:

(progn
  (find-file (expand-file-name "src/treesit.c" installation-directory))
  (c-ts-mode)
  (font-lock-ensure 63209 63387))

in latest master, but not in latest emacs-29 (only in 5-months old emacs-29).

If this is not reproducible, I could provide more details.

libtree-sitter is at the latest version.

Thread 1 "emacs" received signal SIGSEGV, Segmentation fault.
0x00007ffff3f88f41 in ts_language_public_symbol () from /usr/local/lib/libtree-sitter.so.0
(gdb) bt
#0  0x00007ffff3f88f41 in ts_language_public_symbol () at /usr/local/lib/libtree-sitter.so.0
#1  0x00007ffff3f9fe9c in ts_query_cursor.advance () at /usr/local/lib/libtree-sitter.so.0
#2  0x00007ffff3fa117f in ts_query_cursor_next_match () at /usr/local/lib/libtree-sitter.so.0
#3  0x00005555557f0f8f in Ftreesit_query_capture (node=<optimized out>, query=<optimized out>, beg=<optimized out>, end=<optimized out>, node_only=XIL(0)) at treesit.c:3014
#4  0x00007fffec125106 in F747265657369742d2d666f6e742d6c6f636b2d666f6e746966792d726567696f6e2d31_treesit__font_lock_fontify_region_1_0 ()
#5  0x000055555575faf7 in Ffuncall (nargs=7, args=0x7fffffffcc00) at eval.c:3093
#6  0x00007fffec124e28 in F747265657369742d666f6e742d6c6f636b2d666f6e746966792d726567696f6e_treesit_font_lock_fontify_region_0 ()
#7  0x000055555575faf7 in Ffuncall (nargs=4, args=0x7fffffffccb0) at eval.c:3093
#8  0x00007fffef266534 in F666f6e742d6c6f636b2d666f6e746966792d73796e746163746963616c6c792d726567696f6e_font_lock_fontify_syntactically_region_0 ()
#9  0x000055555575faf7 in Ffuncall (nargs=4, args=0x7fffffffce10) at eval.c:3093
#10 0x00007fffef26427f in F666f6e742d6c6f636b2d64656661756c742d666f6e746966792d726567696f6e_font_lock_default_fontify_region_0 ()
#11 0x000055555575faf7 in Ffuncall (nargs=4, args=0x7fffffffceb0) at eval.c:3093
#12 0x00007fffef2630c5 in F666f6e742d6c6f636b2d666f6e746966792d726567696f6e_font_lock_fontify_region_0 ()
#13 0x00005555557a8b38 in exec_byte_code (fun=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at lisp.h:2243
#14 0x000055555575faf7 in Ffuncall (nargs=2, args=0x7fffffffd030) at eval.c:3093
#15 0x00005555557602a0 in run_hook_wrapped_funcall (nargs=<optimized out>, args=0x7fffffffd030) at eval.c:2872
#16 0x000055555575e9fb in run_hook_with_args (nargs=2, args=0x7fffffffd030, funcall=0x555555760280 <run_hook_wrapped_funcall>) at eval.c:2953
#17 0x00007fffef236115 in F6a69742d6c6f636b2d2d72756e2d66756e6374696f6e73_jit_lock__run_functions_0 ()
#18 0x000055555575faf7 in Ffuncall (nargs=3, args=0x7fffffffd150) at eval.c:3093
#19 0x00007fffef2369e9 in F6a69742d6c6f636b2d666f6e746966792d6e6f77_jit_lock_fontify_now_0 ()
#20 0x000055555575faf7 in Ffuncall (nargs=3, args=0x7fffffffd250) at eval.c:3093
#21 0x00007fffef263482 in F666f6e742d6c6f636b2d656e73757265_font_lock_ensure_0 ()
#22 0x00005555557631da in eval_sub (form=<optimized out>) at lisp.h:2243
#23 0x0000555555763381 in Fprogn (body=<optimized out>) at eval.c:439
#24 0x0000555555763066 in eval_sub (form=<optimized out>) at lisp.h:2243
#25 0x0000555555763381 in Fprogn (body=<optimized out>) at eval.c:439
#26 0x0000555555763066 in eval_sub (form=<optimized out>) at lisp.h:2243
#27 0x0000555555764bc1 in Fprogn (body=<optimized out>) at eval.c:439
#28 Flet (args=<optimized out>) at eval.c:1109
#29 0x0000555555763066 in eval_sub (form=<optimized out>) at lisp.h:2243
#30 0x0000555555763437 in Fsetq (args=<optimized out>) at eval.c:486
#31 0x0000555555763066 in eval_sub (form=<optimized out>) at lisp.h:2243
#32 0x000055555578ce3a in readevalloop_eager_expand_eval (val=<optimized out>, macroexpand=XIL(0xadd0)) at lisp.h:1192
#33 0x0000555555794ba0 in readevalloop (readcharfun=XIL(0x7ffff02e33d5), infile0=0x0, sourcename=XIL(0), printflag=true, unibyte=<optimized out>, readfun=XIL(0x5555560bc1f5), start=make_fixnum(202), end=XIL(0x5555560bc285)) at lread.c:2538
#34 0x000055555579601a in Feval_region (start=make_fixnum(202), end=make_fixnum(328), printflag=XIL(0x30), read_function=XIL(0x5555560bc1f5)) at lisp.h:752
#35 0x00007fffefacbbf6 in F656c6973702d2d6576616c2d646566756e_elisp__eval_defun_0 ()
#36 0x000055555575faf7 in Ffuncall (nargs=1, args=0x7fffffffd9f8) at eval.c:3093
#37 0x00007fffefacbcb1 in F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_38 ()
#38 0x000055555575faf7 in Ffuncall (nargs=1, args=0x7fffffffda40) at eval.c:3093
#39 0x0000555555760f09 in call0 (fn=<optimized out>) at lisp.h:3515
#40 Fhandler_bind_1 (nargs=<optimized out>, args=0x7fffffffda90) at eval.c:1478
#41 0x00007fffefacbd7a in F6576616c2d646566756e_eval_defun_0 ()
#42 0x000055555575faf7 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffffdb58) at eval.c:3093
#43 0x000055555575b4f3 in Ffuncall_interactively (nargs=2, args=0x7fffffffdb58) at callint.c:250
#44 0x000055555575faf7 in Ffuncall (nargs=nargs@entry=3, args=args@entry=0x7fffffffdb50) at eval.c:3093
#45 0x000055555575cc53 in Fcall_interactively (function=<optimized out>, record_flag=<optimized out>, keys=<optimized out>) at callint.c:789
#46 0x00007fffef9330cd in F636f6d6d616e642d65786563757465_command_execute_0 ()
#47 0x000055555575faf7 in Ffuncall (nargs=nargs@entry=2, args=args@entry=0x7fffffffde50) at eval.c:3093
#48 0x00005555556e2247 in command_loop_1 () at lisp.h:1192
#49 0x000055555575e0d7 in internal_condition_case (bfun=bfun@entry=0x5555556e1e40 <command_loop_1>, handlers=handlers@entry=XIL(0x90), hfun=hfun@entry=0x5555556d63c0 <cmd_error>) at eval.c:1613
#50 0x00005555556ce07a in command_loop_2 (handlers=handlers@entry=XIL(0x90)) at keyboard.c:1168
#51 0x000055555575e019 in internal_catch (tag=tag@entry=XIL(0x11d30), func=func@entry=0x5555556ce050 <command_loop_2>, arg=arg@entry=XIL(0x90)) at eval.c:1292
#52 0x00005555556ce016 in command_loop () at lisp.h:1192
#53 0x00005555556d5f25 in recursive_edit_1 () at keyboard.c:754
#54 0x00005555556d62d4 in Frecursive_edit () at keyboard.c:837
#55 0x00005555555aebf4 in main (argc=<optimized out>, argv=<optimized out>) at emacs.c:2629

Lisp Backtrace:
"treesit--font-lock-fontify-region-1" (0xffffcc08)
"treesit-font-lock-fontify-region" (0xffffccb8)
"font-lock-fontify-syntactically-region" (0xffffce18)
"font-lock-default-fontify-region" (0xffffceb8)
"font-lock-fontify-region" (0xedea4040)
0x5681b288 PVEC_CLOSURE
"jit-lock--run-functions" (0xffffd158)
"jit-lock-fontify-now" (0xffffd258)
"font-lock-ensure" (0xffffd2d0)
"progn" (0xffffd3a0)
"progn" (0xffffd480)
"let" (0xffffd5d0)
"setq" (0xffffd6d0)
"elisp--eval-defun" (0xffffda00)
0xf060f638 PVEC_SUBR
"eval-defun" (0xffffdb60)
"funcall-interactively" (0xffffdb58)
"command-execute" (0xffffde58)




Acknowledgement sent to Juri Linkov <juri@HIDDEN>:
New bug report received and forwarded. Copy sent to casouri@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to casouri@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#71681; 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: Sun, 23 Jun 2024 17:45:01 UTC

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