Subject: bug#72863: 30.0.50; tree-sitter elixir-ts-mode hangs and memory leak on some elixir and heex code

From: [email-masked]
Date: Wed, 11 Sep 2024 23:22:34 +0400

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={, it fails to highlight the rest of the embedded HEEX (but only within the current function) though.

> On Sep 11, 2024, at 7:45 AM, Yuan Fu <[email-masked]> wrote:
> 
> 
> 
>> On Sep 8, 2024, at 12:48 AM, Yuan Fu <[email-masked]> wrote:
>> 
>> 
>> 
>>> On Sep 8, 2024, at 12:02 AM, Eli Zaretskii <[email-masked]> wrote:
>>> 
>>>> From: Yuan Fu <[email-masked]>
>>>> Date: Sat, 7 Sep 2024 22:57:29 -0700
>>>> Cc: [email-masked],
>>>> [email-masked],
>>>> [email-masked]
>>>> 
>>>> 
>>>> 
>>>>> On Sep 7, 2024, at 10:54 PM, Eli Zaretskii <[email-masked]> wrote:
>>>>> 
>>>>>> From: Yuan Fu <[email-masked]>
>>>>>> Date: Sat, 7 Sep 2024 22:44:53 -0700
>>>>>> Cc: Wilhelm Kirschbaum <[email-masked]>,
>>>>>> Eli Zaretskii <[email-masked]>,
>>>>>> [email-masked]
>>>>>> 
>>>>>> 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’t called anywhere so there’ll 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’s an lldb thing?
>>> 
>>> If the function is not static, there should be no such warning.
>> 
>> Ah, you’re 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’t. 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
>