delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/07/29/19:13:46

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53D623851C2E
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1596064379;
bh=rtoIUAfs2zsP0Qw+A/XcpAi6fw5Pt8etxioTm7wRJg4=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=voGXXdZm1ozzS3Ml9ROyHc/9g2unVkEdlo9yjVXn6G+guktfs+XzaAYopGaVyYPyA
C9pshz3H4PSyEzBkNv35Q6HqVmNGl5Ta9Fub5BWb6v9gL3eX0fEUCAbUjnVBaSBH5I
iD8NVYnIhrXvOZaSDMCzJRF28GWMbJkFGZAlIprA=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0B323858D35
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=LF+xPfFUG+E7dSrdCXSegM8keV1/ntnPIiOEXlrqnShub5Sj8FCAt9XSRqcbFIA7lzu7HnyJHbLpZmXxx2Pwrl+++/AOoLFbDgDOONI2JD+W6zLCbcyQ/4jZAzIkLXd6XHc0AC2nHZsmoAG42rMFZRDNHllHf66PjiIA08Gcnc/Qo9GCiL5rOnBjvV/pUWT0e0IZN6Q3gMZAYWJVDdjXBFlqEYO728a07cDk965CS1niVLk5UGhzmYGAh4iAkpv3DBeBIoqqsVZsoeIBQUm3M0NxtmF0HiT0ZKAcFauqlUgfe3FlxQ2gZ944jCiMU0kvU4svVyk8602Bfxna7VuB7A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=tykqZfWGWPWJLyQrUaIYCq1tQVmDbXWgeOMI1oJoR2A=;
b=iEFzYg6eVnEZWNjpEx2V0r3vGsYeYEd+9SVuBRUNU5RNz3hVmmTUpnS08WxYyscVOLbicYazZ8tiZrGm37hS/lRCf9RqSQFveDT4gDdEdi6CF/EaQiRqoadXIjQXyVIbs+4LOEMinEWR0W9vxqCAVTGKQPHfWArss/PcWB7JsbYAbW/Fgx8k7GzTGe6Psx/LoQZe7u5rhBOxfL8p19324Lx4FwImmYXw836arXB0Y7M8ytwWi/YQeEzsJWlhTbnkIv7T4AQJpBU6qXU2jq3nUB9ClGed16eSzfKjqBrr+r1Ahzs7087XSqJBcFkN+04sduldzh1fgYO0MlVf/t0Nsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
Subject: Re: Synchronization problem with posix_spawn
To: cygwin AT cygwin DOT com
References: <b1992e8b-d2e8-9c44-8f93-a270d5a879ed AT cornell DOT edu>
Message-ID: <864b3031-9fc8-beb3-ba7c-1ade4c31a288@cornell.edu>
Date: Wed, 29 Jul 2020 19:12:50 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
In-Reply-To: <b1992e8b-d2e8-9c44-8f93-a270d5a879ed@cornell.edu>
X-ClientProxiedBy: MN2PR05CA0011.namprd05.prod.outlook.com
(2603:10b6:208:c0::24) To BN8PR04MB6163.namprd04.prod.outlook.com
(2603:10b6:408:5c::27)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-Originating-IP: [68.175.129.7]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 94b88613-eb7c-4412-774c-08d83414eafa
X-MS-TrafficTypeDiagnostic: BN8PR04MB6355:
X-Microsoft-Antispam-PRVS: <BN8PR04MB6355EA100905A04F12F3718BD8700 AT BN8PR04MB6355 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:4303;
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: DTH05Srbpu6IGRZh5+TP+FzGfKtUc+HfqpjtnPI7MGiEZZm/qagb8sGRim1KtAbXTRuJPczYtLjA9gWfRuKwSY9U7D/4FAkR0CQKy2NzK3DT/3O3RTl40kBBOXFUz7Zz1FDpsQN6kJEDGIvPdzLAdhMo4ncLlOaTMdDHrQJQ2PDDan6n2WSflxY2SKuEsVB3NcjFOmdVKW0HliYt3janPZY9NeFFKbFy5lnuJLj7+8v2wkCdFDWmOxQrlMTnOl/lpzy4kgo1P5y2ARY5O4O6A8n7Vf/LDZuhhhPORbjeVIV/eC3HLmW/tDUDr4d8KwNKJ2Rhsnp90novUy3UhPZ6EJYP1ib9SUEa0G56LqNmsQlu4DTs0cv0D98fQPl41Ii5
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN8PR04MB6163.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFTY:;
SFS:(4636009)(376002)(39860400002)(136003)(346002)(396003)(366004)(66946007)(2906002)(26005)(66476007)(66556008)(36756003)(6916009)(316002)(956004)(16576012)(8936002)(786003)(2616005)(478600001)(6486002)(186003)(16526019)(75432002)(53546011)(8676002)(4326008)(31686004)(86362001)(52116002)(5660300002)(31696002)(43740500002);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData: Jo7lObvKhXvrb51CNP9OYZCmCLYbRCmWWgNvbDgc0PfqXyI5CNgr4qbIfGMiub8KPpn3afkpNLY1BxqPICSDdSJTBCuYoYR3t4FkRz1eEije9WgzWDi28IBaLmgelABt61rkz5cNcEI08wllreEd2HWNJzCkqjtNGuwaW+G0TTQa2fuDeCCOEdpq5aoGhbXB9OXwQDwaoJfM70mUPJqCuI9fJhSv7HvTLJPNWktwwZmFmYi41Ps3vgPb2oOTTbBEWZce6vaqMQTs9mXF/EX1JXHl9gypy2S7Z1ETM6UXfIzSMAPPQc6fwD1CSom8nZGnxc3G6rom5Kwb578eFUX7D4P6b2IrxgmrI4AGfOMEufpI2/GHEoqCjuvOGuXDaHhI78lsWV9EOVWl9jQ4vZZWqB59QuGy330hxXCWdlI4BAUywoZfWCN5l5/aPyNwVTtqTXlXcICDGSqiVaQOr5BC7UzlqhNgdpvzawbzEIBcN74=
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 94b88613-eb7c-4412-774c-08d83414eafa
X-MS-Exchange-CrossTenant-AuthSource: BN8PR04MB6163.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2020 23:12:52.1387 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 36oc7/wq04x0Q98zWRXcAV0s58ePW0OWxvNVwl+7A1RX9zo5zfZgOekFwzJsWXDV8nSj3Yybd4T+UNOjYUO9zw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR04MB6355
X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_INVALID,
DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 06TNDSF2002359

