Subject: bug#71012: 30.0.50; tree-sitter crash

From: Yuan Fu <[email-masked]>
Date: Thu, 25 Jul 2024 00:26:30 -0700

> On Jul 24, 2024, at 10:27 PM, Eli Zaretskii <[email-masked]> wrote:
> 
>> From: "Basil L. Contovounesios" <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Thu, 25 Jul 2024 01:32:01 +0200
>> 
>> Eli Zaretskii [2024-07-24 19:31 +0300] wrote:
>> 
>>>> Cc: [email-masked], [email-masked]
>>>> From: "Basil L. Contovounesios" <[email-masked]>
>>>> Date: Wed, 24 Jul 2024 16:57:53 +0200
>>>> 
>>>> Ping: thoughts on whether this is an issue?
>>> 
>>> Thoughts about what? what is deemed to be a problem in this case?
>> 
>> That each call to treesit-parse-string now allocates a new internal
>> buffer which is not automatically GCed.
>> 
>> If this cannot be avoided, I think the docs should at least warn that
>> it's the caller's responsibility to kill the return node's buffer when
>> finished with it.
> 
> If the buffers aren't killed by the code, it's indeed an issue that
> needs to be solved.  At the time I suggested that the node's buffer is
> killed when the node is GC'ed or deleted -- have this not been done?

No. I think it’s best to implement treesit-parse-string in C with ts_parse_string now. That way we don’t need to worry about the temp buffer.

Yuan