From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: mail@ssbb.me Newsgroups: gmane.emacs.bugs Subject: bug#72863: 30.0.50; tree-sitter elixir-ts-mode hangs and memory leak on some elixir and heex code Date: Wed, 11 Sep 2024 23:22:34 +0400 Message-ID: References: <94F9A716-7D86-42F9-A010-54501ACF9AF8@ssbb.me> <861q27hq4a.fsf@gnu.org> <0F8C0C10-A357-464F-9863-DED85B80D6C8@ssbb.me> <9B6747A4-4959-464C-82C2-3B58B2C04266@gmail.com> <6B5BA7D6-743D-4B12-903B-2852423A3C00@gmail.com> <86seuawv0c.fsf@gnu.org> <3C53EF6A-EFFA-4648-9741-D7ECAB68F227@gmail.com> <86le02wrts.fsf@gnu.org> <32ED815A-70FE-44BB-96E1-A0B1FEA88C43@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_CAC5A4C1-F760-4CF1-B185-FCE8C6DCA48B" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18484"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Wilhelm Kirschbaum , Eli Zaretskii , 72863@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 11 21:24:15 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 1soSwn-0004fi-He for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Sep 2024 21:24:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soSwX-0001Cu-59; Wed, 11 Sep 2024 15:23:57 -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 1soSwV-0001Ce-Jw for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 15:23:55 -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 1soSwV-0001dG-BB for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 15:23:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:Date:Mime-Version:From:To:Subject; bh=rw8xgMgEZxswKafsYJK57ncylpH0wOYfgllfpb446+c=; b=DSpHsJG5Z0hPwcqHwbFEZhDQawrOqnBqidn+2+336cxdZO9bD5aGxpY1qMAwlGQi7ZxW9kyuDjbu5fFU9SSyzd6VFQGcDGCgVUqFwzmplKdChOqij3QawgSj7N80BYwZUiywvH/t+DTHyRlzXTR9NZX5jPQs1Qw+xrUg2dcwie1YcrKGWZGZWquppnJ1AtplXlrDwkimBPYE6FpQ2nNXkrqZd3H5T51y1HtRqpFk3VgYqLuMZWuMnMUegkowJWNooUID3YnftJxdhXfapC25si2SgqXl7xQNS3LOu3I1NBLZkOzQzAn61bAbzyoUGYAFdJvSk/ezNSVKEttxK9cf4Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1soSwc-00046N-0n for bug-gnu-emacs@gnu.org; Wed, 11 Sep 2024 15:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: mail@ssbb.me Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Sep 2024 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72863 X-GNU-PR-Package: emacs Original-Received: via spool by 72863-submit@debbugs.gnu.org id=B72863.172608258915674 (code B ref 72863); Wed, 11 Sep 2024 19:24:01 +0000 Original-Received: (at 72863) by debbugs.gnu.org; 11 Sep 2024 19:23:09 +0000 Original-Received: from localhost ([127.0.0.1]:39584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soSvk-00044i-AE for submit@debbugs.gnu.org; Wed, 11 Sep 2024 15:23:08 -0400 Original-Received: from pv50p00im-ztdg10011201.me.com ([17.58.6.39]:50182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soSvh-00043p-Jv for 72863@debbugs.gnu.org; Wed, 11 Sep 2024 15:23:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ssbb.me; s=sig1; t=1726082573; bh=rw8xgMgEZxswKafsYJK57ncylpH0wOYfgllfpb446+c=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=SNOi0t9cSzqFG5axHpad9ChjoFzMX19SdO9ZmmxLxd5qOaO1xo4/CTJmHYomY2S4l rvkNYWQ4EndwmU8zBuvDLxaP1Y0bTlJ78RHD5YJgdbAFngki4RaCKj26hQyK8FIUQl VQF4aPcla6lC2Go4YPR9HDo8HNbIDWaHScO9LYtblGbaIjEFVh0XnhfUPcFvt1ZGtg k/7tsH82y+KGwAGSgZqCU8rWX7nsCcxN2btrYa3EpFUfNT8rUw364cTLLpgpm/9IIR nfucyEUe0gWQNpQGBmaee026cfrEhhnQnrzvE5oM6LslvMxO2FOtXdJws7YjROTIj+ 4Tb0dbhbTPr2g== Original-Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10011201.me.com (Postfix) with ESMTPSA id 0ECD0680A5D; Wed, 11 Sep 2024 19:22:48 +0000 (UTC) In-Reply-To: <32ED815A-70FE-44BB-96E1-A0B1FEA88C43@gmail.com> X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Proofpoint-ORIG-GUID: FZglYlZcCj_3usyuIYg8F-DVOxVzezMj X-Proofpoint-GUID: FZglYlZcCj_3usyuIYg8F-DVOxVzezMj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_12,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1030 suspectscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2409110148 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:291614 Archived-At: --Apple-Mail=_CAC5A4C1-F760-4CF1-B185-FCE8C6DCA48B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Wow, thank you so much for diving into this issue! I'll keep track of it = in tree-sitter repo from now on. It seems like other integrations somehow manage to avoid hanging or = crashing the main process, so it doesn't affect them? I just checked in the Zed editor again to confirm. When I type a=3D{, it = fails to highlight the rest of the embedded HEEX (but only within the = current function) though. > On Sep 11, 2024, at 7:45=E2=80=AFAM, Yuan Fu = wrote: >=20 >=20 >=20 >> On Sep 8, 2024, at 12:48=E2=80=AFAM, Yuan Fu = wrote: >>=20 >>=20 >>=20 >>> On Sep 8, 2024, at 12:02=E2=80=AFAM, Eli Zaretskii = wrote: >>>=20 >>>> From: Yuan Fu >>>> Date: Sat, 7 Sep 2024 22:57:29 -0700 >>>> Cc: mail@ssbb.me, >>>> wkirschbaum@gmail.com, >>>> 72863@debbugs.gnu.org >>>>=20 >>>>=20 >>>>=20 >>>>> On Sep 7, 2024, at 10:54=E2=80=AFPM, Eli Zaretskii = wrote: >>>>>=20 >>>>>> From: Yuan Fu >>>>>> Date: Sat, 7 Sep 2024 22:44:53 -0700 >>>>>> Cc: Wilhelm Kirschbaum , >>>>>> Eli Zaretskii , >>>>>> 72863@debbugs.gnu.org >>>>>>=20 >>>>>> Meanwhile, I want to push the fix for the other bug I discovered = to emacs-30. Eli, I wrote a debugging function that prints parser = states, naturally this function isn=E2=80=99t called anywhere so = there=E2=80=99ll be a compiler warning, what should I do in this case? >>>>>=20 >>>>> Why would there be a compiler warning? What kind of warning? >>>>=20 >>>> A function-not-used warning. Maybe it=E2=80=99s an lldb thing? >>>=20 >>> If the function is not static, there should be no such warning. >>=20 >> Ah, you=E2=80=99re right, I marked it static. Thanks! >>=20 >> Yuan >=20 > Good news: not an Emacs bug. Bad news: a tree-sitter bug. Turns out I = made an error in my test program, which is the reason why Emacs hangs = but the test program doesn=E2=80=99t. Once I fixed the error, the test = program hangs too. I submitted a bug report to tree-sitter: = https://github.com/tree-sitter/tree-sitter/issues/3620 >=20 > I can finally sleep soundly at night now; and I guess tree-sitter dev = will start having sleepless nights :-) >=20 > Yuan >=20 --Apple-Mail=_CAC5A4C1-F760-4CF1-B185-FCE8C6DCA48B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Wow, thank = you so much for diving into this issue! I'll keep track of it in = tree-sitter repo from now on.

