public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Nicholas_Karagas@cirilium.com
To: Jim Ingham <jingham@apple.com>
Cc: insight@sourceware.cygnus.com
Subject: Re: segmentation fault on exit in Insight 5.0
Date: Wed, 28 Jun 2000 15:17:00 -0000	[thread overview]
Message-ID: <OFF0A62CFB.ED3F9001-ON0725690C.00785413@cirilium.com> (raw)

>OTOH, I am made nervous by the statement "Note that the line numbers for
>remote.c may not match yours exactly, as I have some stuff specific to our
>particular setup in there."  Given that the crash is down below
remote_kill,
>Nicholas really needs to try this with the vanilla version of Insight if
he
>can, and see if he gets the crash there.  I haven't heard any reports of
>Insight crashing like this on some other systems, so with no disrespect to
>Nicholas, we really need to remove his code from the loop first, before we
>can help with the problem further...
>
>Jim

The remote.c stuff is just sending a couple of extra characters to the
target, no big deal.  I've actually tracked down and solved the problem,
though.  What I don't really understand is why am I the only one seeing
this?  Does everyone else just use the close box :)  The problem is this:
When you select 'Exit' from the file menu, it runs (after some other stuff)
gdb_force_quit, which runs quit_force from top.c.  One of the last things
that quit_force does, through some function or other, is to delete all of
the remaining windows.  Now, there is some code in managedwin.ith that
says, 'when you delete the last window, call gdb_force_quit'.  Oops!  I
don't know if this little bit of recursion is intentional, but it causes a
SIGSEGV because it causes gdb to try to close the remote target again,
after the scb (serial control block?) has already been deallocated by the
previous quit_force.  To solve, I changed the following (sorry, I don't
know how to use CVS so I can't give you the changes in a nicer format):  I
changed quit_if_last in managedwin.ith to return 0 instead of 1, so that it
no longer calls gdb_force_quit whan the last window is deleted.  This
unfortunately breaks closing the program with the close box, so I had to
make the following changes to _exit in srcwin.itb:

body SrcWin::_exit {} {
    debug
    if {[llength [ManagedWin::find SrcWin]] == 1} {
      gdbtk_quit
    } else {
      after idle [delete object $this]
    }
  }

This way, quit_force does not ever have to be called from the destructor of
the last window, which (IMHO) provides more consistant behavior.  Let me
know if you think these are good changes, or if you have a better fix.

Nicholas Karagas
Associate Software Engineer
Cirilium Corporation
Tempe, AZ
(480) 317-1144

             reply	other threads:[~2000-06-28 15:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-28 15:17 Nicholas_Karagas [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-06-28 13:12 Nicholas_Karagas
2000-06-27 10:22 Nicholas_Karagas
2000-06-28 12:54 ` Chris Faylor
2000-06-28 14:27   ` Jim Ingham
2000-06-28 14:36     ` Chris Faylor
2000-06-28 14:38       ` Chris Faylor

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=OFF0A62CFB.ED3F9001-ON0725690C.00785413@cirilium.com \
    --to=nicholas_karagas@cirilium.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=jingham@apple.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).