all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Powell <stephen_powell@optusnet.com.au>
Cc: 12829@debbugs.gnu.org
Subject: bug#12829: 24.3.50; emacs_abort () called from w32proc.c:1128
Date: Fri, 09 Nov 2012 21:38:08 +0200	[thread overview]
Message-ID: <83wqxuy3bz.fsf@gnu.org> (raw)
In-Reply-To: <509D529F.9090106@optusnet.com.au>

> Date: Fri, 09 Nov 2012 18:59:43 +0000
> From: Stephen Powell <stephen_powell@optusnet.com.au>
> 
> > Did this problem happen again since the original report?  If it does
> > happen from time to time, I might ask you to run Emacs under GDB
> > with a couple of breakpoints in strategic places, because usually
> > when dead_child's handle is NULL, it is too late: the evidence of
> > the crime is already forgotten.
> 
> Sure. It happens frequently but not always.

OK.  There;s only 1 place where the handle of the process is set to
NULL.  Here:

  static void
  reap_subprocess (child_process *cp)
  {
    if (cp->procinfo.hProcess)
      {
	/* Reap the process */
  #ifdef FULL_DEBUG
	/* Process should have already died before we are called.  */
	if (WaitForSingleObject (cp->procinfo.hProcess, 0) != WAIT_OBJECT_0)
	  DebPrint (("reap_subprocess: child fpr fd %d has not died yet!", cp->fd));
  #endif
	CloseHandle (cp->procinfo.hProcess);   <<<<<<<<<<<<<<<<<<<<<<<
	cp->procinfo.hProcess = NULL;

(One other place is when the process is launched, but I don't think
this is our case.)

So please put a breakpoint on this line, like this:

  (gdb) break w32proc.c:1096
  (gdb) commands
  > bt 6
  > p cp->pid
  > continue
  > end

In addition, please put a breakpoint here:

  static bool
  process_status_retrieved (pid_t desired, pid_t have, int *status)
  {
    if (have < 0)
      {
	/* Invoke waitpid only with a known process ID; do not invoke
	   waitpid with a nonpositive argument.  Otherwise, Emacs might
	   reap an unwanted process by mistake.  For example, invoking
	   waitpid (-1, ...) can mess up glib by reaping glib's subprocesses,
	   so that another thread running glib won't find them.  */
	do
	  have = waitpid (desired, status, WNOHANG | WUNTRACED);
	while (have < 0 && errno == EINTR);
      }

    return have == desired;  <<<<<<<<<<<<<<<<<<<<<<<<<<
  }

Like this:

  (gdb) process.c:6278 if have != desired
  (gdb) commands
  > p have
  > p desired
  > p status
  > continue
  > end

Then run Emacs as you normally would, and tell if these breakpoints
ever break, and if so, what do you see there.  The breakpoint commands
arrange for GDB to continue Emacs after it reports the values as
specified in the breakpoint commands.

Thanks.

> > If that GDB session is still active, can you show the entire list in
> > deleted_pid_list?  The 'pp' command should be able to display it in
> > a human-readable format.
> 
> (gdb) pp deleted_pid_list
> (5144 5412)

Interesting.  I need to think...





  reply	other threads:[~2012-11-09 19:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 23:47 bug#12829: 24.3.50; emacs_abort () called from w32proc.c:1128 Stephen Powell
2012-11-08  3:46 ` Eli Zaretskii
2012-11-08 15:48 ` Stephen Powell
2012-11-09  9:41   ` Eli Zaretskii
2012-11-09 18:59 ` Stephen Powell
2012-11-09 19:38   ` Eli Zaretskii [this message]
2012-11-09 20:16     ` Stephen Powell
2012-11-10  8:27       ` Eli Zaretskii
2012-11-10 14:56         ` Eli Zaretskii
2012-11-10 21:44         ` Paul Eggert
2012-11-11  3:50           ` Eli Zaretskii
2012-11-10 15:45 ` Stephen Powell
2012-11-10 16:09   ` Eli Zaretskii
2012-11-10 18:03 ` Stephen Powell
2012-11-10 18:34   ` Eli Zaretskii
2012-11-17  7:09   ` Eli Zaretskii
2012-11-17 15:35     ` Paul Eggert
2012-11-17 15:40       ` Eli Zaretskii
2012-11-17 16:50         ` Eli Zaretskii
2012-11-17 15:32 ` Stephen Powell

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=83wqxuy3bz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12829@debbugs.gnu.org \
    --cc=stephen_powell@optusnet.com.au \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.