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: Mon, 24 Jun 2024 00:46:22 -0700 Message-ID: <74F62063-1C20-4257-92BA-F2CF02B9A588@gmail.com> References: <86h6dny3om.fsf@mail.linkov.net> <9D0E4C93-9CCC-4C0E-BDF7-CB6F09132C23@gmail.com> <86o77rpnjz.fsf@mail.linkov.net> 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="29197"; 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 Mon Jun 24 09:48:28 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 1sLeR9-0007NY-NZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 09:48:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLeQl-0000o0-M7; Mon, 24 Jun 2024 03:48: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 1sLeQk-0000nI-6I for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 03:48: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 1sLeQj-0004TT-TU for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 03:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLeQj-0002Kj-SF for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 03:48: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: Mon, 24 Jun 2024 07:48: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.17192152648931 (code B ref 71681); Mon, 24 Jun 2024 07:48:01 +0000 Original-Received: (at 71681) by debbugs.gnu.org; 24 Jun 2024 07:47:44 +0000 Original-Received: from localhost ([127.0.0.1]:44752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLeQR-0002Jw-C7 for submit@debbugs.gnu.org; Mon, 24 Jun 2024 03:47:43 -0400 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:50487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLeQP-0002Jd-77 for 71681@debbugs.gnu.org; Mon, 24 Jun 2024 03:47:41 -0400 Original-Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2c70c372755so3148572a91.1 for <71681@debbugs.gnu.org>; Mon, 24 Jun 2024 00:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719215194; x=1719819994; 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=i67PzVw+QVoxI00vrZa7NC2xx64TVdaCX21KonL0iKg=; b=XR32cTqfVxbTNJD9a4mINIQD9JMqi3qpa7OLVOPOr8BZd8KTd3NiYH0yQ+8LkTWZVH YCA4jAJ2pPM7HBkioxFfRY5RiTg7mX81lxiDeWgao44Yu8j/RJrmBH7sc1dmwNVjyleo Jnc+FqNR8gX/UP3geSbCezbJ/RfbKahykKKSaSB+r/W3XgjHIdF58h6hTgHCQqtZKDf6 7Ua6N1ECHF0CjZR8H9mHYtfCKZ8KvgG0Ik5sr3SdGBjIoVwcDvL2g4liXWEN6GhpkvBe Z3YDK99C0u0LeQItvmv8D0AYMELOXBpa5U2u2dG1GNUH64gq+85e77qiANXrm7j66YLf bBDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719215194; x=1719819994; 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=i67PzVw+QVoxI00vrZa7NC2xx64TVdaCX21KonL0iKg=; b=fUNNHAAi5/FUx75VEZfhVKd/R4Kv693WW+fEpRzTozlMXdIRmrD1kT+KfwAY71ps60 Y6RrgEhE4AjWRcZ6hyK0aFUdNl1DGczdv+2gKquEerIYIKkboP0xBIhNuyx7TNt161sL aoPrmQOvUdMVvz1mbwuUUYXvayxqTYtvlRkATV44hZN71yo0j071vUWQLiyiqZ3aTrLS Lv+k8fslmUb1r2PcXzj/7doxTyMaV0xXuUKGRf/Vx8xpSnq87f/RVOGg7qFUXF98lZwJ g1t44lYt2f8mmOgACmCmUq7brBbpPkHvZcEBrwYceYkpA+qjL6utBUQWcfMJv8gQQCSO uYag== X-Gm-Message-State: AOJu0Yx8CTxkegrxHTIDpxh8mnWAwV1X8CnNnjHA+3SL3p88Fmt6xbe6 2lrqlkWAgmwm01aDtymK72wdcjmb8VJ6u/ydmb6fkkcvVgbtbgqV X-Google-Smtp-Source: AGHT+IGFAqP5Jufvw/CRf/QMBmjs8E/YTVDEytHCFgEerH+KziTohEezl9W4n96NTo7fZ7shjClY4g== X-Received: by 2002:a17:90a:df16:b0:2c1:ebc4:4f1f with SMTP id 98e67ed59e1d1-2c86146c874mr2245320a91.33.1719215194070; Mon, 24 Jun 2024 00:46:34 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:20fa:247c:4f0e:e2a2]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c7e64a2bc8sm8078091a91.54.2024.06.24.00.46.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2024 00:46:33 -0700 (PDT) In-Reply-To: <86o77rpnjz.fsf@mail.linkov.net> 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:287825 Archived-At: > 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. 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. Yuan=