From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32610 invoked by alias); 12 Nov 2007 17:47:24 -0000 Received: (qmail 32566 invoked by uid 22791); 12 Nov 2007 17:47:20 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 12 Nov 2007 17:46:45 +0000 Received: (qmail 25253 invoked from network); 12 Nov 2007 17:46:44 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Nov 2007 17:46:44 -0000 To: Stephen Berman Cc: gdb@sources.redhat.com Subject: Re: GDB cannot access memory after Emacs abort References: <87r6j6rvn3.fsf@escher.local.home> <87hcjtllau.fsf@escher.local.home> <1194763094.16917.278.camel@localhost.localdomain> <20071111192237.GA11728@caradoc.them.org> <87hcjsgzea.fsf@escher.local.home> From: Jim Blandy Date: Mon, 12 Nov 2007 17:47:00 -0000 In-Reply-To: <87hcjsgzea.fsf@escher.local.home> (Stephen Berman's message of "Mon, 12 Nov 2007 00:01:33 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00094.txt.bz2 Stephen Berman writes: > On Sun, 11 Nov 2007 14:22:37 -0500 Daniel Jacobowitz wrote: > >> On Sat, Nov 10, 2007 at 10:38:14PM -0800, Michael Snyder wrote: >>> > > At this point my desktop (I tried in KDE, GNOME and twm, same behavior >>> > > in all) is totally locked up, but I can switch to a virtual tty and >>> > > there kill emacs with SIGKILL (kill -9); SIGTERM (kill -15) does not do >>> > > the job. >>> >>> Making sure that I understand -- you ran emacs under gdb, >>> you set a breakpoint at abort, you hit the breakpoint -- >>> and your desktop is locked up? >>> >>> That seems unusual -- do you have any idea of the cause? >> >> This is pretty common when debugging X programs, IIRC. I believe >> there's some ways in which an application can "own" a display while >> something is in progress. > > That's interesting; do you have any pointers to further information > about this? Yet, as I mentioned in my other followups, this has never > happened to me before when running Emacs under gdb, even when it's in an > infinite loop. It sounds like you, too, don't suspect a bug in GDB that > prevented getting a backtrace. Actually, these are legit X Windows behavior; they're called 'server grabs'. They're supposed to be rare (for obvious reasons), but if Emacs died while it had the server grabbed, you'd certainly not be able to interact with the debugger in another window. Am I correct in understanding that: - your X session locks up, and all your windows are unresponsive, not just GDB's and Emacs - you kill Emacs via some other means, which unfreezes your X session - now you can interact with GDB again, but GDB can't get the backtrace. GDB produces backtraces by reading memory from the process. So if my sequence above is correct, once you have killed the Emacs process in another window, then it's expected that GDB won't be able to get its backtrace.