On 7/29/2020 4:17 PM, Ken Brown via Cygwin wrote:
> posix_spawn(p) returns before the spawned process is fully up and running.  As a 
> result, the spawned process can fail to receive signals.  The attached test case 
> illustrates the problem.  It spawns a sleep process and then tries to kill it. 
> On exit, the sleep process is still running.
> 
> The following excerpts from the strace output show the issue: The SIGTERM signal 
> is sent after the main program has forked a subprocess (and posix_spawnp has 
> returned), but before the forked subprocess has exec'd the sleep process:
> 
>    559   32069 [main] spawn_test 4125 vfork: stub called
>    257   48437 [main] spawn_test 4125 dofork: 4126 = fork()
>    754    9511 [main] spawn_test 4126 dofork: 0 = fork()
>     66   48503 [main] spawn_test 4125 kill0: kill (4126, 15)
>     44    9555 [main] spawn_test 4126 find_exec: find_exec (/usr/bin/sleep)
>     42   10835 [main] spawn_test 4126 spawnve: spawnve (/usr/bin/sleep, sleep, 
> 0x8000281A0)
>     45    3149 [main] sleep 4126 child_info::ready: signalled 0x164 that I was 
> ready
>   6475   21055 [main] spawn_test 4126! child_info::sync: pid 45028, WFMO 
> returned 0, exit_code 0x103, res 1
> --- Process 45028 (pid: 4126) thread 41444 created

I just took a look at the source, and I see that posix_spawn was taken from 
FreeBSD.  Does FreeBSD have the same problem?  Should applications just be aware 
of this issue and insert a sleep after posix_spawn before sending signals?

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

- Raw text -


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