From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Debugging M-x gdb Date: Fri, 31 Mar 2023 10:09:39 +0200 Message-ID: <87jzyx5ol8.fsf@ledu-giraud.fr> References: <871qlbfkpw.fsf@ledu-giraud.fr> <83ilen9xs2.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16935"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 31 10:10:21 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pi9pz-0004BX-Up for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Mar 2023 10:10:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pi9pV-0006WP-Oi; Fri, 31 Mar 2023 04:09:49 -0400 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 1pi9pU-0006WE-1r for emacs-devel@gnu.org; Fri, 31 Mar 2023 04:09:48 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pi9pS-0004cP-3S; Fri, 31 Mar 2023 04:09:47 -0400 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=paxgRVWF 7YPadtxcM1h7XEoJop8dgZNhYe4VWo8aREI=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=kNiMPLhB1MLIRNAO5QvWVWCNradjAB hcIHs1vFh1q1kXDJzcmleX+Cb8a9X5qk3D72eTrJKB++JL51JpZhgDBQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=paxgRVWF7YPadtxc M1h7XEoJop8dgZNhYe4VWo8aREI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=DgmA++IszmByI9Rgx2LEO9NGgOBEcfHGTXRS4p IcymWtOdTvXNAbhMbVG2giDdkWwfvyqyiXHG+RleCb2xtYZfVbTd6pSDJ6Wc7KKSmSjINM vOYC6AF7irBmpobsHiCCHSwlDC5bmmqBjMfcilWgJwymmKmNwPZUEUQVRDU5xu63+oz66a h3kQWep7npo+nSbP7V12v9gf5W9auAb3zWXi8VRlcVLknNkMKKozOD7eRrIbkPfW3y1vAJ XYQh5J0uESmCHCrBG+5oDBjb2EceT+bQ2hoFZghNba8FmD5HdzH4iX+pFyV2OOdRV+6FJS tgHFefYltXVW38n1vLh6SFdg== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 706fde6c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 31 Mar 2023 10:09:40 +0200 (CEST) In-Reply-To: <83ilen9xs2.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 26 Mar 2023 21:23:57 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304897 Archived-At: Eli Zaretskii writes: >> Date: Sun, 26 Mar 2023 20:09:31 +0200 >> From: Manuel Giraud via "Emacs development discussions." >> I don't know if I should file a bug report for this so I'm trying here. >> >> Whenever I try to debug Emacs with M-x gdb, I see the following >> behaviour. In the *gud-emacs* buffer, I enter "set args -Q" and then >> "run"... then I exit the debugged Emacs and now the Emacs from where I >> called (gdb) starts taking a full CPU. I had to enter "quit" into the >> *gud-emacs* buffer to stop this (return to normal CPU usage). >> >> I'd really like to debug this issue but don't really where to start. I >> have tried to profile-start/profile-report but I don't get much clue out >> of it. How could I proceed? > > Are you sure it's Emacs that consumes high CPU, and not GDB? what does > 'top' or similar command says about which process consumes CPU? Hi Eli, I finally had time to test this. So yes, it is the emacs process (I looked with M-x proced) that takes up to 95% of one CPU. > If it's indeed Emacs, then when Emacs starts consuming high CPU, > attach GDB to it, then type this: > > (gdb) source /path/to/emacs/src/.gdbinit > (gdb) thread apply all bt I've tried this recipe (all Emacs with -Q) but "thread apply all bt" does not produce any output. > and post everything this produces with a bug report sent via > report-emacs-bug. > > Thanks. > > P.S. In which Emacs version does that happen, and with which version > of GDB? I've just tested it with a the main branch head for Emacs and GDB is version 9.2. Thanks. -- Manuel Giraud