public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@specifix.com>
To: Stephen Berman <Stephen.Berman@gmx.net>
Cc: gdb@sources.redhat.com
Subject: Re: GDB cannot access memory after Emacs abort
Date: Tue, 13 Nov 2007 23:14:00 -0000	[thread overview]
Message-ID: <1194995136.12695.31.camel@localhost.localdomain> (raw)
In-Reply-To: <87hcjpdble.fsf@escher.local.home>

On Tue, 2007-11-13 at 23:28 +0100, Stephen Berman wrote:
> On Mon, 12 Nov 2007 09:46:43 -0800 Jim Blandy <jimb@codesourcery.com> wrote:
> 
> > Stephen Berman <Stephen.Berman at gmx.net> writes:
> >> On Sun, 11 Nov 2007 14:22:37 -0500 Daniel Jacobowitz <drow@false.org> 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.
> 
> Note, however, that this only happens when running emacs under gdb; if I
> start emacs directly from the shell, induce the abort, then the Emacs
> window vanishes, but the desktop remains responsive and no other
> problems are apparent.

Well that's understandable.  emacs has grabbed the focus, presumably
something you are only supposed to do for a brief interval.  If emacs
aborts, it will let go of the focus when it dies, but if gdb stops it
from dying, it can't let go of the focus.

This would happen with any resource that a debugged program 
had a lock on.  You can create deadlocks when you debug things
that have locks on resources.

That's a fact of life.

> > Am I correct in understanding that:
> > - your X session locks up, and all your windows are unresponsive, not
> >   just GDB's and Emacs
> 
> Yes, all open X apps are unresponsive to keyboard or mouse input, but
> the apps continue to operate normally, e.g., the newsticker scrolls, the
> displays in gkrellm (time, CPU activity, free memory, etc.) continue to
> be updated.

I would prefer if we could set this issue aside.
I don't believe it is a gdb issue.  The backtrace
issue is what we should discuss.


> 
> > - you kill Emacs via some other means, which unfreezes your X session
> 
> Yes, by switching to a virtual tty.
> 
> > - now you can interact with GDB again, but GDB can't get the backtrace.
> 
> Yes.
> 
> > 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.
> 
> So again the (or a) question is, why does this only happen when running
> emacs under gdb?

If by "this" you mean the backtrace failure, at this point 
I don't feel we have enough information to answer.  But I 
have not yet read your three other emails.   ;-)



  reply	other threads:[~2007-11-13 23:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r6j6rvn3.fsf@escher.local.home>
2007-11-10 23:50 ` Stephen Berman
2007-11-11  6:46   ` Michael Snyder
2007-11-11  7:44     ` Eli Zaretskii
2007-11-11 23:05       ` Stephen Berman
2007-11-12  4:18         ` Eli Zaretskii
2007-11-12  5:24         ` Michael Snyder
2007-11-13 22:40           ` Stephen Berman
2007-11-13 23:20             ` Michael Snyder
2007-11-13 23:28               ` Dan Nicolaescu
2007-11-14 10:00                 ` Stephen Berman
2007-11-13 23:57             ` Andreas Schwab
2007-11-11 19:22     ` Daniel Jacobowitz
2007-11-11 23:10       ` Stephen Berman
2007-11-12  0:39         ` Daniel Jacobowitz
2007-11-12 17:47         ` Jim Blandy
2007-11-12 19:44           ` Andreas Schwab
2007-11-13 22:36             ` Stephen Berman
2007-11-13 22:34           ` Stephen Berman
2007-11-13 23:14             ` Michael Snyder [this message]
2007-11-14  9:48               ` Stephen Berman
2007-11-13 23:51             ` Andreas Schwab
2007-11-12  7:39       ` Vladimir Prus
2007-11-13 22:36         ` Stephen Berman
2007-11-13 23:24           ` Michael Snyder
2007-11-14  9:50             ` Stephen Berman
2007-11-14 12:00               ` Michael Snyder
2007-11-14 19:24                 ` Stephen Berman
2007-11-15  1:00                   ` Michael Snyder
2007-11-11 23:01     ` Stephen Berman
2007-11-12  5:15       ` Michael Snyder
2007-11-14  9:55         ` Stephen Berman
2007-11-14 12:00           ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194995136.12695.31.camel@localhost.localdomain \
    --to=msnyder@specifix.com \
    --cc=Stephen.Berman@gmx.net \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).