From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.311.1576104163307484126 for ; Wed, 11 Dec 2019 14:42:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ldGr2po2; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: aiden.park@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2019 14:42:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,303,1571727600"; d="scan'208";a="203732183" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2019 14:42:41 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 14:42:41 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 14:42:41 -0800 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.59) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Dec 2019 14:42:41 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X9kwI0gbyZuczSww8NqbAq3P0YBkjaA0dOx5b5qgrOQVklJR0hiRk5P4yADlO4kK69CLNDZZY0AJJSih8V/ZFuB8/Ppob7SubfjdA6QoJqg100Y/Usab0tUKZiym0fA7ncmZdK/OZRcavA92f5W+toCKw7HOigjvN3z2ExfM215IFusVAREKFnd9E5UtbG1PCDgNbeJ/swEa2Muih3FXL3zmB32y4zj8meo9qY0K9rhppOTPRh5+I/0jLsyZixmOhuCk3znbDAZcaU+Ce4JVguwVaeg1Yp/FoqHr1waBvd/41ITNAW59/bCU/j8G/UpcsyxtbEzF5JM0f0e8e0Nb/A== 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=UA1P6cU+EYsdPGljZvEjreJkaZW0zabeS5vGOe0z/uQ=; b=Fc8+oigEgv/DDYa/6pfqNf8IBthyncqGHMlxi1AIrCoXCy+DTHHnslMFD9g/zGZmoZVg+YFpeu0CFQteUy6ar90+ba+Ckmy75CnJWjdm5ITsTV20o2cvkeLMUr+589RhBEDT6dglv1Ro4uXoY+zlDHG+78AmjjIawwSRh4H9ymLVD6orMOIgYYmdnO+IwYKKztqxSXCmNK2gy8F9fvwK/YKsYvP3QTfEgGk1ZKQ4LXYW9uaPFTtVJqyUKpGfTKAu4waZHErpAcWjLlKKEPAfgzgpzsRfrDr9081Tc/gSfDgdgerItb/smRnfn2sNXHV/cjgO+yvH5XgKldAd3WdDNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UA1P6cU+EYsdPGljZvEjreJkaZW0zabeS5vGOe0z/uQ=; b=ldGr2po2oyxX0HkUMDMD6Cl1tM5OIOztkuZWF+cpD/caIfSp0tGyi0gtL9ENWlG2t4+eySWBAH4Nl5iDWEqdI1jBUOLaSOzyQsi26Kt3npNPWqmv4BPAKYw4s3rGsiq3tOpOPhWCuzZRXSq2iu+ulx5WuPeId5p/9LvD8ZFHO10= Received: from BN8PR11MB3619.namprd11.prod.outlook.com (20.178.219.86) by BN8PR11MB3681.namprd11.prod.outlook.com (20.178.219.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.14; Wed, 11 Dec 2019 22:42:39 +0000 Received: from BN8PR11MB3619.namprd11.prod.outlook.com ([fe80::ed50:624b:38b9:e703]) by BN8PR11MB3619.namprd11.prod.outlook.com ([fe80::ed50:624b:38b9:e703%4]) with mapi id 15.20.2516.018; Wed, 11 Dec 2019 22:42:39 +0000 From: "Park, Aiden" To: "devel@edk2.groups.io" Subject: [PATCH] [edk2/BaseTools] edksetup.bat stuck on unicode locale Windows Thread-Topic: [PATCH] [edk2/BaseTools] edksetup.bat stuck on unicode locale Windows Thread-Index: AdWwdDLVp9xBmfjoQ6mo1EN+7xsRzg== Date: Wed, 11 Dec 2019 22:42:38 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTc0YzljNjctMmU1YS00N2FiLTg0MzgtZTI5Y2YxNTQ2NjFkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiR1dTdUQ1d2w5eWhrZmVyRTdENzdaMXk1WHVOeFhWYytxVkhqRTM1b1RLZGVjZ1FubWNUZ29NMUdwSXBTWVVHOSJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=aiden.park@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e38aa6d9-e986-4ab7-c7df-08d77e8b6d35 x-ms-traffictypediagnostic: BN8PR11MB3681: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 024847EE92 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(199004)(189003)(8676002)(81156014)(81166006)(6916009)(9686003)(186003)(26005)(52536014)(71200400001)(6506007)(2906002)(33656002)(966005)(86362001)(76116006)(8936002)(64756008)(7696005)(66946007)(66446008)(66556008)(55016002)(66476007)(498600001)(5660300002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN8PR11MB3681;H:BN8PR11MB3619.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ch/gCTFnsbJJiZZQVwnZUXDv8/IwY7SLhJSbEY66m3HCWDFvZyXNoKf04F0aIYa/NGx2irpFk1P27oyXoNSrlikzbsHcxKWc22tBpWhELq68PMZvOqPLHMN74+hU4rbMvqBnWnAe2o3+H5+SgqJlcFKDH7wQSnlOaqBwj0wLaUDL+SRpkutcMPM9ZA2OPKOHdd7OTy21SWnGyt4dCcNZEjMztYCIVLefAGdfLxz4E4NR2FiCPxgRnNGp1Q6WHqj2K5fNJMwF83+tI54PvTRbclzVHclJT1XUTU1BBE+V17733AroDKtNpq6k7iuM/y4BVUmzolbnRyXy6hlp/yvsDnQT54Ezr+Nrdgm4RsvBURHPYYzFwANI359Y0KDSIXTgWlQjKHRu1IOBPnLg/PJm0B7DLClbUTeN1Qd+a5q2FyVlE2NkuT2xXrCJ4TAxJkaa1ChdXTAIzJsyU/Mn+ZFWCcluP8ZVHm5ERGnEN2e/Sew= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e38aa6d9-e986-4ab7-c7df-08d77e8b6d35 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2019 22:42:38.8062 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5T82nBYWAcfZ4Ddi+LJxTzKH1gXhIumyoqWWQgkBh+cWHKB/NAF1Ik9PX4IOePJ+xr2RRKGpU+IOS85NS3k5IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3681 Return-Path: aiden.park@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This issue happens under two conditions. 1. Unicode language environment in Windows 2. Call 'edksetup.bat forcerebuild' with python subprocess.call() Steps to reproduce C:\edk2>python Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) Type help, copyright, credits or license for more information. >>> import subprocess >>> subprocess.call(['edksetup.bat', 'forcerebuild']) The edksetup.bat stuck at 'nmake cleanall'. One of multi-threads is on deadlock when python handles stdout and stderr in a subprocess pipe only if the outputs include unicode chars. Only stderr will be handled in the pipe same as a single thread call. Reported in Slim Bootloader. https://github.com/slimbootloader/slimbootloader/issues/478 Local fix has been made in Slim Bootloader. https://github.com/slimbootloader/slimbootloader/pull/490 Signed-off-by: Aiden Park --- BaseTools/Source/C/Makefiles/NmakeSubdirs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py b/BaseTools/Sourc= e/C/Makefiles/NmakeSubdirs.py index 356f5ac..c77bfb0 100644 --- a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py +++ b/BaseTools/Source/C/Makefiles/NmakeSubdirs.py @@ -33,7 +33,7 @@ def RunCommand(WorkDir=3DNone, *Args, **kwargs): if "stderr" not in kwargs: kwargs["stderr"] =3D subprocess.STDOUT if "stdout" not in kwargs: - kwargs["stdout"] =3D subprocess.PIPE + kwargs["stdout"] =3D sys.stdout p =3D subprocess.Popen(Args, cwd=3DWorkDir, stderr=3Dkwargs["stderr"],= stdout=3Dkwargs["stdout"]) stdout, stderr =3D p.communicate() message =3D "" --=20 2.10.2.windows.1