GNU bug report logs - #59426
29.0.50; [tree-sitter] Some functions exceed maximum recursion limit

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Yuan Fu <casouri@HIDDEN>; Done: Yuan Fu <casouri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 29.1, send any further explanations to 59426 <at> debbugs.gnu.org and Yuan Fu <casouri@HIDDEN> Request was from Yuan Fu <casouri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 27 Nov 2022 02:36:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 26 21:36:57 2022
Received: from localhost ([127.0.0.1]:41773 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oz7XN-00024J-AL
	for submit <at> debbugs.gnu.org; Sat, 26 Nov 2022 21:36:57 -0500
Received: from mail-pj1-f46.google.com ([209.85.216.46]:46821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oz7XJ-00024D-Dv
 for 59426 <at> debbugs.gnu.org; Sat, 26 Nov 2022 21:36:54 -0500
Received: by mail-pj1-f46.google.com with SMTP id
 b13-20020a17090a5a0d00b0021906102d05so5831819pjd.5
 for <59426 <at> debbugs.gnu.org>; Sat, 26 Nov 2022 18:36:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=GkllL0tpMfSihB5Pbhp03DgS+84px31kdEcMHzZNWSA=;
 b=el83vYr2q/i6ffHG0sVSDUfj6GThRlVu5vZT5tQ7UhUkInfPLsVWXSI7WfpL1AaHKJ
 g0jTcUAQRpWgdBqSmvsmq2w6gE0zai3OYINAsNJPAJBUAAQD5XohDlargy2JHdDM2y+c
 5wYyZKk5PgGL1sdHmqjt57XwvhASETjqVtV9DKN76zKCpC/vg4IDEd0Eus912wDkymRC
 RpcLPDnZzKD61yGl9MxJ/Fh+46ewL8Mxecp9pjDv9aUU+MRpJ1aYuUQGqUVPNZPDtd/X
 QqZlyBjHGW6hVojDQrB9+Bxbjq8nM/XUIWGubnoA1zx+PYMZggi56Km9P5pDiuEU5Bnt
 dvgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=GkllL0tpMfSihB5Pbhp03DgS+84px31kdEcMHzZNWSA=;
 b=n6GGj0AnjSw0SXMGZQ2v9dgQ/Gm5UdUOr3dWMsF1QL2G0kg0Y9aCAeemgUJMxoCQvV
 djxUnmQhFszZg+9rJ4qliFDsxB+RpDSRND0QUkYogLJv9eFV/OXqaoHh7h7Olv0+1p2r
 O5sS8SNw0fGWOXQ6QXhhRHke/2UFarFmIb79K68JqikSa089iOfEC6GI62cRCQjhYvKX
 GrsEvZRP1r6yREBAOTtavv6KEyW4ns9pb7xXmUfpjKzr1hq0kkTREKZy0x/6kFMtAI7A
 JGd5SNUHa1qsE9VPnU1C1buEjKdKBfZ4ug1Que2smER6Ef7kJ+UjadOG8KnhJlg/P017
 x3lw==
X-Gm-Message-State: ANoB5plYzBWuPKZCo/z+o0yyRQf3TkzZv0uAoGfa+7ZRXBJ7wxM5PR2J
 GhfFqrUYwlyaOqFuNCwsGk4=
X-Google-Smtp-Source: AA0mqf62ucvhWHl1dd6y3wFGRQAymM+9m8qOeZXYKVtFq9+FTscpGlsnWfv3cBFx43x5eGDn5DzNzg==
X-Received: by 2002:a17:90b:3551:b0:218:f477:da29 with SMTP id
 lt17-20020a17090b355100b00218f477da29mr18262474pjb.245.1669516607580; 
 Sat, 26 Nov 2022 18:36:47 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 pl18-20020a17090b269200b00218f830c63esm5140198pjb.1.2022.11.26.18.36.46
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 26 Nov 2022 18:36:47 -0800 (PST)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83y1s0up7z.fsf@HIDDEN>
Date: Sat, 26 Nov 2022 18:36:45 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <6E82ED98-32C7-4E46-B439-C37841689824@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
 <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
 <104387C6-BF9A-4243-AD64-1ADCC25CBBA0@HIDDEN>
 <C7E01F6C-F693-400B-ACD4-2FED38357881@HIDDEN> <83y1s0up7z.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>,
 =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>, 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 24, 2022, at 11:28 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Thu, 24 Nov 2022 11:25:58 -0800
>> Cc: Eli Zaretskii <eliz@HIDDEN>,
>> Po Lu <luangruo@HIDDEN>,
>> Stefan Kangas <stefankangas@HIDDEN>,
>> 59426 <at> debbugs.gnu.org
>>=20
>> That brings us back to the original question: what limit should we =
use? I suggest we use a smaller number since normal tree should never be =
very tall. Running the following code tells me the height of the tree =
for xdisp.c is 30:
>>=20
>> (defun measure-height (node)
>>  (let ((children (treesit-node-children node t)))
>>    (if children
>>        (1+ (apply #'max (mapcar #'measure-height children)))
>>      1)))
>> ;; In xdisp.c:
>> (measure-height (treesit-buffer-root-node))
>>=20
>> Maybe a limit in the range of hundreds or thousands? 800?
>=20
> I suggest 1000.

Ok, I added the default limit in cc086f37e89.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 24 Nov 2022 19:28:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 14:28:08 2022
Received: from localhost ([127.0.0.1]:60235 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyHtI-0006rC-0f
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 14:28:08 -0500
Received: from eggs.gnu.org ([209.51.188.92]:57906)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oyHtG-0006qi-CO
 for 59426 <at> debbugs.gnu.org; Thu, 24 Nov 2022 14:28:06 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oyHtA-0003Wx-P0; Thu, 24 Nov 2022 14:28:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=O/+xVkMZ4AqihdIvknGlr0oEORpPxRuIEGYZK49sIKI=; b=kakDE2Trq+xo
 jojaTMozCd75rRQUTwTpqsVfjzRXvPV7HB9Q5LNM3Xmx4t/+Ff7b2vXVYAbnIDDFJRD5XBYTmJGyv
 q6z25oqQXwasmCfo2n3nqf6bmmGvqgQnFwkm4miDeUE4dPm1ANxzmAYWs91J5XLMpN2QSegw0Sbs0
 YgcD7iTQ7OaombaqdmJ0JscL5EQG6X1FpNFL0vjxpXdmC5n67bf/MY9PLAuOK8W8din2WuWJDWCWQ
 Ewek5rsfcd/FiHxtyEDylNt9WTwMEwJyQlcmXO7yBaz4IoU1ggLMQ3VqbHDsZC5TPxj832yPLWAsi
 cuEKCwlXO/8sIqzwd3Tp5Q==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oyHt7-0007x5-Nu; Thu, 24 Nov 2022 14:27:59 -0500
Date: Thu, 24 Nov 2022 21:28:16 +0200
Message-Id: <83y1s0up7z.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <C7E01F6C-F693-400B-ACD4-2FED38357881@HIDDEN> (message from
 Yuan Fu on Thu, 24 Nov 2022 11:25:58 -0800)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
 <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
 <104387C6-BF9A-4243-AD64-1ADCC25CBBA0@HIDDEN>
 <C7E01F6C-F693-400B-ACD4-2FED38357881@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Thu, 24 Nov 2022 11:25:58 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Po Lu <luangruo@HIDDEN>,
>  Stefan Kangas <stefankangas@HIDDEN>,
>  59426 <at> debbugs.gnu.org
> 
> That brings us back to the original question: what limit should we use? I suggest we use a smaller number since normal tree should never be very tall. Running the following code tells me the height of the tree for xdisp.c is 30:
> 
> (defun measure-height (node)
>   (let ((children (treesit-node-children node t)))
>     (if children
>         (1+ (apply #'max (mapcar #'measure-height children)))
>       1)))
> ;; In xdisp.c:
> (measure-height (treesit-buffer-root-node))
> 
> Maybe a limit in the range of hundreds or thousands? 800?

I suggest 1000.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 24 Nov 2022 19:26:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 14:26:07 2022
Received: from localhost ([127.0.0.1]:60229 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oyHrL-0006oI-FR
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 14:26:07 -0500
Received: from mail-pl1-f174.google.com ([209.85.214.174]:42696)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oyHrK-0006np-H2
 for 59426 <at> debbugs.gnu.org; Thu, 24 Nov 2022 14:26:07 -0500
Received: by mail-pl1-f174.google.com with SMTP id b21so2163480plc.9
 for <59426 <at> debbugs.gnu.org>; Thu, 24 Nov 2022 11:26:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=kAfS1xg16Dv3dgPqfKIjs5Qtx0X1i/mBqwyQSTKw9xI=;
 b=Cg68QrrmzqHjE/yVBTMOAg33BomRuUUD/mHN/6CB3hL4qBzmfThm+ojz3u75UvnwTN
 W1ExlGX4/5YvsSaEmm00x8CLX4C/2CETmqcVSMjY4Pu3EMgZByvail0RwUpPF/cV8bPT
 DJKs1xf8vpWCQeEmbEWFwg/JuQzGPDKH1pfunSxn/IvrApqkaz7dN/lBzosg5fOcuQhV
 +g0DmxPzS4H1BUFKQPBMfwh6pv2aZFei4uDrrAFb/F/jEG9UncK1ZDaTWmTCddfyXsob
 TSXkFO5MmkuX4rlZoPz6H2mxnAENpYU7M4VuWQ2AFmlgwjpmHEnBHIXbaq8AnBebHExl
 y0lQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=kAfS1xg16Dv3dgPqfKIjs5Qtx0X1i/mBqwyQSTKw9xI=;
 b=nliEZrj61voFS/wv/QzGRxT8WeweKwtIg+idTNye7+uBiNtRRPV8vP2hd4wGDFZeGD
 LL8K9aljIL4d7dXO6RLj7qE2RMoKRaTdp/VejXWuzCtbYpeBeS75NnB/3Noq9LSjpD4N
 eQPTjPFLOjTv+Be24xO7dl7z/Lpno/cAsTyY3utJpkgD/Q3hZBJRcpzmIGI8FPh+9KRi
 nOlksdE3TfE5Ekt+8vHoAIJPimq+zF8uuwe2tb4O5oaTmBvgjC2re0HTDl1gP3laKYXB
 dODHjvnZyIFdPOQ7meTHLGz/x2MwMFKBHSeRgI2eqdQNOxhk/CLYucgX+TZMEdPZp52D
 0s6g==
X-Gm-Message-State: ANoB5pnwMnAGN5zq4i/j9rxeUAyuMtaSk7LRHHdjdA4L3tqaJ2UflJRx
 wvEjneReAVxpmdwgzFUE52o=
X-Google-Smtp-Source: AA0mqf6sW/t6n6XC0loVLdeEvOFkSdO4OqJexEwGcgYqZJrLoe0ULvdtsS/7D4WjybM9sdEeSVnxMA==
X-Received: by 2002:a17:902:8e81:b0:188:4f86:e4d5 with SMTP id
 bg1-20020a1709028e8100b001884f86e4d5mr16617052plb.16.1669317960566; 
 Thu, 24 Nov 2022 11:26:00 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 nh15-20020a17090b364f00b001fb1de10a4dsm1514660pjb.33.2022.11.24.11.25.59
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 24 Nov 2022 11:26:00 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <104387C6-BF9A-4243-AD64-1ADCC25CBBA0@HIDDEN>
Date: Thu, 24 Nov 2022 11:25:58 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <C7E01F6C-F693-400B-ACD4-2FED38357881@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
 <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
 <104387C6-BF9A-4243-AD64-1ADCC25CBBA0@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 24, 2022, at 2:24 AM, Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> =
wrote:
>=20
> 24 nov. 2022 kl. 10.17 skrev Yuan Fu <casouri@HIDDEN>:
>=20
>> Does it worth the complexity tho? We only need a stack if we want to =
support this scenario, in which case tree-sitter has a wrong parse tree. =
Instead of spending the time and resource to go down that deep tree, =
it=E2=80=99s better to fail early, and let the user decide to either =
give up on weird files, or try some other approximation.
>>=20
>> It=E2=80=99s too early to tell if being able to go down arbitrarily =
deep into a deep tree is useful. The only use of traversing the whole =
tree right now is to generate the imenu indexes, which don=E2=80=99t =
really need to go down more than 10 levels, since most defun nodes we =
are interested in are either top-level or near top-level.
>=20
> You may very well be right about that.

That brings us back to the original question: what limit should we use? =
I suggest we use a smaller number since normal tree should never be very =
tall. Running the following code tells me the height of the tree for =
xdisp.c is 30:

(defun measure-height (node)
  (let ((children (treesit-node-children node t)))
    (if children
        (1+ (apply #'max (mapcar #'measure-height children)))
      1)))
;; In xdisp.c:
(measure-height (treesit-buffer-root-node))

Maybe a limit in the range of hundreds or thousands? 800?

>=20
>> So I=E2=80=99d prefer we keep it simple and have a hard limit for =
now. If we later find that a stack is favorable we can always add it in.
>=20
> That sounds good. Maybe the #line snag in the packet-rrc.c example =
should be reported upstream?

I stole your sample and opened an issue on their GitHub repo:=20

https://github.com/tree-sitter/tree-sitter-c/issues/118

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 24 Nov 2022 10:24:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 05:24:29 2022
Received: from localhost ([127.0.0.1]:57364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oy9PA-0006E3-Qw
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 05:24:29 -0500
Received: from mail74c50.megamailservers.eu ([91.136.10.84]:53728
 helo=mail92c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oy9P8-0006Du-Pe
 for 59426 <at> debbugs.gnu.org; Thu, 24 Nov 2022 05:24:28 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669285464;
 bh=AHtuVvanlIOoXtqGzLpTOOaoLkrDPSlR9RVh8lMFwg0=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=OYn9WWDdX13MXq97j3i2FWxsc62rxKQL4g2qFRDXz09Zwmni3ZTeevENEbkgwBdtM
 1xVjkG0fD/Y04fi3K6aKfVeHfyUsUy18OI02pHkj/Yl5NmhEjIfmBoJ4dYeDq5KYPW
 TEnhfdY7imfVN2GOozSI6yIUqdiqht7G95gcu8vw=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail92c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2AOAOKD0051132; 
 Thu, 24 Nov 2022 10:24:22 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
Date: Thu, 24 Nov 2022 11:24:19 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <104387C6-BF9A-4243-AD64-1ADCC25CBBA0@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
 <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F24.637F4658.005B, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

24 nov. 2022 kl. 10.17 skrev Yuan Fu <casouri@HIDDEN>:

> Does it worth the complexity tho? We only need a stack if we want to =
support this scenario, in which case tree-sitter has a wrong parse tree. =
Instead of spending the time and resource to go down that deep tree, =
it=E2=80=99s better to fail early, and let the user decide to either =
give up on weird files, or try some other approximation.
>=20
> It=E2=80=99s too early to tell if being able to go down arbitrarily =
deep into a deep tree is useful. The only use of traversing the whole =
tree right now is to generate the imenu indexes, which don=E2=80=99t =
really need to go down more than 10 levels, since most defun nodes we =
are interested in are either top-level or near top-level.

You may very well be right about that.

> So I=E2=80=99d prefer we keep it simple and have a hard limit for now. =
If we later find that a stack is favorable we can always add it in.

That sounds good. Maybe the #line snag in the packet-rrc.c example =
should be reported upstream?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 24 Nov 2022 10:24:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 05:24:21 2022
Received: from localhost ([127.0.0.1]:57361 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oy9P3-0006Dk-I6
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 05:24:21 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oy9P1-0006DV-7t
 for 59426 <at> debbugs.gnu.org; Thu, 24 Nov 2022 05:24:19 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oy9Ow-00057C-08; Thu, 24 Nov 2022 05:24:14 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=GXCNAPZcFM4HAnN/P9t2RT5KoqeZlB7Jl0fdQDL+Hrw=; b=l0s3Kg64lNHdKtIUeEeT
 9iBMrsMZLjEgo9cs8arykrZNbjcDz7qT/VL+vsppszogUuqH3ugGuFTvPLzEsI11VY/BRh4rzZ/Q0
 aiK7WF5n9HcBpLaCrwL2ExFyEYt2tYmev7+ZurySFPwBIT/zJNaO3jPrwVZWEBlFqoqOlntriJjgy
 9N7vUb6F6+SiIilfevL4gwwRrXUvJf9Dpd1CRTWX+Q1u7NKhirHFeqId/MeksfuGP8QiIEye6NeVI
 VWRiQfj4WPC0JIxN/tCnItwCr/bxroxIXuEsSwto4r8iPU6NuODvDH+E+gj3OQyS1mpS8r+99Mc7A
 byl0YXxtGdx89w==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oy9Ov-0007mx-F5; Thu, 24 Nov 2022 05:24:13 -0500
Date: Thu, 24 Nov 2022 12:24:33 +0200
Message-Id: <83v8n4wsym.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN> (message from
 Yuan Fu on Thu, 24 Nov 2022 01:17:02 -0800)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
 <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Thu, 24 Nov 2022 01:17:02 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Po Lu <luangruo@HIDDEN>,
>  Stefan Kangas <stefankangas@HIDDEN>,
>  59426 <at> debbugs.gnu.org
> 
> So I’d prefer we keep it simple and have a hard limit for now. If we later find that a stack is favorable we can always add it in.

I tend to agree.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 24 Nov 2022 09:17:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 24 04:17:13 2022
Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oy8M4-0004YF-Sa
	for submit <at> debbugs.gnu.org; Thu, 24 Nov 2022 04:17:13 -0500
Received: from mail-pj1-f50.google.com ([209.85.216.50]:44914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oy8M2-0004Y1-Il
 for 59426 <at> debbugs.gnu.org; Thu, 24 Nov 2022 04:17:11 -0500
Received: by mail-pj1-f50.google.com with SMTP id
 b1-20020a17090a7ac100b00213fde52d49so1096398pjl.3
 for <59426 <at> debbugs.gnu.org>; Thu, 24 Nov 2022 01:17:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=2mh6xGu6Tuo4yfHuz0HbIt4CwE+IcOTZGywtRtRM1YI=;
 b=kTP54Tg6jGOr7ZbGdYHPay+K6j4chC9ISNnfGqXi4OCs3orRfnUqO4nZ4ZSXnKFV52
 ujz2nba1Rj12CvaLFBM3MHESICU0PAqLli+aK/ddIFqsdMlPDRKSMEprpa1p84v8IrJ1
 A6XpqVACRANcUtMlbHjb9aOiGKt6naGXF+F+3spgDDIONPzr9GoRxUB7GacuTjn8hlX7
 5Pyi2UqHbA/2GmnAphQ8x3+v/1Cr2m7wUSyW+WIQQzU9/Nmeh/xFF1FU7u3ghPHA97tG
 4Xb9RtYdjRFAc7PDPm+a7SLoW5kP2Bild0g1LadQ1NuUAF8A2jUJUC8cCHUCicC6+34/
 Gxuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=2mh6xGu6Tuo4yfHuz0HbIt4CwE+IcOTZGywtRtRM1YI=;
 b=E5kNTVizs7482SmIZ5Qex9VUEQcrdbeut1c4Jxf2qRIwge59XXWeY74OF/zo9lriT2
 Gq0ZU36TfbgIybuvIQ3pDy2Qp4yqAHg/FTQ+cW/tHjHr1B6oINBv1AEKf8FqfTRn44IG
 Nk8w4jTKZVPlCeUl1Y9yCiRN8BG3LlZ6YugWVGAvF90C7rhgdQzIMEiFcqJGYm0VaEyS
 plIx0450apuoJg48/6r0TT+bnL8W1wLqkhkkK9dDs7MvVOT0/NuuxLEGLARTq4/0EnZi
 tVLCw2orJ9BMlWua7Cusvk/CnwY/YfHrLvzUJk1A1PHtEZgsC0bMX6C8THSbWdwEHfjV
 yJWg==
X-Gm-Message-State: ANoB5pnhmUiptfvkUeps3XXyYque/a5aIk9mYtNzBRiC3vmJFMPJPmrC
 KNbeQWL7xbB2CEa9G2CJE40=
X-Google-Smtp-Source: AA0mqf43SorSK9ONal/IQ9Dw2lI7Ojf4mrQEIZzI8eG6NJRcRveSF2Dh0ALGwO7CHyNbPW2UyQ/cfQ==
X-Received: by 2002:a17:90a:9706:b0:218:7ccd:d487 with SMTP id
 x6-20020a17090a970600b002187ccdd487mr31653209pjo.18.1669281424657; 
 Thu, 24 Nov 2022 01:17:04 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 o5-20020a17090aac0500b0020ae09e9724sm719759pjq.53.2022.11.24.01.17.03
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 24 Nov 2022 01:17:04 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
Date: Thu, 24 Nov 2022 01:17:02 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <B74EC69F-7ACC-4A1D-A4AA-F724E5C244FA@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
 <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 23, 2022, at 12:01 PM, Mattias Engdeg=C3=A5rd =
<mattiase@HIDDEN> wrote:
>=20
> 23 nov. 2022 kl. 19.46 skrev Yuan Fu <casouri@HIDDEN>:
>=20
>> It shouldn=E2=80=99t, but tree-sitter thinks some closing brackets =
are erroneous and skips them when parsing (it skips erroneous tokens in =
the hope to parse the rest of the file despite local errors). So a 10k =
wide tree becomes 10k tall.
>>=20
>> We can submit a bug repot to tree-sitter-c (=E2=80=9Cmaybe don=E2=80=99=
t skip closing brackets even there is error, or somthing=E2=80=9D), but =
that=E2=80=99s another story.
>=20
> Thanks for the explanation. In this case it seems that it's the #line =
directive that throws a spanner in the works. You probably already =
discovered that, but for the record, here is a cut-down example:
>=20
> static hf_register_info hf[] =3D {
> #line 1 "./asn1/rrc/packet-rrc-hfarr.c"
>    { &hf_rrc_DL_DCCH_Message_PDU,
>      { "DL-DCCH-Message", "rrc.DL_DCCH_Message_element",
>        FT_NONE, BASE_NONE, NULL, 0,
>        NULL, HFILL }},
>    { &hf_rrc_cellIdentity_c_id,
>       {"Cell Identifier", "rrc.cellIdentity.c_id",
>       FT_UINT32, BASE_DEC, NULL, 0,
>       "The Cell Identifier (C-Id) part of the Cell Identity", HFILL }}
>  };
>=20
> Note how the warning colour of the curly brackets vanishes once the =
#line line is removed.
> Even if this snag is corrected, there will always be cases where =
preprocessor use causes trouble of this or a similar kind. It seems =
quite convincing that we should void C recursion in favour of explicit =
stacks where possible.
>=20

Does it worth the complexity tho? We only need a stack if we want to =
support this scenario, in which case tree-sitter has a wrong parse tree. =
Instead of spending the time and resource to go down that deep tree, =
it=E2=80=99s better to fail early, and let the user decide to either =
give up on weird files, or try some other approximation.

It=E2=80=99s too early to tell if being able to go down arbitrarily deep =
into a deep tree is useful. The only use of traversing the whole tree =
right now is to generate the imenu indexes, which don=E2=80=99t really =
need to go down more than 10 levels, since most defun nodes we are =
interested in are either top-level or near top-level.

So I=E2=80=99d prefer we keep it simple and have a hard limit for now. =
If we later find that a stack is favorable we can always add it in.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 23 Nov 2022 20:02:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 23 15:02:08 2022
Received: from localhost ([127.0.0.1]:56328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxvwd-0006R8-24
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 15:02:08 -0500
Received: from mail1455c50.megamailservers.eu ([91.136.14.55]:42508
 helo=mail266c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxvwX-0006QS-Iq
 for 59426 <at> debbugs.gnu.org; Wed, 23 Nov 2022 15:02:06 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669233713;
 bh=6EnimGgpU6TExmU+z8yNHIfXOhP6rGgNQx8ZqFI12/8=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=DAoR22vDt4pMrbg+7RhqRso1ZVJmsteMAD9bQcLjUDb034CFEwpzEJ3J2lPA+QOmX
 x5MWFsvKZ1HA5vqh4J2CM8MdDJLzFa4iW1GKRF/sYsw9+ewZnSxtz56ACxMwsDTq8+
 OxvTyqHDCGAc4nPDR5LuKrWpxh3cnMNTkhhg+AFU=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ANK1nis030093; 
 Wed, 23 Nov 2022 20:01:51 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
Date: Wed, 23 Nov 2022 21:01:49 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <6822E77F-3094-4E73-A7E7-EF5C096FC08F@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
 <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F21.637E7C31.002D, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

23 nov. 2022 kl. 19.46 skrev Yuan Fu <casouri@HIDDEN>:

> It shouldn=E2=80=99t, but tree-sitter thinks some closing brackets are =
erroneous and skips them when parsing (it skips erroneous tokens in the =
hope to parse the rest of the file despite local errors). So a 10k wide =
tree becomes 10k tall.
>=20
> We can submit a bug repot to tree-sitter-c (=E2=80=9Cmaybe don=E2=80=99t=
 skip closing brackets even there is error, or somthing=E2=80=9D), but =
that=E2=80=99s another story.

Thanks for the explanation. In this case it seems that it's the #line =
directive that throws a spanner in the works. You probably already =
discovered that, but for the record, here is a cut-down example:

static hf_register_info hf[] =3D {
#line 1 "./asn1/rrc/packet-rrc-hfarr.c"
    { &hf_rrc_DL_DCCH_Message_PDU,
      { "DL-DCCH-Message", "rrc.DL_DCCH_Message_element",
        FT_NONE, BASE_NONE, NULL, 0,
        NULL, HFILL }},
    { &hf_rrc_cellIdentity_c_id,
       {"Cell Identifier", "rrc.cellIdentity.c_id",
       FT_UINT32, BASE_DEC, NULL, 0,
       "The Cell Identifier (C-Id) part of the Cell Identity", HFILL }}
  };

Note how the warning colour of the curly brackets vanishes once the =
#line line is removed.
Even if this snag is corrected, there will always be cases where =
preprocessor use causes trouble of this or a similar kind. It seems =
quite convincing that we should void C recursion in favour of explicit =
stacks where possible.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 23 Nov 2022 18:46:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 23 13:46:23 2022
Received: from localhost ([127.0.0.1]:56230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxulK-0004Sb-NC
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 13:46:23 -0500
Received: from mail-pf1-f176.google.com ([209.85.210.176]:41957)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oxulJ-0004SP-4C
 for 59426 <at> debbugs.gnu.org; Wed, 23 Nov 2022 13:46:21 -0500
Received: by mail-pf1-f176.google.com with SMTP id 130so18115342pfu.8
 for <59426 <at> debbugs.gnu.org>; Wed, 23 Nov 2022 10:46:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=LM+4hcoft0TndeExBYI4JzA/MiyefmmQwjTmAN107n4=;
 b=UiyzHVF2x8EEzSSEQqveN8Y6XH82XXy5ythOYQzdqocm+8v2ZMZpNpEXnYlkf586qx
 JThEovCgMc3PDUgEqDsQpODqvJhfBipkOK+qvDK9B5GR2yzlQFd4hCA5jvgqmhSaYgC1
 Jw6nm7Kas4ogh6EOpM5IP/pyIKRDwesfMXDVR3P0unJCE4+8OZhn3IEyZfvGLwfiLbbZ
 +dhKU0rjVw8A+CfAoZVMh6TBI0YJ/JwnqEEp/17/Ncp+BHzMc+854BPb37jQWQDH29rH
 T9Jvj8M5FB8OzewCRzNwgADr0E6b/llf4ObEURNKhUln2k9u1T5LNspA7GL/qr0kD3Tg
 dN7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=LM+4hcoft0TndeExBYI4JzA/MiyefmmQwjTmAN107n4=;
 b=RyOBGZ5qy7GeWM86AjUjO1OmEeuzVB7yXsmjV6XPfd9HDw3B61xsqPVYFGSZCBKaKg
 TmBep/dCVpZBo04PpPCtS3HvajhcnJMEpsovDBLZi/etzml99M9gUUX1DUEceTDlXw4+
 ml4UyF62pNH58bUMMmjTVfpZq+51QKJFj43dgGkpMMPbN1W0K2p9zysTuiBrtlGYX7nd
 +p+zfONsTamOYWXGLXhd0FFKKyRMov/ibeIGMu2lmqQJNVXmR/YYJYhYyFkpM7KquYOV
 e8XvcQlxMhRnj5EuRe6FM88VlOvW7UTJChBiSioFn/5lIKhM51sevhyI8N0zCznPh5sz
 j8aw==
X-Gm-Message-State: ANoB5pk0SoGHkpzIa3McgeebgZM/GudBfKH4qqQFdRQ21daLOVnwuK+f
 aUcE+/pnfm2fVrBCdL0msXo=
X-Google-Smtp-Source: AA0mqf47ZMvaTNn6UlvPHSSf8iXYTsJRDIOQpIgt25dxq2+mMmpFNVMhluBOPlTDMBgsfpA5Bdwh3Q==
X-Received: by 2002:a63:1b52:0:b0:476:cba9:eba4 with SMTP id
 b18-20020a631b52000000b00476cba9eba4mr12296706pgm.350.1669229175271; 
 Wed, 23 Nov 2022 10:46:15 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 b13-20020a170903228d00b00174d9bbeda4sm14695081plh.197.2022.11.23.10.46.14
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 23 Nov 2022 10:46:14 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
Date: Wed, 23 Nov 2022 10:46:13 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <04236EB0-122B-41D0-B696-CC2EFA4B6A93@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
 <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 23, 2022, at 2:40 AM, Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> =
wrote:
>=20
> 23 nov. 2022 kl. 00.19 skrev Yuan Fu <casouri@HIDDEN>:
>=20
>> It=E2=80=99s a machine generated file with syntax that tree-sitter-c =
can=E2=80=99t handle very well. The file is from bug#45248.
>=20
> If you mean =
https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet=
-rrc.c, then the parse tree would certainly be wide but not at all tall =
as far as I can tell. There is a fairly long array initialiser in there, =
but I've seen worse -- and it shouldn't be treated recursively, should =
it?

It shouldn=E2=80=99t, but tree-sitter thinks some closing brackets are =
erroneous and skips them when parsing (it skips erroneous tokens in the =
hope to parse the rest of the file despite local errors). So a 10k wide =
tree becomes 10k tall.

We can submit a bug repot to tree-sitter-c (=E2=80=9Cmaybe don=E2=80=99t =
skip closing brackets even there is error, or somthing=E2=80=9D), but =
that=E2=80=99s another story.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 23 Nov 2022 10:40:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 23 05:40:31 2022
Received: from localhost ([127.0.0.1]:53792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxnB8-0006zO-TK
	for submit <at> debbugs.gnu.org; Wed, 23 Nov 2022 05:40:31 -0500
Received: from mail1446c50.megamailservers.eu ([91.136.14.46]:44024
 helo=mail265c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxnB4-0006z6-He
 for 59426 <at> debbugs.gnu.org; Wed, 23 Nov 2022 05:40:29 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669200020;
 bh=KIj/0r2WydaxJfWgubRSBsQgycVwiUf05Z+EcvuMDKQ=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=pGKCx/DufzxFzWEl34EsAcfSi0T7aLO6QiEwjLCiUIFx3f52y5ltajJhrAQwMue53
 49YR1sN+pfpyYeDhA3PoXuw9uCzJd9SWhsHpJbHI9M/kko1Y1OMNPGiUGA2ufAOMXW
 IfY/mC51bhmt+vJn4umE283uw+uA7hNgEkcI628k=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ANAe5Od093324; 
 Wed, 23 Nov 2022 10:40:13 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
Date: Wed, 23 Nov 2022 11:40:02 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <942C72E7-3DA9-4E2B-8B40-137B8FB23473@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
 <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F1B.637DF894.0009, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

23 nov. 2022 kl. 00.19 skrev Yuan Fu <casouri@HIDDEN>:

> It=E2=80=99s a machine generated file with syntax that tree-sitter-c =
can=E2=80=99t handle very well. The file is from bug#45248.

If you mean =
https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet=
-rrc.c, then the parse tree would certainly be wide but not at all tall =
as far as I can tell. There is a fairly long array initialiser in there, =
but I've seen worse -- and it shouldn't be treated recursively, should =
it?






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 22 Nov 2022 23:20:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 22 18:20:10 2022
Received: from localhost ([127.0.0.1]:52835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxcYj-0001sL-Ps
	for submit <at> debbugs.gnu.org; Tue, 22 Nov 2022 18:20:10 -0500
Received: from mail-pf1-f182.google.com ([209.85.210.182]:36499)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oxcYh-0001rj-0T
 for 59426 <at> debbugs.gnu.org; Tue, 22 Nov 2022 18:20:08 -0500
Received: by mail-pf1-f182.google.com with SMTP id x66so7164697pfx.3
 for <59426 <at> debbugs.gnu.org>; Tue, 22 Nov 2022 15:20:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=i7V8TsEWiOIAs1/ed2YoDp152n50QU9lSEgoHnGn4Vc=;
 b=HXIrpnXfy5O1O2oNiNDfGKH1gNpoCZBMCFz25tiBOfybHsEWh7pDSP1HOGYcF3Dgru
 JGqdTfJpjlVnDXr3kctKBFXsGMmbZa/+CZMrDcnHHf/HeFWCeTrhvi/Tbw2VU7v/5K8I
 Ju9zOcf42zNIAI0Mw28beqWQe91wm+d66fOu2BQL+gW2U1p7hSOVllsW2nhFpebJ3QMc
 TsG7NoXB/JgoMbhvh7WywofFNWM+7inTM36aaMIFOo/R6uMjo7Jvtvzr008Usm8YRyHe
 2R7RBcVzV/UpSLv7UTV5+IkGAsCczvprrALHwA2O6a/L39d6ExjLXbvZfVB1FdfgOftn
 R2aA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=i7V8TsEWiOIAs1/ed2YoDp152n50QU9lSEgoHnGn4Vc=;
 b=Sg4KIvlDfTj4wQWbD+fsmdLK19ApF5y3pAHaOX5rAZY14g1fbEqIbtsxAKNeUK+YgR
 I5KgUPpOn8JUudka4jltA2e9yq+bc98zhIWS0XcmFRw5hiAokwTmaNJRTNjKmJZOdja6
 tG6weHtqqavG/CtZLviOse8herg58kdp+nwd4hGqdsf71V2doHjQXCdAqN7e7Nh3S5/l
 hNJGxek4RDgoM/XSz0uyZGZwGK4DLAheoVgEzLexjRksFrWGzbDoCeyxKghjP74Tq7PZ
 m7+YJX63VOU26rEoe3Z273q1q3ZOFueVe2jSPHPHvPFpopoxp0ECWMRLtr8mDQ0HEoCr
 xkzQ==
X-Gm-Message-State: ANoB5plndMHCiL4SbOZBLP3l9jASmEd8hV11Si81mC7y5k0nYUqRUpDW
 207a2FX0SR+RPwWr1GzhswQ=
X-Google-Smtp-Source: AA0mqf40aY9uwZ3HL/sWYzilLFculoInTpMUkvoZzu2bgrvssYc2vugNgCm4GofOTGFbU9cFC/GlJQ==
X-Received: by 2002:a63:fd4c:0:b0:46f:1e8d:d6a8 with SMTP id
 m12-20020a63fd4c000000b0046f1e8dd6a8mr23866534pgj.248.1669159200906; 
 Tue, 22 Nov 2022 15:20:00 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 s10-20020a170902ea0a00b00186c3727294sm6014710plg.270.2022.11.22.15.19.59
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 22 Nov 2022 15:20:00 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
Date: Tue, 22 Nov 2022 15:19:58 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <E0514E51-CCE0-4836-97CF-C88AD719832E@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
 <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 22, 2022, at 1:08 AM, Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> =
wrote:
>=20
> 21 nov. 2022 kl. 20.00 skrev Yuan Fu <casouri@HIDDEN>:
>=20
>> Fortunately tree-sitter doesn=E2=80=99t need a deep stack. I don=E2=80=99=
t think any human-written or even machine generated source file is ever =
intended to parse into a tree of more than 1k level. Eg, who would =
write/generate a function that has thousands level of nested brackets =
{{{{{{{{{{{{{{{{=E2=80=A6. ? (Unless they want to try to break the =
parser/compiler.) So a sane limit is more than enough, just to guard =
against weird source files that makes the parser (erroneously) generate =
very very tall trees.
>=20
> Thank you, this is good to hear. (Standard minimum limits for =
languages such as C are quite low; for example see C99 section 5.2.4.1.)
>=20
> What was the reason for the crash that prompted this bug report? Was =
it an 'unreasonable' C source file, a grammar mistake (using left =
recursion where right recursion should have been used, or vice versa), =
or something else?

It=E2=80=99s a machine generated file with syntax that tree-sitter-c =
can=E2=80=99t handle very well. The file is from bug#45248.

>=20
> I hope that tree-sitter does not require a deep stack to handle C =
files that are merely very long or has long functions, initialisers etc; =
this is common for program-generated source code.

Being merely long is no problem: you=E2=80=99ll get a normal-height but =
very wide tree. The problem is when the parse tree is very tall. As I =
mentioned earlier, I don=E2=80=99t think programming language sources =
would produce ~10k levels nesting under normal circumstances. Having 10k =
function definitions don=E2=80=99t produce a tall tree, having 10k =
nested function definitions do. But who would want a program with 10k =
nested functions?

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 22 Nov 2022 09:08:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 22 04:08:35 2022
Received: from localhost ([127.0.0.1]:49746 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxPGd-0006K7-9i
	for submit <at> debbugs.gnu.org; Tue, 22 Nov 2022 04:08:35 -0500
Received: from mail156c50.megamailservers.eu ([91.136.10.166]:49616
 helo=mail51c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxPGa-0006Jx-JZ
 for 59426 <at> debbugs.gnu.org; Tue, 22 Nov 2022 04:08:33 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669108110;
 bh=Nk8QSJkzpVpbXp1AYRgTR/IA48UND/dw/IJSOFyxifA=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=pNJoSbBBfC7r+6oUIHFOPboM0aiWYhTuQwetO8UGo5pZIrUll47Al7QLgUW4bZfHN
 asnP4nGDI1AQ0+0sfEh/mFH/GgPJr82o/xmufPfCMhdI2uCmVU2EdeIehHf5cJGBia
 jJMflvmoNTxBMLSRUiaqoHKZracFS35RtNmr6dTs=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2AM98Qkw015184; 
 Tue, 22 Nov 2022 09:08:27 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
Date: Tue, 22 Nov 2022 10:08:25 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <F516C3AA-A8D9-4043-AF3C-44E83B98EFC3@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
 <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F27.637C918E.0051, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

21 nov. 2022 kl. 20.00 skrev Yuan Fu <casouri@HIDDEN>:

> Fortunately tree-sitter doesn=E2=80=99t need a deep stack. I don=E2=80=99=
t think any human-written or even machine generated source file is ever =
intended to parse into a tree of more than 1k level. Eg, who would =
write/generate a function that has thousands level of nested brackets =
{{{{{{{{{{{{{{{{=E2=80=A6. ? (Unless they want to try to break the =
parser/compiler.) So a sane limit is more than enough, just to guard =
against weird source files that makes the parser (erroneously) generate =
very very tall trees.

Thank you, this is good to hear. (Standard minimum limits for languages =
such as C are quite low; for example see C99 section 5.2.4.1.)

What was the reason for the crash that prompted this bug report? Was it =
an 'unreasonable' C source file, a grammar mistake (using left recursion =
where right recursion should have been used, or vice versa), or =
something else?

I hope that tree-sitter does not require a deep stack to handle C files =
that are merely very long or has long functions, initialisers etc; this =
is common for program-generated source code.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 22 Nov 2022 08:59:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 22 03:59:35 2022
Received: from localhost ([127.0.0.1]:49706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxP7n-000641-7x
	for submit <at> debbugs.gnu.org; Tue, 22 Nov 2022 03:59:35 -0500
Received: from mail213c50.megamailservers.eu ([91.136.10.223]:46322
 helo=mail194c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxP7X-00063V-4w
 for 59426 <at> debbugs.gnu.org; Tue, 22 Nov 2022 03:59:26 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669107544;
 bh=03Nc8SFjeaW7lZR2938YGsENFPcrTZRWFZeqMPb/5/M=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=lQ6EFRFdxB8OqH9XKT17TzO+uNOdZDYR9vCERCKFsnwbOvl9yAblEAAFHRqSVGj6W
 elHUrw9YFzTposJ37CqZp9a+fOF8EgNPKc/XWahKeBfugHYRQRubF66N5HXM862lM7
 fCyEO65U/8cKeA8/L3JlM5O+Hm47A/iIZuiXumgc=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2AM8x1lO113610; 
 Tue, 22 Nov 2022 08:59:02 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <874jur6df6.fsf@HIDDEN>
Date: Tue, 22 Nov 2022 09:59:00 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <69050C35-782A-4F90-A2CF-7C080177901D@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <874jur6df6.fsf@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F21.637C8F58.001C, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org, Yuan Fu <casouri@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

22 nov. 2022 kl. 01.27 skrev Po Lu <luangruo@HIDDEN>:

> When the use is not reasonable (as C files with thousands of nested
> brackets clearly are not), max-specpdl-size can prevent Emacs from
> crashing.

No, that variable is gone.

Using lisp_eval_depth is possible (and used by json for a similar =
purpose) but an independent limit seems safer, since Lisp evaluation =
does not necessarily use the C stack.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 22 Nov 2022 01:46:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 20:46:22 2022
Received: from localhost ([127.0.0.1]:49243 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxIMf-0007RM-3p
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 20:46:22 -0500
Received: from mail-oa1-f45.google.com ([209.85.160.45]:45814)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1oxIMZ-0007R3-4E
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 20:46:19 -0500
Received: by mail-oa1-f45.google.com with SMTP id
 586e51a60fabf-13be3ef361dso15717101fac.12
 for <59426 <at> debbugs.gnu.org>; Mon, 21 Nov 2022 17:46:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=Kef8gpgJ+tRehbuXxwU+AqSh7G7hWettDtqbmvPouBs=;
 b=XhPv9Rq7z6iPOodjxfKkaHNjXUCTWJx92mASxOED7hPmna2kMergar3Chp+LMGMGVk
 eHpZWH+hPjOKNrtQQodmyyWxLIKjH65fb3SAaloveRP5FbRt/yKd45n8iwlxeezPe1fR
 aSyVTq4Bb3SysL/+yu25GPChxBHT4g2ZSxt1i0oaWp69zIN8tTGlTF1WueQSgIhEcFk2
 rOEpptCk7KPzORq2R4vxKoqZERmDK0Frs4WUNbt8rGMy8eLA91G2yhR4yHynhcvIVIa+
 ZDAhFtUQ5ZXSq3UyGAsvGlE/46uDqDcKLJc/TJJj4sHJAKEtzCkiLi+cLxu/VH4mD59Q
 TWuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:cc:to:subject:message-id:date
 :mime-version:references:in-reply-to:from:x-gm-message-state:from:to
 :cc:subject:date:message-id:reply-to;
 bh=Kef8gpgJ+tRehbuXxwU+AqSh7G7hWettDtqbmvPouBs=;
 b=oFAA1FEepeiE69TzI5KYMLu7ygcoXAMA1NgiUOoLXxwA0KitGMSLfg6SMy74LngFMn
 YcQj9G4/ylG+3MPaTqZgroUZgw0RYGuSTvNfAFPerIQ8f9rTokCA5RW1hXck4d0m5kSr
 k2NWrMhBcN3hitrEPeYNazJHEQIqhwFIllDHgmCVU3nvYIklY8ZkcXWlSmXmIZgmpQYI
 P6cSHIC5cl0DL8s1GaLKu3b+BUoHmV3pjFmjo4qwSOzF5iTzBYKLasgS7cQSaaS22uPf
 nyviLlKsoOMG9o6lnoJ01NqtsHWCGu8GRdnqm2q7LWEY7TOweebhn6HdXrCgkR6OYg2h
 DWog==
X-Gm-Message-State: ANoB5pnnQQ8/DSVMRPv0+79o8feC85vAb0f+qlpd2sfM0g/zez7MDgGg
 W44ZNBKmqbAWhnmrC8mWKeubbmE5jj/dDKIjRKw=
X-Google-Smtp-Source: AA0mqf56plrCpYuecfyYzS+fcgPaDfOfiXKh40sDnhg9aFI31qvCSmJTCuz8jGvpzdLhy6Q3BfgOusAuMXNUHRbiIb8=
X-Received: by 2002:a05:6870:cc89:b0:12b:fbe7:b793 with SMTP id
 ot9-20020a056870cc8900b0012bfbe7b793mr14336387oab.92.1669081569478; Mon, 21
 Nov 2022 17:46:09 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Mon, 21 Nov 2022 17:46:08 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
X-Hashcash: 1:20:221122:mattiase@HIDDEN::oN4CNsKjCm80R5p1:3wDh
MIME-Version: 1.0
Date: Mon, 21 Nov 2022 17:46:08 -0800
Message-ID: <CADwFkmkfy9dDhXKx0FtoRx39_6uW2MWD_o07BPMXhwURVa-+vQ@HIDDEN>
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
To: Yuan Fu <casouri@HIDDEN>,
 =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Yuan Fu <casouri@HIDDEN> writes:

> Could you paste the warnings? Because I don=E2=80=99t see any warnings on=
 my machine.

In toplevel form:
src/treesit-tests.el:130:28: Warning: Unused lexical variable `pattern'
src/treesit-tests.el:130:36: Warning: Unused lexical variable `doc-node'
src/treesit-tests.el:130:45: Warning: Unused lexical variable `object-node'
src/treesit-tests.el:130:57: Warning: Unused lexical variable `pair-node'
src/treesit-tests.el:181:18: Warning: Unused lexical variable `root-node'
src/treesit-tests.el:181:28: Warning: Unused lexical variable `pattern'
src/treesit-tests.el:181:36: Warning: Unused lexical variable `doc-node'
src/treesit-tests.el:181:45: Warning: Unused lexical variable `object-node'
src/treesit-tests.el:181:57: Warning: Unused lexical variable `pair-node'
src/treesit-tests.el:239:18: Warning: Unused lexical variable `root-node'
src/treesit-tests.el:239:28: Warning: Unused lexical variable `pattern'
src/treesit-tests.el:239:36: Warning: Unused lexical variable `doc-node'
src/treesit-tests.el:239:45: Warning: Unused lexical variable `object-node'
src/treesit-tests.el:239:57: Warning: Unused lexical variable `pair-node'
src/treesit-tests.el:318:18: Warning: Unused lexical variable `root-node'
src/treesit-tests.el:318:28: Warning: Unused lexical variable `pattern'
src/treesit-tests.el:318:36: Warning: Unused lexical variable `doc-node'
src/treesit-tests.el:318:45: Warning: Unused lexical variable `object-node'
src/treesit-tests.el:318:57: Warning: Unused lexical variable `pair-node'
src/treesit-tests.el:374:11: Warning: Unused lexical variable `html'
src/treesit-tests.el:374:23: Warning: Unused lexical variable `html-range'
src/treesit-tests.el:414:28: Warning: Unused lexical variable `doc-node'
src/treesit-tests.el:414:37: Warning: Unused lexical variable `object-node'
src/treesit-tests.el:414:49: Warning: Unused lexical variable `pair-node'
src/treesit-tests.el:426:35: Warning: Unused lexical variable `array-node'
src/treesit-tests.el:476:16: Warning: Unused lexical variable `root-node'




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 22 Nov 2022 00:28:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 19:28:17 2022
Received: from localhost ([127.0.0.1]:49156 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxH97-0005Sq-2f
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 19:28:17 -0500
Received: from sonic309-22.consmr.mail.ne1.yahoo.com ([66.163.184.148]:39374)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1oxH94-0005SZ-1F
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 19:28:15 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1669076888; bh=tQWRzI1RW606G4l7wDtnMduO9r9dggEBj1qJAXARdkQ=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To;
 b=NHatIiaevHLuQU1pa4w+xpVjqXVw/7FAKrNr5G7uTddxe+ntUMBW6Txq/S9uO7E+cwQZXkOVLlCvLi3dUwHAmtzECiKs/zoTciL/lto+GJg6RjVXtdaV0Xr6DkKFYzfCS+RLA020z9+XjBN/F0tK7ayAZESbu0c5myGet6uapZZ6BBmvAXXo3rza1OziFiU+HwxsX1XhiCcTwiSVfrCxelu0wlTju2MbprmYdvIaH6OVfBc5rIUK5W0KUbYKEWiKEPwdweidtC6WrjWL6+EjoDW9ePpzJCcTNV2PprXqh51mpnqIiXIZrWcJQ0Y+mik3Lcdc2XvLO3jrox17UAqdyg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1669076888; bh=/D+BH7rO9i/3rVzHjNLJt5tj8vp23iZ4PXVlHis7T4S=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=l3yBXDElHpJdWYufbK/4Z/2PbugP0vp7QBwWnxARZ+QBY0U2jvsTT/kYoSpSiGntXsvOpHuL2KStqVYoXqXBwwuUh6Pv/HcWTKLf4w32UyH53HLXCV+N1yAguieyl95L24dFe2LI3rodQ234tBiLxNiTNFZy8Rn/fcfEmw1asnUPzQ/7LASEUD6QzT1vFgZQo7uZ4gARrflz+5yV4dw036gIczFdrINPLywHG0YM/NhaQAXmGE1f/PLlrUAbabhSHXyTMIvdZ+vS7B7IhQLggiheZ4OyuQ8/5HFQ+c/Kz9Hp13mgQCjYsn4lAROX/2lphctsC1yxRIF11UKVHBDMMQ==
X-YMail-OSG: 0Ew8tr4VM1mhM.6CWgmJJ2EiKLFbIZTQHniKY4tRGJye7ae83tfkvwgQH8jeUrN
 9m3J3l3iLs1_AmegfLtdr.yUtKWEjgWR0R4_j3DkAWQrC_UyvPM3I_LxgJzXcYjk3yGEf4PltSAS
 h0fGSZ2RHoLCedrQeV_rMOr3b3Dvf0Rj5JuS.Z0JBehsOyDVMsrKWh3CQBTHE0F2LrFwSq.4K2ze
 mSmlV4B7ZUcskCvKUdaGqGHF943LWAQyGh4yjUwo11BC65cyJcwSnCmfwximNlK8a.NHS_zMOIDR
 1IJAmi2kD3pBZ9C3VVXLDeWV5gVXAPOCaPmKySHDHzQiTwBdg5fbIWF80q5Ls_F8WVsxWflh_QBb
 cHVD6k_t49lW3VdUk6UY_.kkj0h.SGPXJEXw1s9ZH8CMQUyimXrMi3SSzmSOFc_zq9hy1ZrxUupZ
 iQEJglmLtxAO3ZfixXvYbI3W1xJ.VFKYiP2hTarRIafjzx5NcJudCuY0veNIOKcSYBWIWaGDH.7E
 RqcnBOcZIqvH6WfQnjOFg0FC4WO5SNEan3Q5u4KJpRlCxMCMXSnpOPbD7I7gHrs5JOIDGRZLUZNw
 ..pOm8_1JjicBkPvzbmXWAFh49J6mhdb2okBX8XiGPzjcgKkrspAKWe.O2ZAoNbds6rtnKl_HmjL
 _vn3TUbvv2YeRCPbgqezkZ508Ti_SqDBRQ8TA47J_w75VvG0nb2QJ3L4vcZzK8oFuh_wEUYeaPfr
 jkozOStB8KJJvchMWJ5PcRIcyC4FM49sC42NfDRFPxR2LsR70pQJ9kNrJVy7dEMP.cYDNelBOYVe
 lV2Z4wpc5ZFhG4QLceQdh3RFdenFXAybOmmGXXa_B46lcaS14hRB30BJhDcfbxIFNaD9kn50CgHd
 34El_N2OorPaQMq8UMgnht9o7V6KqIfo1kD_TfP_.itmspNLCa_vE0sx6FLY7.NMguz3M5JBvsSx
 zZsOv7qGc5g0K2KBaGJ3NUfxHV0CQMsSFNuSVasvzPrWKdnU8kqK4SlhhJDCDtOzkwd484zvV8vX
 1ituC0HkrhasNv5iuQp17Gk.0fgMKR_kvIb41BzLO4EC23G1pFwELbOdt4w5zHtjMtTFjQIu4Xgt
 z8OMmvjZWsq5Srz4ytI75Ryuah6K7J9wDHxhKXfl939lJFSuuHJEkAKIh_.2y6mM12VdPOngFttN
 YAMFg2H2wF13n2pOwFd8JycSPCRzfvMbpI6SBpH.UBBg2cGFTMChMXx6jQy10l14Wm82Z3eG5EUn
 1t67VWU0ewOdcKR7kNABZUH.Ml8iz9wV32.3M30bkh_PH2AP8IcfRtPBZFsUKEW7Hq9chvq16dFL
 ZNQTF9dlbC60skGKdZJYF93KqdWis3FK07UEMCEhA68jdcio8PwLQ6yWlgv3gvEw63nro2KmUnK_
 kERhWbCqE9J6LzWXO2H8LARmva7X821WsWQ5Vh6RRsBof5tZP_hqZ3hzdYGAm2lcCwznes4wW6pQ
 2iBQhr2tL3xW1u4mhlmqXzalyo42qc16nI9cjbu2J7T9.cUVonk_T3THRD6txGnBeQDCpv8SCcpS
 mqkgGc.qb5f59a_B1povFJTVj8q5SL7yspVvykJyBxXHGubuyHhkfKuoFV40_MH.qeHrBbCIHvFq
 ZwuZzmJ1Zch0OOyfvtqUuRIZC7rFQ5y4xMvDpRFGiWqPY0pB0cZ0uPTU5gtdtn5JWwG3llfEUZJo
 GxcfQkCGiia8fvvmZgjdtAtLYMmTblblaKfVoXBTf59mAWyAFuIGlt80BczXAV6Y2KmlePOEdxh7
 FwYEdPMiDn9kmNR1ury8cV0Rvkysy6Ib9C64xQmjT75m0Fidd1h1Sq7sW4Axjd8wsqGwOmnBuI_r
 mNwtFPRd1DLQ8cxTL08lYULhwVZ1BBhycKCOqI3BpNv7oSnA3VNax97BPatL0tnKOEEfU565uGS3
 iT5D2czs5w3.kMx_Xuhg8pY1qo4GdEgQ6JOLGnfECgGJr8Y5pkkuze5i9knGU6v16zpTQH8tJYff
 EtCkLsB9pA93eeUM6EZuBbNSk.gJvvvilKceH1iXRM6fmMnVfctiLA4.H42v99cNloaiN6eL2p1A
 ZeWI5O3LGu.GdUL3j9637mY75qz0gU.uUAaLpBohJNoZZqYS9UtFwxcYNj9WHnAvdwFXHGLTzQ1Q
 yZi2TsoL09dzxRlOGGM_tP9Qv8LsdAC4LBz6Tb52DU5220W7x1icuJHNJLJ3.gwAczrL6l08Y4Am
 WimZIBjM8a5xKMokSeokAjekeirkZGSH_m5wKxK0QPRMjpABh.Dr3FX_R4dXq_aUt9op4
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic309.consmr.mail.ne1.yahoo.com with HTTP; Tue, 22 Nov 2022 00:28:08 +0000
Received: by hermes--production-sg3-6c8895b545-66t5n (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID b2de8cdb779da944ab1bea1418bce3d9; 
 Tue, 22 Nov 2022 00:28:03 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
In-Reply-To: <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Mon, 21 Nov 2022 13:00:45
 +0100")
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN>
Date: Tue, 22 Nov 2022 08:27:57 +0800
Message-ID: <874jur6df6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Mailer: WebService/1.1.20863
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 408
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org, Yuan Fu <casouri@HIDDEN>,
 Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:

> Highly unlikely. If reasonable use can make C recurse too deeply, then
> fix that bug instead.

When the use is not reasonable (as C files with thousands of nested
brackets clearly are not), max-specpdl-size can prevent Emacs from
crashing.

> What is the call structure leading to the crash? Is Lisp involved?

Apparently not.  I don't know the details.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 19:01:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 14:01:11 2022
Received: from localhost ([127.0.0.1]:48848 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxC2Y-0000zu-Qh
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 14:01:11 -0500
Received: from mail-pl1-f174.google.com ([209.85.214.174]:38626)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oxC2V-0000zZ-TP
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 14:01:09 -0500
Received: by mail-pl1-f174.google.com with SMTP id j12so11433299plj.5
 for <59426 <at> debbugs.gnu.org>; Mon, 21 Nov 2022 11:01:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=grHlKC/yF3rrJJX0nXHZI04q4KNEYFeZTS3eUQLHh3s=;
 b=nF+/PnHC+hiAeQC8oQ6Ux2YY34WtxRyODOoVpQRKWKkhqQda1tCcs0NoKImkVLzF4B
 PhZcEAMReepaykx58ynYh0LnzJ2TMJ7hV1k1dUMKNWd8RlAPt36uYYuExPFd8U7zbJeK
 gNjW4zlvzp5MaVX6fkWFN86G92Ql//2+iV3clCl2Cgeg1FRmvV1VYUot6Nv2bVMWBDvT
 WnGmluoBpaNb8McijMxGzR5sGOG/fK1JDtrYgOMoNXDtqngEJkc+LJ5xCLqUWVFqqTQr
 yHO1ffGlqq1fMGhzztRYsKg2XP7mnZ4ZW/t1Pq6ps4dSYkdHYSEBAlSc2yqwHl1ABAqK
 j14Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=grHlKC/yF3rrJJX0nXHZI04q4KNEYFeZTS3eUQLHh3s=;
 b=fUWNK0nTiH5AkLXU5pCvMQjwEfAm2SxFqhMHTbWwbRxKw/NjpqdWfOBYfBcGnY5OBk
 4ZLYaJV5s0bbKfqaE4ACBW2CujPP4OIg9b+JX4UpUF6QLKuyP4d49U4L8wHHBZgfuNoO
 NxgHzqfCDiUw/CHmvD4Tlm1RWTdEZ9bxwhoWe5kwJ1inc9WFU1YQ0tQ3MhtkQ1OOHbRu
 yv/P3nbxTGiAl6fVeuJu29JzWqNrA52VYpF+E5GvX9+zGdMhrumaK7aG4gl2nkx1n+Uj
 IS4NUy+msI6ZniS+YcJEZ3Q158uXSaxQXueT0Lgf50S44xEo7DTcVDuY5o3blS4XqAeq
 KcDg==
X-Gm-Message-State: ANoB5pkdMeZfXKuNHQ+MZalCWugh/uRJNmub6wUz3A6q9o4rothnE+R2
 YXexRC196UiXH36dWZJ25Kk=
X-Google-Smtp-Source: AA0mqf5I0Ami3q31QQKtPlVco55J4gGYXyZetvAvSOHJWi3bZs1CHdkHM4z7qw+lSSGHrZPZw1qwnA==
X-Received: by 2002:a17:90b:4382:b0:20b:c375:575 with SMTP id
 in2-20020a17090b438200b0020bc3750575mr21281956pjb.174.1669057261890; 
 Mon, 21 Nov 2022 11:01:01 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 e11-20020a170902784b00b00188fe19e124sm8239272pln.185.2022.11.21.11.00.57
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 21 Nov 2022 11:00:58 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
Date: Mon, 21 Nov 2022 11:00:56 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <A4A74330-8EE9-4ABC-BD46-C5BDD3FB358B@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 21, 2022, at 10:20 AM, Mattias Engdeg=C3=A5rd =
<mattiase@HIDDEN> wrote:
>=20
>> And don't forget that GC is also highly recursive and eats up a lot =
of stack space.
>=20
> Not any more.
>=20
> ---
>=20
> If tree-sitter really needs a deep stack whose size depend on the =
input file and grammar in an unbounded way, then it shouldn't use the C =
stack; that would be an unnecessary restriction on the files that could =
be edited. A dynamically allocated stack could still have a limit, but =
it would be decoupled from the C stack size.

Fortunately tree-sitter doesn=E2=80=99t need a deep stack. I don=E2=80=99t=
 think any human-written or even machine generated source file is ever =
intended to parse into a tree of more than 1k level. Eg, who would =
write/generate a function that has thousands level of nested brackets =
{{{{{{{{{{{{{{{{=E2=80=A6. ? (Unless they want to try to break the =
parser/compiler.) So a sane limit is more than enough, just to guard =
against weird source files that makes the parser (erroneously) generate =
very very tall trees.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 18:59:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 13:59:16 2022
Received: from localhost ([127.0.0.1]:48840 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxC0h-0000u7-T3
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:59:16 -0500
Received: from mail157c50.megamailservers.eu ([91.136.10.167]:60768
 helo=mail51c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxC0e-0000ts-31
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:59:14 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669057149;
 bh=crDQqHGhnxEYBmIFdU2a5m2bXw7gvZDwxGmfYFLZstA=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=nI82iTWY2xWwjQcJQrpb/uLZkU/O43ibsJxoApwPEXNvTcatkQ/4GlIjbFxbDft0c
 2EjHym34XJb2OrESc/meJQ0AZ/oEHoRVDzeO0mq62iwHfsnL8dlwvhjFZ7MjJiF4PH
 /a5IonYqHG+1Rsiy4X+ysktCUbo1TrLj5YTuM02w=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ALIx35x039356; 
 Mon, 21 Nov 2022 18:59:04 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <8335ac2mft.fsf@HIDDEN>
Date: Mon, 21 Nov 2022 19:59:02 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <3CCCFC3C-691F-41D1-AF08-65921841960C@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN> <8335ac2mft.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F1B.637BCA7D.0048, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

21 nov. 2022 kl. 19.26 skrev Eli Zaretskii <eliz@HIDDEN>:

>>> And don't forget that GC is also highly recursive and eats up a lot =
of stack space.
>>=20
>> Not any more.
>=20
> Damn those changes!  Maybe Emacs is no longer Emacs, either...

Plus =C3=A7a change...





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 18:26:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 13:26:45 2022
Received: from localhost ([127.0.0.1]:48805 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxBVE-0008LL-NC
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:26:45 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxBVD-0008L8-Dp
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:26:44 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxBV8-0007gh-1B; Mon, 21 Nov 2022 13:26:38 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=dCVW9DB786cxTKxXtT1q6d4Jh7Q4iQNMa97Jx3rXxcM=; b=fWUZDXHNPCJWrlriQF7e
 xhEk4NYrJvL4oyqWK1s6Z5dgbBIlIKVL3jYyqe5I5wjRTZgzGC6q/Jhvr2qfbdBj5dkpxwaVtWky3
 43+dU7uGclu3GrwtHxLYYuBepxaTFLKIclOeVvsMJoNaYsrWfeAKgII2+T9XpbxzqzRR5gXzbgriI
 JW2/bfBYwId2UqxxKJzUJBvslG0HmU+j9URglTZ+ozDfiJa4UEOn0mWVoIpZa0iTEuWIq4rdtX63+
 9linFLrKrsLbkjmGGLPJnkMOG0N5CXIfVPXU3PbqYzIh5GFt2NSWnnukkbqec6U8sXC3fhekXvYkn
 1fpp7fzQMIQTUA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxBV7-0007gW-G5; Mon, 21 Nov 2022 13:26:37 -0500
Date: Mon, 21 Nov 2022 20:26:46 +0200
Message-Id: <8335ac2mft.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 21 Nov 2022 19:20:45 +0100)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
 <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Mattias Engdegård <mattiase@HIDDEN>
> Date: Mon, 21 Nov 2022 19:20:45 +0100
> Cc: casouri@HIDDEN, luangruo@HIDDEN, stefankangas@HIDDEN,
>         59426 <at> debbugs.gnu.org
> 
> > And don't forget that GC is also highly recursive and eats up a lot of stack space.
> 
> Not any more.

Damn those changes!  Maybe Emacs is no longer Emacs, either...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 18:21:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 13:21:01 2022
Received: from localhost ([127.0.0.1]:48788 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxBPg-0008AM-Sn
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:21:01 -0500
Received: from mail1457c50.megamailservers.eu ([91.136.14.57]:48552
 helo=mail267c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxBPe-0008A3-RL
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 13:21:00 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669054851;
 bh=uNu4fCiFWMGiRsjV9TSDT+lWE1sj7nxcSIJJaGgjXOc=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=i2VIUHMHRBrQtNdYaXVI5DJ3ghiVsTgadax9/ScthH3GeczstRXjbyGeU8cRqbONK
 bmEJpr+AOoy+FR2fzRxAsALWoPcrFcEEB7OhQS59N6Tr/xxG0tuOfW/0zG+5QTkfFO
 tUtu80dba4oyhZjoxQrt3+Keoqumjzu7jSkzqJtw=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ALIKkl0068588; 
 Mon, 21 Nov 2022 18:20:50 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <835yf82oc4.fsf@HIDDEN>
Date: Mon, 21 Nov 2022 19:20:45 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <B55DFBE6-D8D9-4E1C-987A-0E47303599D5@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN> <835yf82oc4.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F17.637BC183.0046, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> And don't forget that GC is also highly recursive and eats up a lot of =
stack space.

Not any more.

---

If tree-sitter really needs a deep stack whose size depend on the input =
file and grammar in an unbounded way, then it shouldn't use the C stack; =
that would be an unnecessary restriction on the files that could be =
edited. A dynamically allocated stack could still have a limit, but it =
would be decoupled from the C stack size.






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 17:45:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 12:45:45 2022
Received: from localhost ([127.0.0.1]:48712 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxArZ-0006vV-7o
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:45:45 -0500
Received: from eggs.gnu.org ([209.51.188.92]:58868)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxArX-0006vG-LV
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:45:44 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxArP-0008J8-RP; Mon, 21 Nov 2022 12:45:36 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=WBXTjcwZwVavLdc9JKR3YP6SXk0jPdDSK1S9rwVghi4=; b=Tih3lQUC4vfv
 WexvrRvJgSao/P2fSwwVyrqQH/oSX3Bp2whRsvQSMYavt0tEPS0YnyV13PnXfM1aoTAH3CUt/lCgB
 vKCx1+QxHHQKq2ULcjZx8oYyLL3PtxsnxkDu/grrFD58LCR9pZrE1dyWjiaRWu1T8D0xxxYrP4uXU
 X6ofR53gq0v3S7anboj3MiSx/b7vRpnH7qGI9vvEpaTypEIK8SUdHotcai4AkkEaBqOC0ASA+RCtk
 e37bbyKEA4kyXEQTkz9kPIEx5+QVFN9G8AsSSQ939y4uXtzb3Li0sIVHSmKCWJExdsxlCcvVrjka3
 V23zS9ANNq/MKJSVeB1o/g==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxArP-0006WP-9s; Mon, 21 Nov 2022 12:45:35 -0500
Date: Mon, 21 Nov 2022 19:45:47 +0200
Message-Id: <835yf82oc4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: casouri@HIDDEN
In-Reply-To: <83edtw2pz3.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 21
 Nov 2022 19:10:24 +0200)
Subject: Re: bug#59426: 29.0.50;
 [tree-sitter] Some functions exceed maximum recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
 <83edtw2pz3.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
>  59426 <at> debbugs.gnu.org
> Date: Mon, 21 Nov 2022 19:10:24 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> Done, the warnings should be gone now.

But I didn't touch treesit-tests.el.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 17:44:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 12:44:27 2022
Received: from localhost ([127.0.0.1]:48707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxAqI-0006sp-Rw
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:44:27 -0500
Received: from eggs.gnu.org ([209.51.188.92]:44476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxAqG-0006sZ-Gj
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:44:25 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAqA-0007tx-UN; Mon, 21 Nov 2022 12:44:18 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=p+VwZU49F43LcmKWdNAhVTVbFAtk7xo12xVy20t2ZTY=; b=ZYCf3lV6lmGXJo8xeb67
 n7EnBmRs5lKxDo/LIEcbCjc+PDyXoS0BBY1P+sssn5/GpD6I+LdVbI3LEt5DpBPzOXKpOjmwfu8k3
 Nb2B4zlgOMerI3udd4JYurfIJC2+BmNQTMMVgdigC741OiAbK5a66gkj3REiU0AndslrHwIkmfF6t
 dyF9UIW0Jr5zOrfW52MTbbkQC/TEJfLiBc0QW3Ks6DQuvWOAxBI+hB73x+QXsssQqmk3eZlqgY2W1
 MrBDHXpnKCaqNoCiZS61/20uDzsGeLv4DcurFJAH/jBkl8FwpRSEP+xtz2CjlnPYIKUQaaduSm/+Y
 xilS5hJOAN6q2A==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAqA-0006M2-EZ; Mon, 21 Nov 2022 12:44:18 -0500
Date: Mon, 21 Nov 2022 19:44:31 +0200
Message-Id: <837czo2oe8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <3A46E3F3-08BD-40C2-9B68-0EAF03295E1C@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 21 Nov 2022 17:56:01 +0100)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
 <3A46E3F3-08BD-40C2-9B68-0EAF03295E1C@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Mattias Engdegård <mattiase@HIDDEN>
> Date: Mon, 21 Nov 2022 17:56:01 +0100
> Cc: Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>,
>         Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org
> 
> 21 nov. 2022 kl. 17.43 skrev Yuan Fu <casouri@HIDDEN>:
> 
> Build without tree-sitter and you should see them for several .el files, as well as when byte-compiling treesit-tests.el .
> (I could paste the warnings but you need to reproduce them yourself in order to fix them anyway.)

You should have shown the warnings, because reconfiguring is a pain.  And
you should have also said that the problems you see are when building the
branch --without-tree-sitter.  This kind of detail should not be omitted
from a good report.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 17:16:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 12:16:03 2022
Received: from localhost ([127.0.0.1]:48689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxAOp-00064O-10
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:16:03 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56966)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxAOn-00063k-39
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:16:01 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAOh-000231-P6; Mon, 21 Nov 2022 12:15:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=QxPBcBEBk1TB+yCqn7CaQ8wScGugf5G2ltmwyLQozJQ=; b=Mi6aLNLcJxvqGrwVJSW5
 DyQ+ASERy1SL6/iBMOuGzLBHBqXfxgeQds7ISv+dOdlcxUbYeEcU2YoGBKUIuJonrjE/YKaENzKL0
 wZVWRnAMXUWI50Kud6ndGBAYeu7iJyfQhMWAxVfB0hfIRgLaX9z8nE8RG3s6l5I7XCVu/aip4dOnu
 O/gDjJQjXe5uYalT5yA9a62eyDxRLHYc92+/4+NwAjlH6cTrbMopeQrYO62jmoKF2X0cA+AHHL5iG
 PyujfBck6QZcsrYf6AytIWRt2J8qYfQCXMmS13h/MA4oheB4atEKn7xIULViHWA9P3DfPx9jBT9xB
 gGoaM2jjO3lHCg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAOg-0006ba-VI; Mon, 21 Nov 2022 12:15:55 -0500
Date: Mon, 21 Nov 2022 19:16:06 +0200
Message-Id: <83bkp02ppl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <CDDFCA51-1294-4743-93B2-92E31490F4A9@HIDDEN> (message from
 Yuan Fu on Mon, 21 Nov 2022 08:52:53 -0800)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <837czo4f8y.fsf@HIDDEN> <CDDFCA51-1294-4743-93B2-92E31490F4A9@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Mon, 21 Nov 2022 08:52:53 -0800
> Cc: 59426 <at> debbugs.gnu.org
> 
> 
> 
> > On Nov 21, 2022, at 5:19 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
> > 
> >> From: Yuan Fu <casouri@HIDDEN>
> >> Date: Sun, 20 Nov 2022 16:53:45 -0800
> >> 
> >> 
> >> Emacs crashed on a very large C file when c-ts-mode is on, because
> >> the function building the imenu list tries to walk through the whole
> >> parse tree, and end up recusing ~10k times because of how deep the parse
> >> tree is. These recursive functions should have a built-in limit. Does
> >> Emacs already have some way to determined the max recursion limit on
> >> each system? Or should we come up with some hard-coded numbers?
> > 
> > Is the recursion in our code, or is it in libtree-sitter?
> 
> In our code, when we walk the parse tree.
> 
> > 
> > If the former, one solution, albeit a crude one, is to track the recursion
> > level and error out if it becomes too deep.  Another solution is to handle
> > the stack in our code, in which case the stack can be allocated on the heap.
> 
> That’s my idea, hence my asking for a reasonable way to get a limit. I think a hard limit is totally reasonable, because there is no way for a “normal” parse tree to be 10k levels deep (that means the source program is 10k levels deep, ver unlikely for any program a human would write or a machine would generated). The one I observed is likely due to the parser misunderstanding the source (due to errors in the code). Plus, I don’t think any user would want to walk that deep into the parse tree either. If someone expects to walk that deep into a parse tree, her program is ill-designed.

How many bytes does each recursive invocation need on the stack?  With that
number at hand, we can estimate a safe value for the limit.  And don't
forget that GC is also highly recursive and eats up a lot of stack space.
I guess GC can happen during building of the imenu list?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 17:10:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 12:10:35 2022
Received: from localhost ([127.0.0.1]:48665 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxAJX-0005tM-AW
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:10:35 -0500
Received: from eggs.gnu.org ([209.51.188.92]:33278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxAJT-0005t3-Tj
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:10:33 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAJJ-0000OI-UV; Mon, 21 Nov 2022 12:10:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Lk5emXlnnuS9y6XJQKLcUX/PbLh279p1xblVvET50/I=; b=abEQ9JK26Q2+HrTkrjqr
 HgnkoUH8Ev+txGTdNU5BYptcu8sHEDJJzI1Jn/LavfrLLO+TzynqvZXXJUk/88+UjJ5fiOVgbaTwE
 GqRuGM7orDgKhPbrz15eHgpgCII9AjkfMV1XsZBea7/dlf0KwniC4uEVdhLFDuJ+LaWa0oeBN+MoX
 Y68iVfzgGM+4SRsWB/H6Mv715PNJ33YFcSeBpKqmgE816GRoFEW7gki1kvsMlGRq+qXX8ttZFX78n
 UPIdMlSCrrlFwO8MReaSLatJVp6GF+T/Yo0jcV9M8VWJBVLG6LZwWA6L9388sf91I77Eoeo9OS1nW
 Okoze8ScTzZ6Ww==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxAJC-0005pL-Dl; Mon, 21 Nov 2022 12:10:20 -0500
Date: Mon, 21 Nov 2022 19:10:24 +0200
Message-Id: <83edtw2pz3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: casouri@HIDDEN
In-Reply-To: <83fsec2qq3.fsf@HIDDEN> (message from Eli Zaretskii on Mon, 21
 Nov 2022 18:54:12 +0200)
Subject: Re: bug#59426: 29.0.50;
 [tree-sitter] Some functions exceed maximum recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> <83fsec2qq3.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
>  59426 <at> debbugs.gnu.org
> Date: Mon, 21 Nov 2022 18:54:12 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Yuan Fu <casouri@HIDDEN>
> > Date: Mon, 21 Nov 2022 08:43:45 -0800
> > Cc: Eli Zaretskii <eliz@HIDDEN>,
> >  Stefan Kangas <stefankangas@HIDDEN>,
> >  Po Lu <luangruo@HIDDEN>,
> >  59426 <at> debbugs.gnu.org
> > 
> > > There are still scores of Elisp byte-compilation warnings but I leave fixing those to the tree-sitter developers.
> > 
> > Could you paste the warnings? Because I don’t see any warnings on my machine.
> 
> I' see them and am working on fixing them.  (You won't see them unless you
> configure --without-tree-sitter.)

Done, the warnings should be gone now.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 17:01:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 12:01:58 2022
Received: from localhost ([127.0.0.1]:48648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxABB-0005dY-Mj
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:01:58 -0500
Received: from mail-pf1-f180.google.com ([209.85.210.180]:39829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oxAB9-0005dI-Ng
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 12:01:56 -0500
Received: by mail-pf1-f180.google.com with SMTP id 140so11880413pfz.6
 for <59426 <at> debbugs.gnu.org>; Mon, 21 Nov 2022 09:01:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=39Z15oTIvNHpCdYHDIxR8j0Dk/M8KOkdFvys3PWN1U0=;
 b=d5KsdlBwb/8WF0dMqP5aOT+CQpVezmevQVFr4RWxsNwkOGV9Tgu/G0S/NxfwWusU5k
 am5G4UX7TElHVPbFzchFbKQkkF4KM0ySqTfHMQYifv6FG/Awm0C3NdeH4AtH3IRjveaz
 NW8dx8MMjpGjH59ht+HA9wqTgd2C6mcyv5+9yEDlJSezCTnz3z0QjJONa8g6N2xj9DRz
 zXQ/6nklE4MyKcEsfCecFkYXXsz7sGMFucqzMsPTMaBLkyz/BeE4gw+fKAZrsP8fp6Tq
 99cYPcm/Svaq0QPq4xI2qr6huRI5um6wr5Hjhc7PdRip8FpkI6lLENiqgh6u8VxPjWsg
 O1zQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=39Z15oTIvNHpCdYHDIxR8j0Dk/M8KOkdFvys3PWN1U0=;
 b=fg0J71IgQ588kCWToTwXj/l0T8pqA2OQtHRzd/V3WvakaK88hbF/EjqNfPlkxI2oyA
 FLOXdtsEyI6naW7A/GGanmNtbCWKTkkGEEQ68dcYUxmS4TQss2shP7qBLsl4/+kktNfo
 X98sh8/WqYPqp69SFso8VJbmbjzVWU2Wfir5KMQ0jVcHyXuf2p26Co/iYEIgcIsIE0bK
 HihQD5OE+EDU5vvAMhg8hQU8S/ai3eQBZCB+gf4MDw4xsC1z2ldsdifDo+mqrqRBaOAL
 85TqbWO1jMFg2ODhfYPK+TC1FmMWYM+IEGoSv/JZtROuYOXpNSrrjvrtDB5POsyFwGl/
 I5Mg==
X-Gm-Message-State: ANoB5pmLCn2G0QhBtuwsAMrvvXirVg3MTTqRHPM3kgfZskogbZ4b5dsL
 m4UM28b5Oyg6t/gBX/F0Bq8=
X-Google-Smtp-Source: AA0mqf5mcqHEpTxTPPCTjDm3jN94yvONwnLuxQiv/r2ffhUgPSfvZMruSiC0DgQL+zvaRf3UMMqIKg==
X-Received: by 2002:a63:3307:0:b0:477:8fed:80fa with SMTP id
 z7-20020a633307000000b004778fed80famr1636707pgz.96.1669050108533; 
 Mon, 21 Nov 2022 09:01:48 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 y19-20020aa78f33000000b005736209dc01sm5173452pfr.47.2022.11.21.09.01.46
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 21 Nov 2022 09:01:47 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <3A46E3F3-08BD-40C2-9B68-0EAF03295E1C@HIDDEN>
Date: Mon, 21 Nov 2022 09:01:45 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <E4A36FB0-989F-47DB-9433-5A7940258DEC@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
 <3A46E3F3-08BD-40C2-9B68-0EAF03295E1C@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 21, 2022, at 8:54 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Mon, 21 Nov 2022 08:43:45 -0800
>> Cc: Eli Zaretskii <eliz@HIDDEN>,
>> Stefan Kangas <stefankangas@HIDDEN>,
>> Po Lu <luangruo@HIDDEN>,
>> 59426 <at> debbugs.gnu.org
>>=20
>>> There are still scores of Elisp byte-compilation warnings but I =
leave fixing those to the tree-sitter developers.
>>=20
>> Could you paste the warnings? Because I don=E2=80=99t see any =
warnings on my machine.
>=20
> I' see them and am working on fixing them.  (You won't see them unless =
you
> configure --without-tree-sitter.)

Thanks!

> On Nov 21, 2022, at 8:56 AM, Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> =
wrote:
>=20
> 21 nov. 2022 kl. 17.43 skrev Yuan Fu <casouri@HIDDEN>:
>=20
>>> There are still scores of Elisp byte-compilation warnings but I =
leave fixing those to the tree-sitter developers.
>>=20
>> Could you paste the warnings? Because I don=E2=80=99t see any =
warnings on my machine.
>=20
> Build without tree-sitter and you should see them for several .el =
files, as well as when byte-compiling treesit-tests.el .
> (I could paste the warnings but you need to reproduce them yourself in =
order to fix them anyway.)
>=20

Ah, I see. I=E2=80=99ll let Eli do the hard work for me :-)

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 16:57:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 11:57:02 2022
Received: from localhost ([127.0.0.1]:48644 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxA6P-0005Ti-S8
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:57:02 -0500
Received: from mail1436c50.megamailservers.eu ([91.136.14.36]:50172
 helo=mail263c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1oxA6K-0005Sg-E1
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:57:00 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669049772;
 bh=CXQ5vQ/1gn2sImbCfxZHFa9gH6pnYJE7NDUG+X/gLP8=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=cEhY1jiP7nMDItuCbCmzsdOucsJzvGdWDZ8UGN6u4ADp4VlQoNtK9VgW0liqXd63e
 wHAlG7963NcV/iHN8GVZiv3XyGOys5IEtP221rapHqJGQHHH1zdr0ft3nI1AyKaAJH
 oj+buwlXVQrLiF5sVDp5Q7mvY0ap0I2jXNzRlcR8=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ALGtxBZ015634; 
 Mon, 21 Nov 2022 16:56:06 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
Date: Mon, 21 Nov 2022 17:56:01 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <3A46E3F3-08BD-40C2-9B68-0EAF03295E1C@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

21 nov. 2022 kl. 17.43 skrev Yuan Fu <casouri@HIDDEN>:

>> There are still scores of Elisp byte-compilation warnings but I leave =
fixing those to the tree-sitter developers.
>=20
> Could you paste the warnings? Because I don=E2=80=99t see any warnings =
on my machine.

Build without tree-sitter and you should see them for several .el files, =
as well as when byte-compiling treesit-tests.el .
(I could paste the warnings but you need to reproduce them yourself in =
order to fix them anyway.)





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 16:54:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 11:54:09 2022
Received: from localhost ([127.0.0.1]:48640 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxA3d-0005Ok-97
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:54:09 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oxA3a-0005O2-5d
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:54:08 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxA3U-0004eH-J3; Mon, 21 Nov 2022 11:54:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=46qBCK2z6yphi4J92ovsRxC4aKztiKGO0U7YorCoxaA=; b=miuBHr/V7lQ+XyN2s3X9
 kNltNhJuoixNIucZ+iJ0QqJvOXW/95guyh3mkCFDmlCkJ18MZwDN0qUOaQStGobaOSXD4z9fwBKJi
 eV7pk5fcwNK/rAqp0YS5UguQXca2iRAjEAoq7mdKsgkRPao4/yDfdWtDo9wBQpEi7ulx5twgZ8MLA
 Dijbq6pjfMwLRILKQwtwGc7xcDziFHoYAjlNCLNw/sXGOeV7FiKTisTAynM/XLI3CZG1DL2shWCEG
 zHq2Oz7/YWDUMaYMRXwEqXmm+Jm8Nx/ERd4+YXUlaxq1fFm4UogUWGv6GCSmoQemcOsa1i/xZtpBA
 6tMCPbGjFNhvBg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oxA3U-0006nT-2Z; Mon, 21 Nov 2022 11:54:00 -0500
Date: Mon, 21 Nov 2022 18:54:12 +0200
Message-Id: <83fsec2qq3.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN> (message from
 Yuan Fu on Mon, 21 Nov 2022 08:43:45 -0800)
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
 <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, mattiase@HIDDEN, stefankangas@HIDDEN,
 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Mon, 21 Nov 2022 08:43:45 -0800
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Stefan Kangas <stefankangas@HIDDEN>,
>  Po Lu <luangruo@HIDDEN>,
>  59426 <at> debbugs.gnu.org
> 
> > There are still scores of Elisp byte-compilation warnings but I leave fixing those to the tree-sitter developers.
> 
> Could you paste the warnings? Because I don’t see any warnings on my machine.

I' see them and am working on fixing them.  (You won't see them unless you
configure --without-tree-sitter.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 16:53:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 11:53:05 2022
Received: from localhost ([127.0.0.1]:48629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oxA2b-0005M9-Da
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:53:05 -0500
Received: from mail-pl1-f181.google.com ([209.85.214.181]:38606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1oxA2W-0005La-UU
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:53:04 -0500
Received: by mail-pl1-f181.google.com with SMTP id j12so11112711plj.5
 for <59426 <at> debbugs.gnu.org>; Mon, 21 Nov 2022 08:53:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=MMlxc+oAIX8DXCz4OlDjGu6q5VV0OtNdomVNWZXx4bc=;
 b=pJADoCCF8zsojD5K33xS23WMeGXGA+Nlbd1nEYgXKRFRIst/Xj/hRLlC5qSwGeSmlN
 c0n/p99e0Abm6zAxPdnQgVCwq/pmOeJZnzIfL3N/4/WpOv3azmJIDTe0dXBFNMTr0Ury
 hVWJTj+udm2SNTPWgGLiupzJX5Iy11ayETGjU73c/Qe5mg73OfO4Go9nOTlrnL/VH5Jx
 4SBrYuOLJhXFvO32jXqcKg68x2SOy9FSDelEsZJdOaaU2B3ahDPOn3qGET3eQyVZfp5E
 6/r6g/pU3KNm4xPkei6MAH4sx1drWzTBvtkUTASESwfHn8UVSa6sqt9HedNf7UhTpj9D
 x/Wg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=MMlxc+oAIX8DXCz4OlDjGu6q5VV0OtNdomVNWZXx4bc=;
 b=x71cbCzAmsHrEbx546Y5TTrkbdmaMX2vIfKRVX+GYXDmruIm8+z2IbMAOd+ogYgqAZ
 AuLdpAVPl0DsPNeVmfwnVGeByWDX5PidyjzZnls76THr0V730KcIB+oKrskyBYrFxi2M
 L0hItWArFBzwjvpdMY2p7DYqdcgEZIuiCP4mXo+sH3wovBhxruEsrHSyuq2Sjnk18BCC
 xU5sCq0X6qr6D3XxPWrgESYGYsDFmBDpFZ47RJMYnyDaAuVS4VcPxZFcnKnvjeX526wN
 hvwOVBCq1F13wVdLSdTWrDqr81moFKu/ydIeViIIi/J2xe1Yd02dOWhNakj6uvOTE/u6
 CENQ==
X-Gm-Message-State: ANoB5plEs4yN+JJGTC2mCmjWylFurjkrQHJuhLHkCEbPPgkYpXJd7Bsd
 pjSvwwX5k2k3jqUfrxTU0WR13sjVpUg=
X-Google-Smtp-Source: AA0mqf5JNXnStfQnsWam8cPKyQbho35KE+xXmid0VDOOEeTkOOoq6kf07wfHvL03fDjIlsKisjwm9Q==
X-Received: by 2002:a17:90b:48c8:b0:20b:25f6:3e30 with SMTP id
 li8-20020a17090b48c800b0020b25f63e30mr21566102pjb.227.1669049575201; 
 Mon, 21 Nov 2022 08:52:55 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 ix11-20020a170902f80b00b001788ccecbf5sm9992317plb.31.2022.11.21.08.52.54
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 21 Nov 2022 08:52:54 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <837czo4f8y.fsf@HIDDEN>
Date: Mon, 21 Nov 2022 08:52:53 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <CDDFCA51-1294-4743-93B2-92E31490F4A9@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <837czo4f8y.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 21, 2022, at 5:19 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Sun, 20 Nov 2022 16:53:45 -0800
>>=20
>>=20
>> Emacs crashed on a very large C file when c-ts-mode is on, because
>> the function building the imenu list tries to walk through the whole
>> parse tree, and end up recusing ~10k times because of how deep the =
parse
>> tree is. These recursive functions should have a built-in limit. Does
>> Emacs already have some way to determined the max recursion limit on
>> each system? Or should we come up with some hard-coded numbers?
>=20
> Is the recursion in our code, or is it in libtree-sitter?

In our code, when we walk the parse tree.

>=20
> If the former, one solution, albeit a crude one, is to track the =
recursion
> level and error out if it becomes too deep.  Another solution is to =
handle
> the stack in our code, in which case the stack can be allocated on the =
heap.

That=E2=80=99s my idea, hence my asking for a reasonable way to get a =
limit. I think a hard limit is totally reasonable, because there is no =
way for a =E2=80=9Cnormal=E2=80=9D parse tree to be 10k levels deep =
(that means the source program is 10k levels deep, ver unlikely for any =
program a human would write or a machine would generated). The one I =
observed is likely due to the parser misunderstanding the source (due to =
errors in the code). Plus, I don=E2=80=99t think any user would want to =
walk that deep into the parse tree either. If someone expects to walk =
that deep into a parse tree, her program is ill-designed.

The tree-walking function already has a limit parameter, we just need to =
give it a default value.

> Yet another solution is to replace stack-based recursive algorithm =
with
> queue-based iteration, like if you replace depth-first search with
> breadth-first search.

Because of reasons above, I think a hard limit is good enough.

>=20
> I'm sure there are other ideas as well.

Yuan=




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 16:43:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 11:43:57 2022
Received: from localhost ([127.0.0.1]:48615 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox9tl-00052V-6f
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:43:57 -0500
Received: from mail-pj1-f50.google.com ([209.85.216.50]:43763)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1ox9ti-00052C-7T
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 11:43:56 -0500
Received: by mail-pj1-f50.google.com with SMTP id
 y14-20020a17090a2b4e00b002189a1b84d4so5397802pjc.2
 for <59426 <at> debbugs.gnu.org>; Mon, 21 Nov 2022 08:43:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 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=f4c9Ar7UfZwkRefd1Cqbhxlad5+JHvHmttckmW/axYY=;
 b=DEQAR6fKqgoapxyZr6gygtE6tUlsLR06cNl/mnPo92wPZV4X5+dYvLEtnGksed8hlQ
 OfXzmG8nyIKVWWdXlfpbQhOg3Z1iKEpMZm7MILxUY5nFQhtRGjedXjPGLM/p+JfCmJQZ
 XIG0dOE7OWuikVmMyBVEiw6+snE2uCrBh8he1iZM9/H8l1zqPsSUF6zY7lkk4yuhRgIO
 ABG1xFw+WlwaVC+hWeYZOGvTmcR+yafHYciTlCr7+8WQm4BsG2RVwdNn1pW6aHmm/I6X
 GOgFCJhXOpZ7TJS76832dD8ft7gj3wGp2iKRR1FyXpJablv/nBEunZwsYxllGPJln9uU
 S5BQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=f4c9Ar7UfZwkRefd1Cqbhxlad5+JHvHmttckmW/axYY=;
 b=s+ALQs2zG96Xg8XtFtzetlNjJZvmQ4KO566MScXh8fGgtMIXh0ENBfM9BilNONoEzo
 PVEh8NCbDMsBh2l9pjjfHBmzjHUTPENorTRnpLR4I9NVxnDeHzQGqAaSRUNM878YIQud
 t2vqw6QNan0pCft6NpxEe7NOmcydOGRHgK0Rfy0MxDbcZbh0uZrgzC0KRHQ8AfGdVNWX
 M9YTzzCOhK9qlGL/ofG9FdLWIM9oAHEBREosgG8z6NpeKc+CYxKJ0CqYZyiZ1iwDfEMP
 rmC+EZVrCLMFIXUro/iwbZ1U5UsXcsUBFJIIGN93hwaorzXFqTHRVBzThlD+ocjYBP2k
 LNMA==
X-Gm-Message-State: ANoB5pkwhJWmKFwY4upSkbRCwYU6eWfLUOzHjh3e9mpi9+3R+7BkxV/a
 xHgti06aQOs5R1CF2eUsaNI=
X-Google-Smtp-Source: AA0mqf5cSqAYhBPfnERkz1B90AwDTffz8XeNIWSn/oy2EU4yRYvNImkKu91q4XDisfo0lpG4NBig4g==
X-Received: by 2002:a17:902:f2c5:b0:189:1cc3:802a with SMTP id
 h5-20020a170902f2c500b001891cc3802amr1500983plc.56.1669049028265; 
 Mon, 21 Nov 2022 08:43:48 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 b10-20020a170902d50a00b00186b549cdc2sm7607911plg.157.2022.11.21.08.43.46
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 21 Nov 2022 08:43:46 -0800 (PST)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
Date: Mon, 21 Nov 2022 08:43:45 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <DB3E0C34-13F3-4955-957E-CB46AB1C6A73@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
 <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
To: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Nov 21, 2022, at 6:46 AM, Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> =
wrote:
>=20
> 21 nov. 2022 kl. 14.55 skrev Eli Zaretskii <eliz@HIDDEN>:
>=20
>> if it doesn't build for you, please hurry and report it as a bug =
[...]if you cannot fix it yourself.
>=20
> Good, I've now fixed the C compilation errors when building without =
tree-sitter.

Thanks!

> There are still scores of Elisp byte-compilation warnings but I leave =
fixing those to the tree-sitter developers.

Could you paste the warnings? Because I don=E2=80=99t see any warnings =
on my machine.

Yuan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 14:46:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 09:46:51 2022
Received: from localhost ([127.0.0.1]:45981 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox84R-0004tH-4H
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 09:46:51 -0500
Received: from mail1455c50.megamailservers.eu ([91.136.14.55]:43008
 helo=mail266c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1ox84N-0004sx-UE
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 09:46:49 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669042000;
 bh=5Kqj6u6mYJG+P/KaHP1SyyJNNw6clEhTCbb9uEXV0xw=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=QUn3LH4dO+VBcmhs+qZDRZYT+8C9gUs1pDEQQZnb+iN+/pkogh9BVlKlPstwt4iV5
 5jv2wu9eKnGF1JrV+azKZLJ8uwa2FqSUGT8qlIwFdFX2BZ9l6Ku3AME5Zlgz1Ch6Q2
 HcwmFXli3myx4x4o2lVLKFywly7+7NGlqa3npKTU=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ALEkQmA080819; 
 Mon, 21 Nov 2022 14:46:35 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <83v8n82yzl.fsf@HIDDEN>
Date: Mon, 21 Nov 2022 15:46:25 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <A510A261-7FAD-43EE-A7F4-8A83442A4CB6@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> <83v8n82yzl.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F21.637B8F50.003A, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

21 nov. 2022 kl. 14.55 skrev Eli Zaretskii <eliz@HIDDEN>:

> if it doesn't build for you, please hurry and report it as a bug =
[...]if you cannot fix it yourself.

Good, I've now fixed the C compilation errors when building without =
tree-sitter.

There are still scores of Elisp byte-compilation warnings but I leave =
fixing those to the tree-sitter developers.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 13:55:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 08:55:39 2022
Received: from localhost ([127.0.0.1]:45852 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox7Gt-0001K3-0V
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 08:55:39 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40458)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ox7Gr-0001JP-3I
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 08:55:38 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ox7Gl-0003lP-Qh; Mon, 21 Nov 2022 08:55:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=0A/wyFqrqWQdhCrrzg8QKlRlw+SB2cRU7ZQBrdbFE0o=; b=C5sl2FH/Sd7H60sCuURD
 7y4jId7IuRwWogHNR5CrJ3H1lBIf2upAMkttks4s4zcII/05Xs7dAK7DlCVfpYpP1o/WomxXZX6Iw
 RdqQBrlTn6eSP72x8MqrVtpS+WOAXp8RkifQ2rOP3K6FslL1N65DXiVANe9Bv6/gtLmCFpk0sdD+W
 xtpwhjXhS25c5oJf9mZNKrgC81DiF8rkGfyA+G8uQ/DaEJaus8IL10bP7j7z8IPHUqPp8O58l2q1B
 I+A8GJk4Jupkg1XWZCqFXsCAPzsM+zS/VxH19BkdQdTycMj1ULD1Lj4hQOi2jahCx/AStDCLdQk7P
 0hkkcL5jBH4oBA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ox7Gk-0004h8-PU; Mon, 21 Nov 2022 08:55:31 -0500
Date: Mon, 21 Nov 2022 15:55:42 +0200
Message-Id: <83v8n82yzl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN> (message from
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 21 Nov 2022 13:00:45 +0100)
Subject: Re: bug#59426: 29.0.50;
 [tree-sitter] Some functions exceed maximum recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
 <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: luangruo@HIDDEN, 59426 <at> debbugs.gnu.org, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
>  Yuan Fu <casouri@HIDDEN>
> From: Mattias Engdegård <mattiase@HIDDEN>
> Date: Mon, 21 Nov 2022 13:00:45 +0100
> 
> (I understand that the tree-sitter branch is very experimental as it doesn't even build on my machine.)

It is much more than that: it will be merged to master soon (I actually
expected that to happen yesterday, hint, hint), and will be part of Emacs
29.  So if it doesn't build for you, please hurry and report it as a bug
ASAP, if you cannot fix it yourself.

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 13:19:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 08:19:04 2022
Received: from localhost ([127.0.0.1]:45756 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox6hU-0000Kw-Kr
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 08:19:04 -0500
Received: from eggs.gnu.org ([209.51.188.92]:57452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ox6hT-0000KS-4M
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 08:19:03 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ox6hN-0002n5-Se; Mon, 21 Nov 2022 08:18:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=QoM6cToA6a4khyHy2Zznv7QPuo5KzqqcwoPqkciZpeI=; b=kQEeRWOr+4CU
 kyJAVLLpQnT6WVav8ohUKL7NvfBmMSTC0K/ukza++m71vfx77Xjzgm8G58SLVPWdbrrgbAdT1Nuxr
 oERXIT9gex5ijxK57IbK/LPRZpt0KlXa5iKZhHSdQ+B8bQNItDoZWJQOvomImyF8f2GTQCy4saYD0
 Dabr9QS980VD7eOKOD0HvUZKU/sKbxSElLaRt/CII+DrW4QCHpVgFS/yfjPasXg13P4vqBavDgNcz
 74iFCk0VzN6+VzEolG1EEE/kNo/9fzCnsGIkvYpDhMuppGAUSvuSA8uDIyqb2AM6vCxr0/FcVJ0MD
 v5zaH9fhckUuWwwOKxJVdQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ox6hN-00034x-6y; Mon, 21 Nov 2022 08:18:57 -0500
Date: Mon, 21 Nov 2022 15:19:09 +0200
Message-Id: <837czo4f8y.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN> (message from
 Yuan Fu on Sun, 20 Nov 2022 16:53:45 -0800)
Subject: Re: bug#59426: 29.0.50;
 [tree-sitter] Some functions exceed maximum recursion limit
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Sun, 20 Nov 2022 16:53:45 -0800
> 
> 
> Emacs crashed on a very large C file when c-ts-mode is on, because
> the function building the imenu list tries to walk through the whole
> parse tree, and end up recusing ~10k times because of how deep the parse
> tree is. These recursive functions should have a built-in limit. Does
> Emacs already have some way to determined the max recursion limit on
> each system? Or should we come up with some hard-coded numbers?

Is the recursion in our code, or is it in libtree-sitter?

If the former, one solution, albeit a crude one, is to track the recursion
level and error out if it becomes too deep.  Another solution is to handle
the stack in our code, in which case the stack can be allocated on the heap.
Yet another solution is to replace stack-based recursive algorithm with
queue-based iteration, like if you replace depth-first search with
breadth-first search.

I'm sure there are other ideas as well.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 12:00:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 07:00:58 2022
Received: from localhost ([127.0.0.1]:45600 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox5Tu-0002HJ-2v
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 07:00:58 -0500
Received: from mail200c50.megamailservers.eu ([91.136.10.210]:52046
 helo=mail193c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1ox5Tr-0002H5-G8
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 07:00:57 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1669032053;
 bh=v0ptIJXN9Enus0g3+hwJ/voc3lMTZP7wKiVwi2nBgeI=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=VorOvH++VJoQCpKuN39tDO2jAfUyuINkt8J2asXc797OtL3gP2co1FJhh8gV7Y2Y9
 HQ2HKHTGQE7RvVDCRD2XhByMzLGiV/J+5033Pb8J/UbV9F+9Rc5RsuIczDOZRngVWW
 3wjEdjTLeIEUnoclCtx6DPPWQhWKOTaeqd7j3toA=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se
 [188.150.171.209]) (authenticated bits=0)
 by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2ALC0lBY110566; 
 Mon, 21 Nov 2022 12:00:49 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
Date: Mon, 21 Nov 2022 13:00:45 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <701BF611-6506-403E-B70B-2D93F3339E0C@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
 <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A782F29.637B6875.004F, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 59426
Cc: Po Lu <luangruo@HIDDEN>, 59426 <at> debbugs.gnu.org,
 Yuan Fu <casouri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

>> We _used_ to have max-specpdl-size, which would act as a limit if the
>> recursion was surrounded by specbind.
>>=20
>> But it was deleted in Emacs 29.  Maybe it should be brought back, for
>> this and other deeply recursive C functions?

Highly unlikely. If reasonable use can make C recurse too deeply, then =
fix that bug instead.
What is the call structure leading to the crash? Is Lisp involved?

(I understand that the tree-sitter branch is very experimental as it =
doesn't even build on my machine.)





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 07:38:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 02:38:12 2022
Received: from localhost ([127.0.0.1]:45211 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox1Nb-0005UU-UY
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 02:38:12 -0500
Received: from mail-oo1-f44.google.com ([209.85.161.44]:33708)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1ox1NY-0005UF-Bj
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 02:38:10 -0500
Received: by mail-oo1-f44.google.com with SMTP id
 j6-20020a4ab1c6000000b004809a59818cso1686566ooo.0
 for <59426 <at> debbugs.gnu.org>; Sun, 20 Nov 2022 23:38:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=Jwi91ozlxcvbqmHga3qFuZZNfAzN8ZaLUI4DNCpTPL8=;
 b=oYRXVtGt+RB8s0x0f0AOEApblXzFU7RQNc1UUv2P4Vf0w+QC6OH8+R7Rgj4Kz+/Xib
 BVtbf/feYiDW6pXKQtQMSgUjEITsEQWZtzoS+t2gkA2JglE3DKExxlvWtaSvM/CXduLA
 EZALar19iqt4DcACq6BzkQpDl8h5ew0OM+iibFTAAnchKuTUnf/NpCDH27XqnRUEwqB3
 wZOJMmNU/4BeF8hsrxv1BZKG7WbHq9bUen8FLlnFtKZ+8HzCCW2iEAfugUxlkRETy8h5
 JdHoitWwuvIjtVumyOcgk2b/GA9/3QBVm9GwqZ97EDa7tfuhTbmX6xpC8IH08qeLXXQa
 Ngmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Jwi91ozlxcvbqmHga3qFuZZNfAzN8ZaLUI4DNCpTPL8=;
 b=Uf7kwTul8GsUIVTGv087g4OTf20Y8soPoGYRZOeeAuMb1KWMJk9VVnuXUT+wwnk1Hh
 YjPc+4wDuB6m0/qHa46wX5iCziv3LJwCFo5ArB9A9n92RSbNPiY5MkNQ3mvkBzj4tRSs
 Lb+Jwm7wZzTs5hzAMvmWSfi76udqO6MYHk1Dp2gmXPkjKnA+jyVYsA/6ka/g+FmcoARE
 ebGqzXEXmGBHMSIFjLFvubqA5pRo7yWQbuEfvzmo1DLem7RiOfR7b2e8i8BQ7hOTSQAi
 VhjcmSMG5456IaR2S79OBaStJ3rtodbu9nZ1lxnmIKRlmhNHb4Oe1trw0gP72csp255o
 Jcyg==
X-Gm-Message-State: ANoB5pn0uZZDT0OdIYDdkJVIfFwBXdRrA/V111yGiPplFkPrpIdhWB54
 yY4f1PVc2zaYAnLhNg2yZnPqjSVkftpZIfZn0Mw=
X-Google-Smtp-Source: AA0mqf7GP6523Bicc8w9rSIWIdqmps+ksWvNJ/q9C3KFohVRFUg4wxkbTmAU/adcte/WkoorYo/kDdukGNhNm63t0Bg=
X-Received: by 2002:a4a:2a57:0:b0:49a:6eb0:735a with SMTP id
 x23-20020a4a2a57000000b0049a6eb0735amr7958509oox.34.1669016282559; Sun, 20
 Nov 2022 23:38:02 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 20 Nov 2022 23:38:02 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87wn7o6c9c.fsf@HIDDEN>
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
 <87wn7o6c9c.fsf@HIDDEN>
X-Hashcash: 1:20:221121:mattiase@HIDDEN::VHeQwbTGwwkhJ0ZN:0fWM
MIME-Version: 1.0
Date: Sun, 20 Nov 2022 23:38:01 -0800
Message-ID: <CADwFkmnmMxq=cGX7Qkh_9LCaLzZazr0cpJGVwaPzh-O6ksLEMA@HIDDEN>
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
To: Po Lu <luangruo@HIDDEN>, Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org,
 =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> We _used_ to have max-specpdl-size, which would act as a limit if the
> recursion was surrounded by specbind.
>
> But it was deleted in Emacs 29.  Maybe it should be brought back, for
> this and other deeply recursive C functions?

Copying in Mattias.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at 59426 <at> debbugs.gnu.org:


Received: (at 59426) by debbugs.gnu.org; 21 Nov 2022 06:41:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 21 01:41:08 2022
Received: from localhost ([127.0.0.1]:45161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ox0UN-00045O-PW
	for submit <at> debbugs.gnu.org; Mon, 21 Nov 2022 01:41:08 -0500
Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]:37090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1ox0UI-00044h-Ow
 for 59426 <at> debbugs.gnu.org; Mon, 21 Nov 2022 01:41:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1669012856; bh=5okm2fIKPL9lQfjURrx3ALEIFG4jNx1EXmDymN/MQ84=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To;
 b=dLOJ3ACfg+LVYZQszQB/QwI5SZX6bYU4Lio5wK95CDj9GnBQDZzCvJbpIul+Jllq2nkjnGNYEjmKBBOhAjnne77XJPP2+MaI9/WUzbgf92GY0D1Ijfq0GYhcbQRhhx6Dt8o8BmkQstQGXy3gWBXz3jm0Ip6P3XFGxiNnppKuqfFos65Z1hR8orawzoTFqVTnwGNNX5V+y4Ir3kiY0ZJL9F5kF6yuj6MbfIYiKeEFAo5g1jbYF9fj0OEH3Qggsm8pQraPxs1OG01tV1YokTLLitFfFDPIEVTbwCWSDV4E50EMm49vpgIDcgI6VHIKmQTJ9JeSbXN65nBFDq/EoA1QCw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1669012856; bh=Z5LOJB89xfq5I5GlqpYKhjg+2JBvMfpSNQpHrzCtm7f=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=ny/b0Kf+PUDg/KxujqHgdCWnU/Ln7yldgYVND9MzG6TTN8pG7UR3nr/8SbjILGEVEJV7E5YYyaFoNSBcEOIcQthRLNCzHQ4gsYtogWJVV2AxOEuozNetC8b7VrP5LRjQUfB2J4eiGTwIHUk8DUQkRvmF3uXbKytiFYN2w4hsg9Gbj8ef7Hr1siCtqw7M4iV1iEJyMmYdxDKiipjw988739SSBEvpkcPqCM5ijNBxIEouqwq5WB/F9u6Lj55je+MHMTkOlgcfl5BhQlscKnyozZndx1g2/pRJ1oAnFs0sUIg5eHAlTtVjj2UgpQAdD+aC7DA5rNAG9Eg5ynod1heGEg==
X-YMail-OSG: WuzsBu8VM1nGrMzLZCf5mj6_NFqbVJJYpli8cAqztKLIsVlYEjTjcSjkeINVvxm
 bOgcJcfe.Szz0scwsdgM1rqlIWZa38nr09kyyo7fEuHJOPndg8uYjudMmDKlJw4MCZYhFxD2QS_o
 IqOPz_QiUU852sJFv_rxeas89Sh42LL6qbEonedjIm.oo10uX2oL9yw.B2FSMuaCgiHuvfnNkyLM
 PasNGrjVaWmc43JZR0v5ybOhBPgrixrlRILjzRUAD0rmQKZ.JUqpc0LWkeOWowBgCbuBlR8s7Cwc
 tvX7j2F0eVmc.NNeBW131oIv7A.DxtBnMVTDL2fSaCUFSSUqV8PMjTDHqYZU5RMzUOVTa1NlfmVx
 YoopjNpGXMMgfrCdmIG0i7lgDsa3yHVaIsXtaTa48HdrVwEEFLr.z3dovrG7nL5Y45D94BO4lv2s
 HTFz5WxquUeG97Ae5I43EIu9qetgn_xSxs4Hrhpdsc0tXXaa5XAHWTacPOa2EbQ9AaPy8ZG4Otmo
 W4i1djOb8KIvjVNhjFYIpNqCW0NhonFhTw6hU7MDVVJahclXncoTBVXaZ8A77LuyWhTnVzZ6amGq
 vm1YVVa5e7Wad5ehtC6EucskRXgIuGG4F4X54o8S2E.QGahQp4qPjRjMIw6MaKF_zJ4abQ7Va7Vx
 ZdbXZJzbHa.PTqLBiZeXDwR3FbIHDQAahDiKw38TzhRn8kxei6lGzsqRyEDbjQyRlWEyvOS8VdFq
 SjW7KuBtKlP195Qg1WS3RzpGrjApYkyFo9PpB2AtYblHfWatjUVDTPCcAnYQKPp73vuCWQswPqgc
 PRD.ifaMmBht2h8cWB2H3b68OlI.zLh5_jL4.7XkFZAhodlDtWSiiy6KHvuK6pRAoiCiOwCgWcja
 ib7sA2R68iiO7fWdf65KsuOIOQSwP5VRMb_Y.4lui6DGkq3s25fy.bPXRYBWfxFNPsdaWCZm2qya
 86XsXHCa6ys5j1s7egL5Ee.UjxZq6x_Vae4w9ruRQyhJ1JTSB_DHXlep6VJD9nt1zfkNbR_XZc6W
 FgrfwN3YBk7cARjZB5JCCiatw7FXIaNqZOlJULuONy2fletVWlVUsxy_i4swtuN2qAMo6lGyc31e
 rF4WXej3plfW7azFU7Vz4ca3DvDv.MCveO.fg2BJqqf6u3NKv5.D3.1lb.l_ydyDuKE0n77kl.eq
 iGVoI76AS3WRzaJ70eVOYOCA1edi_WM701Ewld_izmhl7OlZme9MgzOjcQPvpwMqIMPG27Bo1iqo
 P5J7QMnDQhZbPkUKHQgBvD6WjuyJB6k6ADw3xQqN4OGM0YKZ.OS.Qb4nef5mxEOgrajSfe9mZfe2
 WQl5yUvuhQNWzx9g8AzfDgjK.1PLJUcPMJTfOTcgC0VSuETx1rB0wVpxng_ACXdyC6rBYEsLWN9r
 6eljD9CLShrOO.WO9AZoJVJwEJejzrza53k9Y56TzTA8jeLkJjvyLo6iksmuBDN4cGt8t8DdW7Lu
 m2T0fWmywIcjiMDL4eP1NjtxZPQLhwJSF8.SyzUNmQJsKbNxkf0Z2drEV07xYmrcLYQyqqJ4A850
 YVt9mCZToGN1P4JTZtJPzEQK1EySakbfGiLstrDrBX2PdIsMns5tNBhpgv95MZdvOdu0iRe__Qep
 ktV39FmHWLz77KsGE1h33y22rRYRZyfSBk.XBJhM_lQLgFDWPlgt489iD94DNH8VTyGzFq3ECLlk
 W0A5ZGvWARgcUkmRv_Fa0BDoSYOr5uAZSJSnA1BcxpB3_RZJljDkooskeuqSSzQN7apwpqs8lQyo
 JBDyvHpKUZgAEH_vYg3YSHstlSSE7lb8E2QQwrTpI8eitiz.bN2ybNbVra8VhVV6EjCyvShffrUR
 F7D_PiCM_AESFWPlqS0bIXHi4WQLpaq_bZJ8itb3q5V6BrrbnxdKa4WJ7kjXDoAwTn7cw0sLvsA9
 G5NAb3UiYgvB1uWSUvtAQV4hRBq1guM_4o6O5YxPY26nOm6xseE_vvL0rDppa_v_OEJSmtda4sOM
 5yAvZRHfwB3s0orr_7FOzyPeCCsE2koWrajYa2ejcFsjtywd6JuYS_wCId5hFbPgILSmiL.C45BT
 _b8r1AZIluDXX1n7SHTfTK6LvNjsvvKrxDjeo8YP7nUdhSYIPG7gEMkZaePmib_NYborIk.qgwiM
 L1e0OstVNfzc38LLYeBqtXF_BaRolllvY8aXAz_Rc5UAK32L9Dxwbc16mZAdyaJOI2zo4ZN6b0Lo
 .GYj4dT9RexRPQUk601bqIKzmolF1Cjs0P_bE2Up07dTctfEvCJ8ZtYAvK4ck.yIi5Mk-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic315.consmr.mail.ne1.yahoo.com with HTTP; Mon, 21 Nov 2022 06:40:56 +0000
Received: by hermes--production-sg3-6c8895b545-pb7wm (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID e9e2df62dee4811f16096598cd9b36ba; 
 Mon, 21 Nov 2022 06:40:53 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Yuan Fu <casouri@HIDDEN>
Subject: Re: bug#59426: 29.0.50; [tree-sitter] Some functions exceed maximum
 recursion limit
In-Reply-To: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN> (Yuan Fu's
 message of "Sun, 20 Nov 2022 16:53:45 -0800")
References: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
Date: Mon, 21 Nov 2022 14:40:47 +0800
Message-ID: <87wn7o6c9c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.20863
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 686
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 59426
Cc: 59426 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Yuan Fu <casouri@HIDDEN> writes:

> Emacs crashed on a very large C file when c-ts-mode is on, because
> the function building the imenu list tries to walk through the whole
> parse tree, and end up recusing ~10k times because of how deep the parse
> tree is. These recursive functions should have a built-in limit. Does
> Emacs already have some way to determined the max recursion limit on
> each system? Or should we come up with some hard-coded numbers?

We _used_ to have max-specpdl-size, which would act as a limit if the
recursion was surrounded by specbind.

But it was deleted in Emacs 29.  Maybe it should be brought back, for
this and other deeply recursive C functions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 21 Nov 2022 00:53:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 20 19:53:54 2022
Received: from localhost ([127.0.0.1]:44926 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1owv4L-0001S8-OV
	for submit <at> debbugs.gnu.org; Sun, 20 Nov 2022 19:53:54 -0500
Received: from lists.gnu.org ([209.51.188.17]:45598)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1owv4J-0001S0-Ay
 for submit <at> debbugs.gnu.org; Sun, 20 Nov 2022 19:53:52 -0500
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 <casouri@HIDDEN>) id 1owv4J-0005jm-6R
 for bug-gnu-emacs@HIDDEN; Sun, 20 Nov 2022 19:53:51 -0500
Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <casouri@HIDDEN>) id 1owv4H-000203-Pj
 for bug-gnu-emacs@HIDDEN; Sun, 20 Nov 2022 19:53:50 -0500
Received: by mail-pj1-x1030.google.com with SMTP id
 71-20020a17090a09cd00b00218adeb3549so1456241pjo.1
 for <bug-gnu-emacs@HIDDEN>; Sun, 20 Nov 2022 16:53:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=2COhJD7K1lyInyuQZesAAJKBcC976RslRAmeu5VdaiU=;
 b=qmaGpMk2Q/HBmcltk0SHfUDbXI94ueH9/ut4JZFSEyWrWnw+kZeq6ZOqaFBj/mwg0D
 Uh8nEcI6XrnO3b8O4zo/9PVEmaD32IY8UcidR2NL2HLv1rTaRcdEKmmBzSDoRLBoO32S
 bkvrmr9pT2GkJvG/ElmZSL8mTIRZRFHEGB1Ik9gQ+G30uQ+MuKfIfRoM9/g7Jstt6S9O
 vrX/a03nMZ4bXBK6mMbGGM9lgGcuiFAHP4rkxwh2iGsskbfrwiPs2iN5+VFWwtUv2/yG
 V7Ob9dpw8P3AmwQq/9fXCDJp2aO6vONqPUlAyry9pEzsG0gCbK74MSpGH1JwwsMT/lZw
 gvvA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=2COhJD7K1lyInyuQZesAAJKBcC976RslRAmeu5VdaiU=;
 b=YHU1x2VJ6C+yMR2J3ge1JjDqeamdydcipOt6r+zlKSCreI9MoQU0miO1YFtOugovDt
 VxplT6Y+LryRwKDhSfQQWn3Mp/JPt51QFRXHLgW+ZN67DcCADACynHg8C1+ZPujjNU2W
 C5f74NSeQWTz2OkZUHsHobuHe7vXeYVcJfU85x+6FoyVpKDvPYg6Rxveh4Xx6cbB/ryc
 QPHZjCin/xYWvO8AvQ2v2s/Vdre2rbNMr1vpWHaRwxXywrDSQd4Mqmza81HoDkqfZluD
 c0c4CNoiKuI7NZ6pAwXSQj6KeI8budf2TJVs0YKkCQE+7Yha2yfNo87PTbNYID7tIVo6
 21tA==
X-Gm-Message-State: ANoB5pn/K9wQVXlND+I9cfCA3uxXlGboq5gmq20Yu85XxiQkid/5yBpS
 Xz8GvrnGZMu7jhFtfEy+51Y+1o7kjvo=
X-Google-Smtp-Source: AA0mqf5/Gk4boy2xw6X907X03g5DZCGrDMjKtHx8B7Kp1sXeDwYnqoh3NODl9gvOnGneezXz0lnT+w==
X-Received: by 2002:a17:90a:f0ce:b0:217:f56b:a861 with SMTP id
 fa14-20020a17090af0ce00b00217f56ba861mr23600092pjb.64.1668992027353; 
 Sun, 20 Nov 2022 16:53:47 -0800 (PST)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 y14-20020aa79aee000000b005609d3d3008sm7465195pfp.171.2022.11.20.16.53.46
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 20 Nov 2022 16:53:47 -0800 (PST)
From: Yuan Fu <casouri@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
Subject: 29.0.50; [tree-sitter] Some functions exceed maximum recursion limit
Message-Id: <B8E1A790-347C-46CF-8FE9-8884C719F248@HIDDEN>
Date: Sun, 20 Nov 2022 16:53:45 -0800
To: Bug Report Emacs <bug-gnu-emacs@HIDDEN>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
Received-SPF: pass client-ip=2607:f8b0:4864:20::1030;
 envelope-from=casouri@HIDDEN; helo=mail-pj1-x1030.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


Emacs crashed on a very large C file when c-ts-mode is on, because
the function building the imenu list tries to walk through the whole
parse tree, and end up recusing ~10k times because of how deep the parse
tree is. These recursive functions should have a built-in limit. Does
Emacs already have some way to determined the max recursion limit on
each system? Or should we come up with some hard-coded numbers?

Yuan




Acknowledgement sent to Yuan Fu <casouri@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#59426; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 30 Nov 2022 21:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.