It seems like other integrations = somehow manage to avoid hanging or crashing the main process, so it = doesn't affect them?

I just checked in the Zed editor again to = confirm. When I type a=3D{, it fails to highlight the = rest of the embedded HEEX (but only within the current function) = though.


On Sep 11, = 2024, at 7:45=E2=80=AFAM, Yuan Fu <casouri@gmail.com> = wrote:



On Sep 8, 2024, at 12:48=E2=80=AFAM, Yuan Fu = <casouri@gmail.com> wrote:



On Sep 8, 2024, at 12:02=E2=80=AFAM, Eli Zaretskii = <eliz@gnu.org> wrote:

From: Yuan = Fu <casouri@gmail.com>
Date: Sat, 7 Sep 2024 22:57:29 = -0700
Cc: = mail@ssbb.me,
wkirschbaum@gmail.com,
72863@debbugs.gnu.org


On Sep 7, 2024, at 10:54=E2=80=AFPM, Eli = Zaretskii <eliz@gnu.org> wrote:

From: Yuan Fu <casouri@gmail.com>
Date: Sat, 7 = Sep 2024 22:44:53 -0700
Cc: Wilhelm Kirschbaum = <wkirschbaum@gmail.com>,
Eli Zaretskii = <eliz@gnu.org>,
72863@debbugs.gnu.org

Meanwhile, I want = to push the fix for the other bug I discovered to emacs-30. Eli, I wrote = a debugging function that prints parser states, naturally this function = isn=E2=80=99t called anywhere so there=E2=80=99ll be a compiler warning, = what should I do in this case?

Why would there be a = compiler warning?  What kind of warning?

A = function-not-used warning. Maybe it=E2=80=99s an lldb = thing?

If the function is not static, there should = be no such warning.

Ah, you=E2=80=99re right, I = marked it static. Thanks!

Yuan

Good news: not = an Emacs bug. Bad news: a tree-sitter bug. Turns out I made an error in = my test program, which is the reason why Emacs hangs but the test = program doesn=E2=80=99t. Once I fixed the error, the test program hangs = too. I submitted a bug report to tree-sitter: = https://github.com/tree-sitter/tree-sitter/issues/3620

I can = finally sleep soundly at night now; and I guess tree-sitter dev will = start having sleepless nights = :-)

Yuan


= --Apple-Mail=_CAC5A4C1-F760-4CF1-B185-FCE8C6DCA48B--