all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Richard Copley <rcopley@gmail.com>, 19868@debbugs.gnu.org
Subject: bug#19868: #19868 25.0.50; Compilation eats buffers
Date: Tue, 16 Aug 2016 17:17:20 -0400	[thread overview]
Message-ID: <CAM-tV-8fhbP29wT1tWkedXce4av4qDWQjHCMUbOXQ_bDS7yrvQ@mail.gmail.com> (raw)
In-Reply-To: <83h9akg5lj.fsf@gnu.org>

On Tue, Aug 16, 2016 at 10:18 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> I put fprintf+fflush before close_process_fd and around _close:
>>
>> close_process_fd(-1[i = 0])
>> close_process_fd(4[i = 1])
>> going to _close(4)...done _close(4)
>> close_process_fd(5[i = 2])
>> going to _close(5)... // here Emacs hangs until I kill bug.exe
>
> Can you tell what descriptor 5 is open on?  Is it for input, for
> output, for something else?

I found this enum which indicates that i=2 would be READ_FROM_SUBPROCESS.
/* Indexes of file descriptors in open_fds.  */
enum
  {
    /* The pipe from Emacs to its subprocess.  */
    SUBPROCESS_STDIN,
    WRITE_TO_SUBPROCESS,

    /* The main pipe from the subprocess to Emacs.  */
    READ_FROM_SUBPROCESS,
    SUBPROCESS_STDOUT,

I confirmed with printfs that open_fd[2] is set to 5 by the
emacs_pipe() calls in create_process (I also double checked with gdb
that nobody else sets it in between).

I printed all open_fd values from deactivate_process, just before the
closing loop, I got

deactivate_process()open_fd[0] = -1, open_fd[1] = 4, open_fd[2] = 5,
open_fd[3] = -1, open_fd[4] = -1, open_fd[5] = -1,

So, only WRITE_TO_SUBPROCESS and READ_FROM_SUBPROCESS are open. When
compiling bug.c without -mwindows, all open_fd values are -1 at that
spot.

>
> Also, is "until I kill bug.exe" accurate?  That program just waits for
> 5 seconds, so after that it should exit by itself.  Are you saying it
> doesn't unless killed by external means?

Ah, sorry, I upped the waiting time to 5 minutes, because 5 seconds
seemed a bit short for debugging. So I should have said "until bug.exe
terminates" (either by itself, or because I told it to).

Another observation: if I close Emacs while it's running bug.exe,
Emacs closes successfully, but leaves bug.exe running (even though I
answer yes at the prompt to kill it).





  reply	other threads:[~2016-08-16 21:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14 19:30 bug#19868: 25.0.50; Compilation eats buffers Richard Copley
2015-02-15 17:53 ` Eli Zaretskii
2015-02-17  0:25   ` Richard Copley
2016-08-12 20:47 ` bug#19868: #19868 " Noam Postavsky
2016-08-13  6:44   ` Eli Zaretskii
2016-08-15 22:19     ` Noam Postavsky
2016-08-16 14:18       ` Eli Zaretskii
2016-08-16 21:17         ` Noam Postavsky [this message]
2016-08-17 15:15           ` Eli Zaretskii
2016-08-29 21:48             ` Noam Postavsky

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=CAM-tV-8fhbP29wT1tWkedXce4av4qDWQjHCMUbOXQ_bDS7yrvQ@mail.gmail.com \
    --to=npostavs@users.sourceforge.net \
    --cc=19868@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rcopley@gmail.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.
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.