From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#71681: 29.3.50; tree-sitter crash Date: Sun, 23 Jun 2024 20:38:08 +0300 Organization: LINKOV.NET Message-ID: <86o77rpnjz.fsf@mail.linkov.net> References: <86h6dny3om.fsf@mail.linkov.net> <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8382"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 71681@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 23 19:44:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sLRGF-00022T-1T for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jun 2024 19:44:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLRFz-00007p-Vn; Sun, 23 Jun 2024 13:44:03 -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 1sLRFy-00007A-Nz for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 13:44:02 -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 1sLRFy-0002gO-Fi for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 13:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLRFy-0004p6-Mx for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 13:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2024 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71681 X-GNU-PR-Package: emacs Original-Received: via spool by 71681-submit@debbugs.gnu.org id=B71681.171916460518441 (code B ref 71681); Sun, 23 Jun 2024 17:44:02 +0000 Original-Received: (at 71681) by debbugs.gnu.org; 23 Jun 2024 17:43:25 +0000 Original-Received: from localhost ([127.0.0.1]:42717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLRFM-0004nN-Uy for submit@debbugs.gnu.org; Sun, 23 Jun 2024 13:43:25 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:56901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLRFI-0004me-0s for 71681@debbugs.gnu.org; Sun, 23 Jun 2024 13:43:20 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C86C840003; Sun, 23 Jun 2024 17:43:12 +0000 (UTC) In-Reply-To: <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@gmail.com> (Yuan Fu's message of "Sat, 22 Jun 2024 16:55:38 -0700") X-GND-Sasl: juri@linkov.net 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:287799 Archived-At: >> 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.