From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 05AAD207E36DB for ; Tue, 8 May 2018 02:46:14 -0700 (PDT) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Tue, 08 May 2018 11:46:12 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.202]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Tue, 08 May 2018 10:45:53 +0100 Date: Tue, 8 May 2018 17:45:49 +0800 From: Gary Lin To: Dandan Bi Cc: edk2-devel@lists.01.org, Eric Dong , Liming Gao Message-ID: <20180508094500.veagpp2wuhx5jl47@GaryWorkstation> References: <20180410075447.121560-1-dandan.bi@intel.com> MIME-Version: 1.0 In-Reply-To: <20180410075447.121560-1-dandan.bi@intel.com> User-Agent: NeoMutt/20170912 (1.9.0) Subject: Re: [patch 1/2] BaseTools/VfrCompile:Fix memory leak issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 09:46:15 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 10, 2018 at 03:54:46PM +0800, Dandan Bi wrote: > Cc: Eric Dong > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Dandan Bi > --- > BaseTools/Source/C/VfrCompile/VfrSyntax.g | 32 ++++++++++++++++++++++++++++++- > 1 file changed, 31 insertions(+), 1 deletion(-) > > diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g > index d48072a8adf..4b0a43606ea 100644 > --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g > +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g Hi Dandan, I encountered a build error with our build service: [ 197s] "VfrCompile" -l -n --string-db /home/abuild/rpmbuild/BUILD/ovmf-2018+git1525681922.053cd183c9f2/Build/OvmfX64/DEBUG_GCC5/X64/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib/OUTPUT/BootMaintenanceManagerUiLibStrDefs.hpk --output-directory /home/abuild/rpmbuild/BUILD/ovmf-2018+git1525681922.053cd183c9f2/Build/OvmfX64/DEBUG_GCC5/X64/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib/DEBUG/. /home/abuild/rpmbuild/BUILD/ovmf-2018+git1525681922.053cd183c9f2/Build/OvmfX64/DEBUG_GCC5/X64/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib/OUTPUT/BootMaintenanceManager.i [ 197s] *** Error in `/home/abuild/rpmbuild/BUILD/ovmf-2018+git1525681922.053cd183c9f2/BaseTools/Source/C/bin/VfrCompile': free(): invalid pointer: 0xbabababababababa *** If I reverted the following change, the package can be built again. > @@ -5055,11 +5082,14 @@ EfiVfrParser::_SAVE_OPHDR_COND ( > VOID > EfiVfrParser::_CLEAR_SAVED_OPHDR ( > VOID > ) > { > - mCIfrOpHdr[mCIfrOpHdrIndex] = NULL; > + if (mCIfrOpHdr[mCIfrOpHdrIndex] != NULL) { > + delete mCIfrOpHdr[mCIfrOpHdrIndex]; > + mCIfrOpHdr[mCIfrOpHdrIndex] = NULL; > + } > mCIfrOpHdrLineNo[mCIfrOpHdrIndex] = 0; > } > > BOOLEAN > EfiVfrParser::_SET_SAVED_OPHDR_SCOPE ( I have no clue now and it happened all the time. Would you mind to check the code? Thanks, Gary Lin