X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT sourceware DOT org Delivered-To: cygwin AT sourceware DOT org DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FA3D3858029 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aWV3woiE14Id/yDC+g2jp5LfXVAXn0q9JvCW8f184zdnJzoUrN8pbtpuJw13bv2NblQHNkD7D8lxSmyCRQeIkJdHrVpc5wsHtQJ2OVl+dXEnjimxFSxxSQWfJ5iLhyUEsLkvMddReaoYgEdpM5FyA2g2e7W8MTtVF45e8cWz0g73Yt1U5DVydVK76I9RMsfnUgEoNSz4eqaQxrUUxqqipwFrRnGqydB5TEvJnUrxwoh30jVvLGXcoNjw3fYcq2yUpk8FVjmnkZo27NxR8AcexQN7152FmHcdWOn4yj2avFduEnlEDmVWU/gSw8gUphekwe7goXsbL8CV20yZBB+fyA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QUIw1P2ZMxpa11e5zJws9nELoWuDntX66PdC3QrsK10=; b=Ak542fZc7QJzbAF5GRokIym5khpNu2OweWBnbEhIcd8TF09ZxK2no9QkMzyetshaM/IXWD543Z6qQmajxMMlekzZ8Egw83uzmIotwa3bYCXgYR22woZivIX3oTfHiMAP3+TKoDoE2kLyfwqJjTsAI5cu5Am659GLysgqPzSSW9KfQRDtf69f/elR/4vWHozIBRl1XBPyB3JaYsNycS37GPegqc41tqArTEWwZjhgzaKS08lTZJxSfNTl+QuMOVRZIfgsyyM3JlxtA0UNt2cPSboRsNUa4UydvQAS/Cw6M88k5btIcjY6quE8nTlnWyznJEfdWJwQi9u4CC6jEtemVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QUIw1P2ZMxpa11e5zJws9nELoWuDntX66PdC3QrsK10=; b=dhrcqFVJiNo0nkPaJ+XBYYw7hl/H4tAG+feS7UgSyBnw2Pa5Y5NWLAlwklJmMeHjVgHZ6BKpKMv+NjuGVBgCbNBHXk0wbTl0H0FR8BsDGLMUlYc3YIHq6I5uBWAcafDYPWGpBkMPNO/gFJpVhTrCdkI5fM+CytA9Matr1nhMVa2d8/Q/zXf5w4nnxzCJPaelNhvkF74JchEzsvAtQNFlkX3OCNuHDmYTAbJbHu4hciN9ScObd3KQRR2DA8SZklDeqj36i/uWQZy3NaUZQ/y5vSQtcZIs8TBj2QucALb7mp0XwElt4EqDOu7sbx6hUjWhgn4pQgTU95wAwS02CLULPQ== From: Jay K To: "cygwin AT sourceware DOT org" Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 Thread-Topic: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 Thread-Index: AQHYB2nj9o7DO18hu0uLIYEA7DQjfKxe43cYgAAINy4= Date: Wed, 12 Jan 2022 06:27:47 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 175dfefa-3021-4c4c-32b3-7de5f29a40dc x-tmn: [Vyti7OlMmY7TU00MfuNmTDy790zR2qGMBnNYaH2K/ZtjeaagCtK/uZUX132RMO89] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 56771039-3ca0-4809-0b16-08d9d594a669 x-ms-traffictypediagnostic: MW4PR14MB4603:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2FWjwxVhmx8f1gOdup7rrmC7bVO/pnWjDXpqMAazD+3/H8J4Vk9piay0VXDYoJ7hM/JCvdrZBrGHtVlUiP36Fab9FrpDoXovo2eCTPomcvKKWW1zUw/mc9XxPasNUQtq034TBQwly4L6qiBQPylX6Px5x/OPfHryZg+eTQAZzPlLMc3sL0uj1zJIQzqrUxoNAFZO5XtY/DeSiLw3Fc21Hm556Luc15eIOEnTZnqC2+K7o/3nNoqGRKKSoUbdvs+JiSL03rJQ6Awb+It47lN6GIcremO5p5bcWBC1vLjA11vxp6FCKq8wnkpEAYCNbU3PO9CntGasyMtYlj3KRvtp374SJmgHZRbtqZxrmbevHnBxK+lL69+QJMH9B89reS7Iq/Ydnt3zlaSeVWSsE5Ta6j3PkKkrm8QojQtcGz+NXmKl9LZMsUd5EoQCbnrZoqDProOiUoI+yLJR2GazjBqxHeIc8hXHhd6HliHVDPx3i3llyGxwXAtBJmk0Y3Lh113msu6LNWl5wTqH9yCxu8Tq8sEKpZhlNgpHtXKVPC+kbsmTUCoqwKy7EwbqvIK0wjMpVO4DIfpHk+Uer1JuaYSP5Q== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?0gpD94pC4FJLzuZQqWbjFldz3NRgzRvX73J7uVHl0QIfMQebaWr+893bVP?= =?iso-8859-1?Q?7WlE1uzWGOkj/12kr3HVNmIgzxilkdwybQuA3PRpJTzzDXRCvbrP2JcYaJ?= =?iso-8859-1?Q?SqZRszOnK5iBKITCyj1O8c/cj4K7hNryScGgWCbX+n2t53tG190C/T+tQL?= =?iso-8859-1?Q?PdhRcP+qVCSmBxxBJ1jUGVxRmw6MaiB9ipxpIVc87idsBWaYVlU66FjcLT?= =?iso-8859-1?Q?qbP7fUI6wapGCgdc3EwvHewdkUuJ/HQp96EV2MbYVa4+jVxcw9SLR/dmKz?= =?iso-8859-1?Q?sAoXhet8Hpq4E0KV9A8uG8VATgXeg8GLgn2jCY3lzfp4w3j/vLBzYBAhcr?= =?iso-8859-1?Q?vhOzm7nGaSKRfjeJ0DlwoSCvu2ScJks1ezFO4sVwHKfw5T7rCU64SmtKms?= =?iso-8859-1?Q?TcdAT9NR3p5HaRO8WhCEb0c7oYtOXEl/ywvoe+J0bUJka9HpzcpcFvJeHE?= =?iso-8859-1?Q?zQuXyCL3BONwDUUiDTsWNhV4lmOf4VAQH/JHsaKuOFNqSHMgEbaF+HpKcC?= =?iso-8859-1?Q?RWndKhMvirXW6gAMcPGB7YFRaGAbUa70X1JLGXi4gtc9FWw4WaxYcK4dBh?= =?iso-8859-1?Q?AmTBvfQSviKJCfyfmuUY8Aesy3rxPcM5kP7AL8goxRbGTsu3g72VphI2JH?= =?iso-8859-1?Q?T/4Yomy+vHDaIKqpVHgnTJFG58nx9hm2DplSFYF79u8elfRmW1aJEIqbHP?= =?iso-8859-1?Q?GWxCD4QNTVphpkJm3jL6M1c9BS/uhTP7ZD1l2PGjq6MSK+mJWkUUbAv4Sy?= =?iso-8859-1?Q?VGBMUZcVmBk4qG3H333a2pYVAwA1n1Z9nee615khg9GVd3gcQBMdRBAJn0?= =?iso-8859-1?Q?TVOzgpockB+AtItQxxP3Ra/D3lmRzb9R2BkVLgI1FmXLlXUWjFHfW3PCi/?= =?iso-8859-1?Q?F//Sbdly2wPsMTZhFIiBkAhmwz4Kf6gshA9azrfAYYNDxTrAd+kwIvnLOi?= =?iso-8859-1?Q?zU5BZhRwmklemTjNtUWWbLGGweUOIEenNFUrNqKxSeJl0Y0+myJOf0E0YY?= =?iso-8859-1?Q?0yWlIcBWZkSGsRmWlzO5fyR3bia2FghUsRAWFF?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-cd57b.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1401MB1951.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 56771039-3ca0-4809-0b16-08d9d594a669 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jan 2022 06:27:47.3101 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR14MB4603 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" Ok, here is a small demonstration of the problem. #include #include #include unsigned __stdcall thread(void* p) { unsigned i; for (i = 0; i < 100; ++i) system("./a.exe"); return 0; } int main() { unsigned i; HANDLE threads[100] = {0}; FILE* f = fopen("a.c", "w"); fprintf(f, "int main() { return 0; }\n"); fclose(f); system("g++ a.c"); for (i = 0; i < 100; ++i) threads[i] = CreateThread(0, 0, thread, 0,0,0); for (i = 0; i < 100; ++i) WaitForSingleObject(threads[i], -1); } $ ./1.exe 0 [main] sh 9287 C:\cygwin64\bin\sh.exe: *** fatal error - internal error reading the windows environment - too many environment variables? 3001 [main] sh 9287 cygwin_exception::open_stackdumpfile: Dumping stack trace to sh.exe.stackdump 0 [main] sh 9286 C:\cygwin64\bin\sh.exe: *** fatal error - internal error reading the windows environment - too many environment variables? Stack trace: Frame Function Args 000FFFFCD30 00180061C6E (001802795F0, 00180269E81, 00000000000, 000FFFFBB20) 000FFFFCD30 0018004849A (00000000228, 00800000160, 00000000000, 000FFFFCD30) 000FFFFCD30 001800484D2 (00000000000, 00000000000, 00000000000, 00000000000) 000FFFFCD30 0018005F12D (00180158C19, 00000000000, 00000000000, 000FFFFCD30) 000FFFFCD30 00180103AE4 (00000000000, 00000000000, 00000000000, 00000000000) 000FFFFCD30 00180048BC2 (00000000000, 00000000000, 00000000000, 00000000000) 000FFFFFFF0 00180047746 (00000000000, 00000000000, 00000000000, 00000000000) 000FFFFFFF0 001800477F4 (00000000000, 00000000000, 00000000000, 00000000000) End of stack trace 0 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 1078 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 4452 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 sh: ./a.exe: Bad address 11522 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 sh: ./a.exe: Bad address sh: ./a.exe: Bad address 38623 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 48009 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 48660 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 49909 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 I understand I can workaround this, in that the use of threads is silly. Is this invalid, to mix Win32 threads with cygwin system()? - Jay ________________________________ From: Jay K Sent: Wednesday, January 12, 2022 5:57 AM To: cygwin AT sourceware DOT org Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 Um, I know this isn't (yet) diligent/scientific, but must system create this thread? #0 0x00007ff811e09e47 in KERNEL32!CreateThread () from /cygdrive/c/WINDOWS/System32/KERNEL32.DLL #1 0x00000001800468eb in cygthread::create() () from /usr/bin/cygwin1.dll #2 0x000000018010645f in pinfo::wait() () from /usr/bin/cygwin1.dll #3 0x000000018012e562 in proc_subproc(unsigned int, unsigned long) () from /usr/bin/cygwin1.dll #4 0x0000000180134e85 in child_info_spawn::worker(char const*, char const* const*, char const* const*, int, int, int) () from /usr/bin/cygwin1.dll #5 0x0000000180136729 in spawnve () from /usr/bin/cygwin1.dll #6 0x0000000180136d05 in spawnvp () from /usr/bin/cygwin1.dll #7 0x0000000180144683 in system () from /usr/bin/cygwin1.dll #8 0x000000018018effb in _sigfe () from /usr/bin/cygwin1.dll #9 0x000000010052884b in QMachine__ExecCommand (t_L_563=0x448ef0 "\260\324\005", 'cause i.e. it complicates any lifetime/management. I do understand some of the problems here, like needing separate threads to read stdout/stderr, if they are not equal. - Jay ________________________________ From: Jay K Sent: Wednesday, January 12, 2022 4:12 AM To: cygwin AT sourceware DOT org Subject: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 I get this a lot: 0 [waitproc] cm3 7641 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 452 [waitproc] cm3 7641 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 716 [waitproc] cm3 7641 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 1652 [waitproc] cm3 7641 proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 0 [main] sh 7775 C:\cygwin64\bin\sh.exe: *** fatal error - internal error reading the windows environment - too many environment variables? Scenario is multi-threaded "launching" a bunch of invocations of gcc. "launching" was usually spawnve or fork/execve but I changed the code to use system and it still happens. I might try to make a small reproducing, if this is not known. It seems a bit difficult to believe I could cause this internal looking error. Thank you, - Jay -- 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