delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/01/13/11:38:32

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:references:in-reply-to:date
:message-id; q=dns; s=default; b=mYe6XSpzcY85NhTDlMPobuxkd50PQuh
Bw+FzW5tETkR/R1s8AAHCmguq06SlcSbwPAgowUs5sob9GAUwC1aVYugB7FaNf7R
mwJPfVTM8ANRlUMDj8Djxa7pRVM8YhI6RafK20M02qF1NEkxDI1tjCut57cqWDTc
OL0vzTHianhM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:references:in-reply-to:date
:message-id; s=default; bh=p+1Uec9l7iK/K/5OH3j4ZDl1yvk=; b=BaFdJ
7FQ3B5svfKqWSkJhN+UIac3TGYQZBmXMkqvM50cjzc4+LgVJn6RK79Dae7aXuFE2
yO60qjUy0R2DNfszXcfoz56QmnU3SKoxd6nMjh91K7DX4s8b/AeakyPPODfTyzWm
16pryLv0Ch5Kuxw3KMYZKArrDBMo5k73n3yQTc=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2
X-HELO: na3sys009aog116.obsmtp.com
To: cygwin AT cygwin DOT com
From: David Levine <levinedl AT acm DOT org>
Subject: Re: nested popen()'s lead to fgets() failure on 64-bit only
References: <20140113150353 DOT GA24764 AT calimero DOT vinschen DOT de>
In-Reply-To: Your message of Mon, 13 Jan 2014 16:03:53 +0100
Date: Mon, 13 Jan 2014 11:38:03 -0500
Message-ID: <26911-1389631083.771056@cjZC.Jd_Q.fUB6>

Corinna wrote:

> Not really.  I have no idea why this fails for you.  Does an strace
> show anything suspicious?

Yes, there's an exception, it looks like in WFMO.  It's
happens when closing handles after forking sh.exe for the
second popen().  strace excerpt is below.

The exception didn't happen after the first popen().  And I
tried running with a minimal environment (env -i PATH=/usr/bin),
which didn't help.

David


    1       1 [main] sh (426948) **********************************************
   39      40 [main] sh (426948) Program name: C:\cygwin64\bin\sh.exe (windows pid 426948)
   16      56 [main] sh (426948) OS version:   Windows NT-6.1
   15      71 [main] sh (426948) **********************************************
   59     130 [main] sh (426948) sigprocmask: 0 = sigprocmask (0, 0x1802BCC08, 0x0)
   64     194 [main] sh 426948 child_copy: cygheap - hp 0x114 low 0x1802DB410, high 0x1802E2CD8, res 1
   20     214 [main] sh 426948 child_copy: done
   51     265 [main] sh 426948 open_shared: name shared.5, n 5, shared 0x180030000 (wanted 0x180030000), h 0x6C, *m 6
   24     289 [main] sh 426948 user_heap_info::init: heap base 0x600000000, heap top 0x600000000, heap size 0x20000000 (536870912)
   22     311 [main] sh 426948 open_shared: name (null), n 1, shared 0x180020000 (wanted 0x180020000), h 0x60, *m 6
   13     324 [main] sh 426948 user_info::create: opening user shared for '' at 0x180020000
   16     340 [main] sh 426948 user_info::create: user shared version AB1FCCE8
   35     375 [main] sh (426948) open_shared: name cygpid.426948, n 426948, shared 0x180010000 (wanted 0x180010000), h 0x74, *m 6
   21     396 [main] sh 426948 pinfo::thisproc: myself dwProcessId 426948
   19     415 [main] sh 426948 fhandler_pty_slave::fixup_after_fork: /dev/pty0 inherited, usecount 4
   19     434 [main] sh 426948 dtable::fixup_close: closing fd 1 since it is an archetype
   18     452 [main] sh 426948 fhandler_base::close_with_arch: line 1140:  /dev/pty0<0x1802DF208> usecount + -1 = 3
   16     468 [main] sh 426948 fhandler_base::close_with_arch: not closing archetype
   18     486 [main] sh 426948 fhandler_pty_slave::fixup_after_fork: /dev/pty0 inherited, usecount 3
   20     506 [main] sh 426948 fhandler_base::fixup_after_exec: here for '/dev/fd/pipe:[3]'
   16     522 [main] sh 426948 close: close(3)
--- Process 426948, exception c0000005 at 00000001800F21EF
13416 1272862 [main] nested_popen 426736 child_info::sync: pid 426948, WFMO returned 1, exit_code 0xC0000005, res 0
    0 1272862 [waitproc] nested_popen 426736 pinfo::maybe_set_exit_code_from_windows: pid 426948, exit value - old 0x0, windows 0xC0000005, cygwin 0x800000B
   53 1272915 [waitproc] nested_popen 426736 sig_send: sendsig 0x80, pid 426736, signal 20, its_me 1
   22 1272937 [waitproc] nested_popen 426736 sig_send: Not waiting for sigcomplete.  its_me 1 signal 20
   22 1272959 [waitproc] nested_popen 426736 sig_send: returning 0x0 from sending signal 20
   13 1272972 [main] nested_popen 426736 fcntl64: fcntl(1, 2, ...)
   19 1272991 [waitproc] nested_popen 426736 proc_waiter: exiting wait thread for pid 426948
   20 1273011 [sig] nested_popen 426736 sigpacket::process: signal 20 processing
   35 1273046 [sig] nested_popen 426736 init_cygheap::find_tls: sig 20
  -31 1273015 [main] nested_popen 426736 fcntl64: 0 = fcntl(1, 2, 0x0)
   65 1273080 [main] nested_popen 426736 close: close(5)
  -14 1273066 [sig] nested_popen 426736 sigpacket::process: using tls 0x22CE00
   70 1273136 [sig] nested_popen 426736 sigpacket::process: signal 20 default is currently ignore
    1 1273137 [main] nested_popen 426736 fhandler_base::close: closing 'pipe:[5]' handle 0xE0
   17 1273154 [sig] nested_popen 426736 sigpacket::process: returning 1
   32 1273186 [sig] nested_popen 426736 proc_subproc: args: 5, 0
   19 1273205 [sig] nested_popen 426736 proc_subproc: looking for processes to reap, nprocs 2
    2 1273207 [main] nested_popen 426736 close: 0 = close(5)
   16 1273223 [sig] nested_popen 426736 proc_subproc: finished processing terminated/stopped child

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019