From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07olkn2024.outbound.protection.outlook.com [40.92.43.24]) by sourceware.org (Postfix) with ESMTPS id 4FFE73858D39 for ; Thu, 13 Jan 2022 06:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FFE73858D39 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=d+ww3ua5HZHBCnDzxRMBvv4rGnbvchtqtbfPy2/CecVAz4tlQenFaDqtwZVyKTBH4rW2Op0y93gKlm/SYOEYPUmx32zsXbx4JfnksC2QSaBbScdF1GtIHpueyD7aNyI3Ark6lI5+Rorv7wl/xQzV3O5e8GfuSiZUbw/I4E7k24r8g+un5Bsc9055Tvwh9pUCqMhGYmkdsxEPMY76TjQKxlIsah0mAKTD0dK6jrV5uTwdrEA3IQt/vGQUNS+1VzGaDC9ngaTiOd4yZ4L6+Vpf0MrHWSKsW8kJn1PQCg3T4yEfWBw/opUELtp08P8bJ9zHh/I679uKA2PGYdt1/Vl6mA== 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=3H2PkDgcwvdBpFYajyScNOqPF9Qge0iVfELMM7el7r8=; b=SPRTfjdr+P/SnDYzvaT83wZDkW2WpnyTAb38KqaQMsCYjmSXONqF/Qv9/BLnLdIGHwrPfnnE2tAXiOmNE3nD9dWXIS785LGucxlbz/2pTiYFjrYrEmgFUF6DNjT8fMpDxE/y3HoJBlqCrkCft73GtxUhX/FfWtXkKP7plQrpis9XwLUaU5zCM0borqRTKNNwb2VIMYNyrpUlgTitAQDCGqBoL3SL0zJHbDIVCZsKCveZbbJMVgGrvE4pzMlk9BWkyRzbHgW56/6ev44+TJNyTf05hcODprlV5NAhOIMymvJMWisFWyvsgbnGGhOyk0meX7PO6HOEsOHQVYZ6bgwjqg== 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=3H2PkDgcwvdBpFYajyScNOqPF9Qge0iVfELMM7el7r8=; b=RB4k7JpO/hEyvMnZVgoHHKmRvK6bmgzzY0qzV7sBw8eV23dVAUSyAZfE6Jp2z/izskerCUs5gasTV43P9Q2V0nrIWbc7iXs2lsdL4oiIp3cvM1zQRt5yi+MMXWJ+pP5J5+zAullrzx+r8ZehM51LIqvgZbomOfyXPZQuO/cHXYBY5eL655B78B23XcsM8EijhAqvq6xgCSFc0x/KNbzE/C9cp1jA3HocaRxVyeP9YZidL0KLRjgGlUkKmBJhX6X3psaiM1FDqM7VQTvxC8fKmXFb8S9AfjQBx+pkcZuj73OyFDpeS3BPW7fp02J+UiAX2RxK1HKVeDPXKT0lxlTL/A== Received: from MWHPR1401MB1951.namprd14.prod.outlook.com (2603:10b6:301:51::14) by CO6PR14MB4353.namprd14.prod.outlook.com (2603:10b6:5:34c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Thu, 13 Jan 2022 06:40:49 +0000 Received: from MWHPR1401MB1951.namprd14.prod.outlook.com ([fe80::8495:3da8:b662:52b5]) by MWHPR1401MB1951.namprd14.prod.outlook.com ([fe80::8495:3da8:b662:52b5%12]) with mapi id 15.20.4867.012; Thu, 13 Jan 2022 06:40:49 +0000 From: Jay K To: "cygwin@sourceware.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: AQHYB2nj9o7DO18hu0uLIYEA7DQjfKxe43cYgAAINy6AAZYSMg== Date: Thu, 13 Jan 2022 06:40:49 +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: 7b753184-4f2d-cc23-d895-63c00d993ecd x-tmn: [zzCtE84PTovX5SVXakDmyM4nTNcE5MaTv96DjRZyrtx14wp6r6hqpz9MxEYtvqQG] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 10465e13-efcc-4872-4177-08d9d65fa2df x-ms-traffictypediagnostic: CO6PR14MB4353:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P4Jeplj8QazPvyqyicpW/kGaKTDdiKq2FxIgpgfRB5OzJUUKSFZDZgwTBjzUUvTMTZln/T9eUH+84nWnfbcsQB76syZl5DPi+SovWKeC4blrSf5oUQUMMx8axUiGVRZWQzt/Smuf8w6zxZqbHMPkU/79fHQKYsqgVbDL579AGjLZym9q+OGXE0JhJapjGDmUDhw8wB8mfW68+izr6OJPQ238zKmng8MDKnObc2vkooUhtUm6ei8cQkcXSY0zLcuLhmhi/XqXGbsPJOtc90CtK1DPo0jm20rpq6zndZScYxdjZySoM96jZh4MzrUFMnzBtTX6z6v47op1vaEMwArbHRSqtCkYkFY5i+mfgouP2/RUfcGm8moQiFxlT+ubZVjI8JCzeBsywtX4C6dBzzDVcZiZbh0DA8sflUSnkI9FRrGeKYDRd/W3e/76CJmJt40/aw+WdvdEpymsCDTs4yckUvYgruAvqJWfnh2kwXX9ZIZ+4lSljHTIYCChbx5t4F1O9Duo+gpjYwWP1dyT1Gc5Th1Xa0jS8vC6ONWSm0jWnTDATUdvSMBjoz2JDlfDWGq3RDitJTCy0cOUGhp5Y+fXpA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?HWjCo8a32rBUPVi+FlZzEbtwq/UXe7+ttbSweInNGAeolVnDNJsAXZEi7/?= =?iso-8859-1?Q?piiWVdE/LcQ2GRTAxmKPA0O8WCibUB7HweBn2DqGEfISClQ6hmJp0Hm5ND?= =?iso-8859-1?Q?33RIbNnDQiJCvKUAz/dY8QFIlPow7MDnomH0bus8CqI4CZo+F8zgRvLYtn?= =?iso-8859-1?Q?QMPSByd8HKtHIE6Fu4TL0VcF8eHulgg5nJSzti66PtVXndavdHs2+j3JwE?= =?iso-8859-1?Q?7843rcm+S9fnvgLcbIPCHaIl8y1c9qnY3w/glebPv3fDpWhPwtgrP7lNFn?= =?iso-8859-1?Q?+Zx+hzY7L9wOrJxKWF5a8OdB4z9aHYXQLch/nxCeCPPWrKDNtPatk8gr/6?= =?iso-8859-1?Q?ht7N7WP0Qw87wUaBHfrFB6W7me/9x2EYhmX9v82ScwIceH/ByLL/7OrOun?= =?iso-8859-1?Q?zSJBe22v1e8JpblWc72BRvJgRnlytTSY6rYIxo7oPXlYRLqSih73y/EHNa?= =?iso-8859-1?Q?KnAKq+Om+CZdh7n4XsMdIthG7rGvhqWps7PfbSBcJCG0CufGeCyyvVc01P?= =?iso-8859-1?Q?DlxKBm6Cx+zSND9yBvnTdkCLwb8OjpOGlxWdmyHjVnaci/YHytC2K4pBPV?= =?iso-8859-1?Q?J2270FQDxdyiQlrQQ3BF9gLGouteH2d5zcBgwWCSGI4IZ2zYOZAh0d3ck4?= =?iso-8859-1?Q?Fw2vi3mJeuJH9eWASXlL8XjnIqk68yeVOGDVPGv+pti5uqZGUhjju8vDVF?= =?iso-8859-1?Q?oMsizhnKg7ALv7RyZqM1Um8v4MYjC6ySYLfYZMrW+siS0ofAowu4D5H7Al?= =?iso-8859-1?Q?f8K1SUd355VpGwO8lhGfay1BmUE2qBoQJ1hvSbs0/9pB5xz6Fi/Wy+Fk3x?= =?iso-8859-1?Q?cNKPboNRPceFeOoBTIZ1K6NeQfxkaRoyxvV9jCf1Z0CrqBKUu3ZQ37qWiw?= =?iso-8859-1?Q?710tVpjtMIW3vMrNhHethY80bj8AF+9F3O+XGme7wU0BCD1ITifBbT7FRi?= =?iso-8859-1?Q?jNNCVh+lE2tdfFQ/kbQazsvVkbVLQB9GKgczDqiO3MLvJcG59Ebzd2ajlP?= =?iso-8859-1?Q?nvmu43LAxs8NfH7RO0SimeScooMoloodijKkkO?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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: 10465e13-efcc-4872-4177-08d9d65fa2df X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2022 06:40:49.1475 (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: CO6PR14MB4353 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, 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-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 06:40:51 -0000 I don't know why I didn't get the reply in email, but this is representativ= e of the real world code.=0A= =0A= =A0- Jay=0A= =0A= =0A= From: Jay K =0A= Sent: Wednesday, January 12, 2022 6:27 AM=0A= To: cygwin@sourceware.org =0A= Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error= 6 =0A= =A0=0A= Ok, here is a small demonstration of the problem.=0A= =0A= #include =0A= #include =0A= #include =0A= =0A= unsigned __stdcall thread(void* p)=0A= {=0A= =A0 unsigned i;=0A= =A0 for (i =3D 0; i < 100; ++i)=0A= =A0 =A0system("./a.exe");=0A= =A0 return 0;=0A= }=0A= =0A= int main()=0A= {=0A= unsigned i;=0A= HANDLE threads[100] =3D {0};=0A= FILE* f =3D fopen("a.c", "w");=0A= fprintf(f, "int main() { return 0; }\n");=0A= fclose(f);=0A= =0A= system("g++ a.c");=0A= =0A= for (i =3D 0; i < 100; ++i)=0A= =A0threads[i] =3D CreateThread(0, 0, thread, 0,0,0);=0A= =0A= for (i =3D 0; i < 100; ++i)=0A= =A0WaitForSingleObject(threads[i], -1);=0A= =0A= }=0A= =0A= $ ./1.exe =0A= =A0 =A0 =A0 0 [main] sh 9287 C:\cygwin64\bin\sh.exe: *** fatal error - inte= rnal error reading the windows environment - too many environment variables= ?=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 3001 [main] sh 9287 cygwin_exception::open_stackdu= mpfile: Dumping stack trace to sh.exe.stackdump=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A00 [main] sh 9286 C:\cygwin64\bin\sh.exe= : *** fatal error - internal error reading the windows environment - too ma= ny environment variables?=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Stack trace:=0A= Frame =A0 =A0 =A0 =A0Function =A0 =A0Args=0A= 000FFFFCD30 =A000180061C6E (001802795F0, 00180269E81, 00000000000, 000FFFFB= B20)=0A= 000FFFFCD30 =A00018004849A (00000000228, 00800000160, 00000000000, 000FFFFC= D30)=0A= 000FFFFCD30 =A0001800484D2 (00000000000, 00000000000, 00000000000, 00000000= 000)=0A= 000FFFFCD30 =A00018005F12D (00180158C19, 00000000000, 00000000000, 000FFFFC= D30)=0A= 000FFFFCD30 =A000180103AE4 (00000000000, 00000000000, 00000000000, 00000000= 000)=0A= 000FFFFCD30 =A000180048BC2 (00000000000, 00000000000, 00000000000, 00000000= 000)=0A= 000FFFFFFF0 =A000180047746 (00000000000, 00000000000, 00000000000, 00000000= 000)=0A= 000FFFFFFF0 =A0001800477F4 (00000000000, 00000000000, 00000000000, 00000000= 000)=0A= End of stack trace=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 [waitproc] 1 9269 proc_wa= iter: error on read of child wait pipe 0x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A01078 [waitproc] 1 9269 proc_waiter: error on rea= d of child wait pipe 0x0, Win32 error 6=0A= =A0 =A0 =A04452 [waitproc] 1 9269 proc_waiter: error on read of child wait = pipe 0x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sh: ./a.exe: Bad address=0A= =A0 11522 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0= x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sh: ./a.exe: Bad address=0A= sh: ./a.exe: Bad address=0A= =A0 38623 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0= x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 48009 [waitproc] 1 9269 proc_waiter: er= ror on read of child wait pipe 0x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 48660 [waitproc] 1 9269 proc_waiter: error on read of c= hild wait pipe 0x0, Win32 error 6=0A= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 49909 [waitproc] 1 9269 proc_waiter: error on read of child wait pipe 0= x0, Win32 error 6=0A= =0A= =0A= I understand I can workaround this, in that the use of threads is silly.=0A= =0A= Is this invalid, to mix Win32 threads with cygwin system()?=0A= =0A= =A0- Jay=0A= =0A= =0A= From: Jay K =0A= Sent: Wednesday, January 12, 2022 5:57 AM=0A= To: cygwin@sourceware.org =0A= Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error= 6 =0A= =A0=0A= Um, I know this isn't (yet) diligent/scientific, but must system create thi= s thread?=0A= =0A= #0 =A00x00007ff811e09e47 in KERNEL32!CreateThread () from /cygdrive/c/WINDO= WS/System32/KERNEL32.DLL =0A= #1 =A00x00000001800468eb in cygthread::create() () from /usr/bin/cygwin1.dl= l=0A= #2 =A00x000000018010645f in pinfo::wait() () from /usr/bin/cygwin1.dll=0A= #3 =A00x000000018012e562 in proc_subproc(unsigned int, unsigned long) () fr= om /usr/bin/cygwin1.dll=0A= #4 =A00x0000000180134e85 in child_info_spawn::worker(char const*, char cons= t* const*, char const* const*, int, int, int) () from /usr/bin/cygwin1.dll= =0A= #5 =A00x0000000180136729 in spawnve () from /usr/bin/cygwin1.dll=0A= #6 =A00x0000000180136d05 in spawnvp () from /usr/bin/cygwin1.dll=0A= #7 =A00x0000000180144683 in system () from /usr/bin/cygwin1.dll=0A= #8 =A00x000000018018effb in _sigfe () from /usr/bin/cygwin1.dll=0A= #9 =A00x000000010052884b in QMachine__ExecCommand (t_L_563=3D0x448ef0 "\260= \324\005",=0A= =0A= 'cause i.e. it complicates any lifetime/management.=0A= I do understand some of the problems here, like needing separate threads to= read stdout/stderr, if they are not equal.=0A= =0A= =A0- Jay=0A= =0A= =0A= From: Jay K=0A= Sent: Wednesday, January 12, 2022 4:12 AM=0A= To: cygwin@sourceware.org =0A= Subject: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 = =0A= =A0=0A= I get this a lot:=0A= =0A= =A0 =A0 =A0 0 [waitproc] cm3 7641 proc_waiter: error on read of child wait = pipe 0x0, Win32 error 6=0A= =A0 =A0 452 [waitproc] cm3 7641 proc_waiter: error on read of child wait pi= pe 0x0, Win32 error 6=0A= =A0 =A0 716 [waitproc] cm3 7641 proc_waiter: error on read of child wait pi= pe 0x0, Win32 error 6=0A= =A0 =A01652 [waitproc] cm3 7641 proc_waiter: error on read of child wait pi= pe 0x0, Win32 error 6=0A= =A0 =A0 =A0 0 [main] sh 7775 C:\cygwin64\bin\sh.exe: *** fatal error - inte= rnal error reading the windows environment - too many environment variables= ?=0A= =A0=0A= Scenario is multi-threaded "launching" a bunch of invocations of gcc.=0A= "launching" was usually spawnve or fork/execve but I changed the code to us= e system and it still happens.=0A= I might try to make a small reproducing, if this is not known.=0A= It seems a bit difficult to believe I could cause this internal looking err= or.=0A= =0A= Thank you,=0A= =A0- Jay=