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#71681: 29.3.50; tree-sitter crash Date: Tue, 25 Jun 2024 23:04:56 -0700 Message-ID: References: <86h6dny3om.fsf@mail.linkov.net> <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@gmail.com> <86o77rpnjz.fsf@mail.linkov.net> <74F62063-1C20-4257-92BA-F2CF02B9A588@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="4427"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71681@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 08:07:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sMLoK-0000uL-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 08:07:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMLoB-00067x-V9; Wed, 26 Jun 2024 02:07:08 -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 1sMLo5-00066A-MJ for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:07: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 1sMLo4-0001vW-GL for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMLo5-0002VD-Jb for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:07:01 -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, 26 Jun 2024 06:07:01 +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.17193819799568 (code B ref 71681); Wed, 26 Jun 2024 06:07:01 +0000 Original-Received: (at 71681) by debbugs.gnu.org; 26 Jun 2024 06:06:19 +0000 Original-Received: from localhost ([127.0.0.1]:37968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMLnP-0002UG-EA for submit@debbugs.gnu.org; Wed, 26 Jun 2024 02:06:19 -0400 Original-Received: from mail-pl1-f172.google.com ([209.85.214.172]:49481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMLnL-0002Tz-TZ for 71681@debbugs.gnu.org; Wed, 26 Jun 2024 02:06:17 -0400 Original-Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1f9cd92b146so49505845ad.3 for <71681@debbugs.gnu.org>; Tue, 25 Jun 2024 23:06:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719381908; x=1719986708; 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=50DWDFmGXKBKcOwP8suFeuPvM+pIt/nh/JnkH6mamMk=; b=Aw7bA9aaJAGvKpFwIgC+ZKu46xIQJ4mlUDhYvanWhmBMoZFGZIsfcPcioM4qMgAuER 1kdHe/nb17IYRB1j57P/25Y163IRJqpCfrViNuZozKrGd6ZngNaBJ9bkeUvjTaD1aY1H D7zQ7DcpF//pBe38vOhMVIncGnevQu5dbSD8RGL6Gn4aCA0T0OVOxAdW7lDfd5CyrY5P YwzX3r6/Ag9oHKwSXeaPN9hXLP4JJiFDbty0DxyBlsBR5rT+oVG7j2CBcrszLIhhl/Su Vknh4NvnTHdUYzJsloQdM8kS1B1LxpzrB54ZeWDQBUVhpBojnsE20l1dHsGuhMA9skXV eVqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719381908; x=1719986708; 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=50DWDFmGXKBKcOwP8suFeuPvM+pIt/nh/JnkH6mamMk=; b=wmAxBWEZUeCKdnqV6bo173/focQNoFgEaYGCen5UzL7TkYm7D5WzU5f10auuzNBeCU sMGfPDz6wmT9YxhMkj9BgWDPkRUplX1favZxgfDv2l2TIR3Uw0UT34tkevOrgVICRY3P EPTCxxpGbtlGVpfGsKlSHu7FKlV554uoimYt11fF9uOOnsOow1NOmDN8cjG5t/xf1/uh bTItNJEC8B1Tw3LH/ggqVatlg2rVCIQIRZZiv8XYsGhQR3D0HmAXsoWDE7O+Nc+s8c7u sEPFxgA6l3we8XSRrAAl2pVJ57+4mTAedi0v+Du3oLmLlSHqPQRrD9wzkao8heUcI6q4 bFWQ== X-Gm-Message-State: AOJu0YwS8QS34kft0/GgQPhXHhc5RqJPNHvIJohV/aUZ2DgoC/DCfaCw WoZsRDTwRS3u1fOOJGG00Dtf/uFqHEcFkoRb+2BHMwEWcficHU3i X-Google-Smtp-Source: AGHT+IFxWuySynEuv3r3R5TZTWPNGoUkPSVUdXyGPhG8gHgP8W4v5NbU9ppBmGR2puwtZE3i8kHqJA== X-Received: by 2002:a17:902:f54e:b0:1fa:5fa:aaf9 with SMTP id d9443c01a7336-1fa1d62ba2cmr137549995ad.38.1719381907828; Tue, 25 Jun 2024 23:05:07 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:3c6b:9027:64f0:9805]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5ea7sm91234465ad.175.2024.06.25.23.05.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2024 23:05:07 -0700 (PDT) In-Reply-To: <74F62063-1C20-4257-92BA-F2CF02B9A588@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:287917 Archived-At: > On Jun 24, 2024, at 12:46=E2=80=AFAM, Yuan Fu = wrote: >=20 >=20 >=20 >> On Jun 23, 2024, at 10:38=E2=80=AFAM, Juri Linkov = 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. >>>=20 >>> Hmm, I can=E2=80=99t reproduce with latest master and = libtree-sitter. Maybe you can send me the exact commits that you used? >>>=20 >>> Here=E2=80=99s mine: >>>=20 >>> Emacs: 72f2b01e318 >>> Tree-sitter: 6ec478c1 >>=20 >> Probably reproducibility depends on the content of the src/treesit.c = file. >> Then the most reliable way to reproduce it is this: >>=20 >> 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 >>=20 >> The numbers in (font-lock-ensure 63209 63387) above were extracted >> from diff hunk boundaries that might be different when the file was = edited. >=20 > I reproduce it once with the first set of commits you provided, but = for some reason couldn=E2=80=99t reproduce it again. I=E2=80=99m sure = it=E2=80=99s something wrong that I did. I=E2=80=99ll report back when I = make progress. TBH it seems like something wrong with tree-sitter = itself, but I=E2=80=99ll make sure to figure out what=E2=80=99s the = problem exactly. >=20 > Yuan Ok, I can reproduce it now. Looking into it=E2=80=A6 Yuan