From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 10:16:25 -0500 Message-ID: References: <9FCDA5B7-D216-45B1-8051-35B05633BEFB@gmail.com> <83sfeukwsb.fsf@gnu.org> <574817C4-3FD8-43EA-B53C-B2BCB60A6D0A@gmail.com> <83mt51j6mv.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27079"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, Yuan Fu , mickey@masteringemacs.org, 60237@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 26 16:17:25 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 1pWImC-0006nO-U9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Feb 2023 16:17:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWIlz-0002hn-MN; Sun, 26 Feb 2023 10:17:12 -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 1pWIlq-0002fo-6U for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 10:17: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 1pWIlp-0000Py-V9 for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 10:17:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWIlp-0002sS-Qa for bug-gnu-emacs@gnu.org; Sun, 26 Feb 2023 10:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Feb 2023 15:17:01 +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.167742460611035 (code B ref 60237); Sun, 26 Feb 2023 15:17:01 +0000 Original-Received: (at 60237) by debbugs.gnu.org; 26 Feb 2023 15:16:46 +0000 Original-Received: from localhost ([127.0.0.1]:44823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWIlZ-0002ru-KO for submit@debbugs.gnu.org; Sun, 26 Feb 2023 10:16:45 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWIlW-0002re-1v for 60237@debbugs.gnu.org; Sun, 26 Feb 2023 10:16:44 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 99722440BCB; Sun, 26 Feb 2023 10:16:36 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 44D4E440BB4; Sun, 26 Feb 2023 10:16:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1677424595; bh=bNHOBM/JYOldGWbwIQeau3eBSayJjMa4PGxHBNiG9m4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OE0u7366LykQJZXS849qQ3Wse63yEPPooIlE8A99ZMyjuX/g9cFrYUlFCTRnfRSWG TETzlaEm0BoEZrzNIkK2fsQ0ZmN/FOrsOeGQ2Wre07Pjr6xbuw9BghwO9nlM9QusRO oBsIyT8ICU1dm+mHH68wWQqi+q0sIW6pMq1+3MV5j5uaMJobNbp/aXOghDzc2AIRcs xWQ6fGspv/pGlKuAmJ/HZdhuMA9jpaQqgYBvGnFphn8bYey7DlfG5d5bBeQ8qeK5Ue 5RzV0hP6tjG0hVniv2TOqhtzxE6AHLwtkNeDltuQeOUR8i2KX3uQHJaqzgFWKSWHCW USx4bfMZv0nWw== Original-Received: from pastel (unknown [216.154.34.24]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 03DE51231DD; Sun, 26 Feb 2023 10:16:34 -0500 (EST) In-Reply-To: <83mt51j6mv.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 26 Feb 2023 08:14:00 +0200") 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:256814 Archived-At: > Stefan, could it be a problem for us if garbage-collecting an object > calls xmalloc? Including if the "memory" profiler is running at the > time of that GC? I can't think of a fundamental reason why this would be a problem, but as you've seen some code may not be quite ready for it. I suspect the simplest solution is to do something like what we do for the cpu-profiler, i.e. handle the "time within GC" specially by checking (EQ (backtrace_top_function (), QAutomatic_GC)) to determine that we're within the GC. We could just not count those xmalloc calls, tho better would be to use generalize `cpu_gc_count` so it's also used for the mem profiler. Stefan PS: While the mem profiler was originally thought as a poor-man option in the absence of timers, I've occasionally found it handy to track down problems where we're spending too much time in the GC.