From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mickey Petersen Newsgroups: gmane.emacs.bugs Subject: bug#60237: 30.0.50; tree sitter core dumps when I edebug view a node Date: Sun, 26 Feb 2023 09:41:18 +0000 Organization: Mastering Emacs Message-ID: <87a610wyod.fsf@masteringemacs.org> References: <9FCDA5B7-D216-45B1-8051-35B05633BEFB@gmail.com> <83sfeukwsb.fsf@gnu.org> <574817C4-3FD8-43EA-B53C-B2BCB60A6D0A@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23592"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 30.0.50 Cc: Po Lu , Eli Zaretskii , 60237@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 26 10:43:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pWDYq-0005y3-Kl for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Feb 2023 10:43:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWDYe-0002Jn-8U; Sun, 26 Feb 2023 04:43:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWDYc-0002Jd-LL for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 04:43:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWDYc-0006PT-Cw for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 04:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWDYc-0007Hf-51 for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 04:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Feb 2023 09:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60237 X-GNU-PR-Package: emacs Original-Received: via spool by 60237-submit@debbugs.gnu.org id=B60237.167740454327933 (code B ref 60237); Sun, 26 Feb 2023 09:43:02 +0000 Original-Received: (at 60237) by debbugs.gnu.org; 26 Feb 2023 09:42:23 +0000 Original-Received: from localhost ([127.0.0.1]:42354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWDXz-0007GT-3v for submit@debbugs.gnu.org; Sun, 26 Feb 2023 04:42:23 -0500 Original-Received: from mail-lo2gbr01on2115.outbound.protection.outlook.com ([40.107.10.115]:32282 helo=GBR01-LO2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWDXx-0007GB-3L for 60237@debbugs.gnu.org; Sun, 26 Feb 2023 04:42:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Itm0aY+wxQ/LkpWQqaRDvOr95LOibnV63BnLqZ8uvscdsnH3IbHxt+ivRGUv52CeBF+iF5bxC2x9hSLpM4jkG80+j1bQgGmGcdxbo6RfiP6WYwyukG1xY93V8K2lxuKCdOllLRocCYG6x0s/WNKJS4gsJZSe2UQGahLGqObirThwCfRw5GWv3g7Yb8P7nJfbxAKFRL4yHFhRzC1z50XT1oaaZVx/yMvovHXGee/gdAzfNRksb6pMZTtAUGl9eHH7yX2DOwpbeybJUO7dVh/GIo5xjwhdkpbsLxYhozJK/vxBG6wJ46Fsgrq9tGDw69dnDB0OsXKOtZkCy+oBU8iVBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o306s32r8AFhr1XVpHtG7tp/bTlZQrrtqcbsy0xVHBI=; b=FQjhv8n2nrSBNkh+qAgGBHMkswN08aJ/u4l2gu+8pL2zYthamZrqR0e3CBLj45tX8KTDNKdR7WXbDKMBgmBR6AAAxEu6PhykitWqvHkNNBOMDd23Xff23XWcpH82wVcAMEg2lw3i11xsRxvQev2q7uvlwYnTohAByHAfl0/ZD9zb9S++92l2ewmT7p6kbAlYj7V6yc4pAtNwKZAJm6wDq7UFplgJ5RbTebMBvbIF9I8iitZBT+SL8h/INNuyRKXT0LPU6iWutMVAsMRrVPt2KDJrsACDxmfcoEvvZAbiXnBgWXg8jChtZJX9PTEPW4X7nmNANAYBuolcBE1ESXLnBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=debbugs.gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semantical.onmicrosoft.com; s=selector1-semantical-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o306s32r8AFhr1XVpHtG7tp/bTlZQrrtqcbsy0xVHBI=; b=XRJoNW4Uicnl7F32t58cMNgSpsqtsJ/spPq1jIks96qbshC3RSEQMIuDEY4zSQncP5mtCOHtcsfby/aQNISFuq7OmfMfeEwywDAvX65TxbPQD/Rwb8jrSa98k4zTwi+gExsMnser0taiy1YX+dcQue6ThD2GcShqyGuYNi6SpCs= Original-Received: from LO4P123CA0332.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::13) by CWLP265MB6705.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:1ec::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.26; Sun, 26 Feb 2023 09:42:14 +0000 Original-Received: from LO2GBR01FT032.eop-gbr01.prod.protection.outlook.com (2603:10a6:600:18c:cafe::55) by LO4P123CA0332.outlook.office365.com (2603:10a6:600:18c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.27 via Frontend Transport; Sun, 26 Feb 2023 09:42:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org;dmarc=pass action=none header.from=masteringemacs.org; Received-SPF: Pass (protection.outlook.com: domain of masteringemacs.org designates 178.79.136.144 as permitted sender) receiver=protection.outlook.com; client-ip=178.79.136.144; helo=semantical.co.uk; pr=C Original-Received: from semantical.co.uk (178.79.136.144) by LO2GBR01FT032.mail.protection.outlook.com (10.152.42.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.12 via Frontend Transport; Sun, 26 Feb 2023 09:42:13 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 30744114002; Sun, 26 Feb 2023 09:42:13 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1677404533; bh=BKSghC041d8/brkYSUVehB2EoaX6ZuLM0FASe1L3kl8=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=JE0t0UsM/D6x+Co/RCLG2TyycFmSs8Qqz4Bcwt/gJtjs+rid/6YKP7V4l73t76ub3 whNnvr55/44cgKOL8MqWuHR5eQ0TcLf1zOfDAspKKtMX4IdshhzTkQcZ45e4lBoINv AbMKe+Ka6VZ43hqjQ6Y0OplY+k6mwksxarZ1FB2A= In-reply-to: <574817C4-3FD8-43EA-B53C-B2BCB60A6D0A@gmail.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2GBR01FT032:EE_|CWLP265MB6705:EE_ X-MS-Office365-Filtering-Correlation-Id: d9d0e844-a857-4d84-77d4-08db17ddbd95 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0M3TY9JIcRNM1fR/3ZKA0sgUjgjnoP9wa62LYfeK8PuPNH08xhApU3MhG3khm1U4roWinP4R9Hae0xL++YTfgAYaFDedFugFTxbtJTBiRM66V35lLXZs4dZI4gmCg5Z11C4XrYAVlZzf5Ff4dO+P8OEnh1Um/9pMxApooa1FrIkslhVmssTpGCV4fVYtQKCwslGhtM9zKQAoLmJGk8WfwHo8/bdk3BU+O5j5DusIXa11+nvMAoynmFjrAwe7Wmhao4DIPjo4XZd30brNXnnN6cSmHLoTmXFjyDw/Wb0vwdexcOv0SXSCw7G/1nfJS22h9O+SIQgsVizfQ/FeoJKzNQBLp6kNtmJQn75UpuBc5lFDSSPmX4pNwPRhGT6l+f5mz5j1hsqjF143bMGWZK9qA56VrwIyfWAU4BtYenGp7fO+qwSBk9x0Xi4aMzhSNTmIhMXSRPAZkIX0VqeGAkau8hdGUJrliA3YZ6pknH5aF4DFb8FNGrb4im7GxjgXgNdPzIlqPNOOWXJm9IzsmkYpP92XB1bC2n4Gunvlh3ywJS5tqOhqv//Ub7EEfC+MBl3t+zaFivqlRIx5LvUv/N300uMyVKExIki+lTgj6zA792oguBqK9QbetIccSr+SqXMiRPTHlf2KGQMVHCP1DYCvIm3+1+lZ/gFdsv7Y0lLc6idOsqP93g1p0kpxpL/26MDfMx/tvuGWr8jWv8Qy3SbLe4ysguxY9Amd1cwnkiKMMk0Amg7fgEbVMjKgwIB+S xXV X-Forefront-Antispam-Report: CIP:178.79.136.144; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:semantical.co.uk; PTR:semantical.co.uk; CAT:NONE; SFS:(13230025)(136003)(376002)(396003)(39830400003)(346002)(451199018)(46966006)(36840700001)(6266002)(186003)(7596003)(7636003)(83380400001)(356005)(6862004)(8936002)(8676002)(70586007)(4326008)(41300700001)(70206006)(2906002)(5660300002)(36860700001)(336012)(36916002)(40480700001)(478600001)(47076005)(26005)(107886003)(2616005)(42186006)(316002)(36756003)(82310400005)(54906003)(86362001)(38230200001)(14776008)(79816003); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2023 09:42:13.8563 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9d0e844-a857-4d84-77d4-08db17ddbd95 X-MS-Exchange-CrossTenant-Id: a4e27e3d-bab0-45e8-8942-e64cf9fbd34f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a4e27e3d-bab0-45e8-8942-e64cf9fbd34f; Ip=[178.79.136.144]; Helo=[semantical.co.uk] X-MS-Exchange-CrossTenant-AuthSource: LO2GBR01FT032.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB6705 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256778 Archived-At: Yuan Fu writes: >> GC has historically never called xmalloc, so the profiler will >> likely >> crash upon growing the mark stack as well. I guess another >> important >> question is why ts_delete_parser is calling xmalloc. >> > >> As you see, when we call ts_tree_delete, it calls >> ts_subtree_release, >> which in turn calls malloc (redirected into our xmalloc). Is this >> expected? Can you look in the tree-sitter sources and verify that >> this is OK? > > I had a look, and it seems legit. In tree-sitter, a TSTree (or more > precisely, a Subtree) is just some inlined data plus a refcounted > pointer to the complete data. This way multiple trees share common > subtrees/nodes. Eg, when incrementally parsing, you pass in an old > tree and get a new tree, these two trees will share the unchanged part > of the tree. Would that mean we could possibly preserve node instances -- either the real TS ones, or an Emacs-created facsimile -- between incremental parsing? That would be useful for refactoring.