From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-x236.google.com (mail-yb0-x236.google.com [IPv6:2607:f8b0:4002:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E8C2C1A1DFF for ; Thu, 6 Oct 2016 12:57:41 -0700 (PDT) Received: by mail-yb0-x236.google.com with SMTP id 191so9308331ybv.3 for ; Thu, 06 Oct 2016 12:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to; bh=xrvk3P9PNb+mbB8+P5ZO5E+A7+cfNKyV4i58F0MMnRo=; b=QcCykRNjAK8GrH+uYfpaT7k+o85Aoik1QuiVmjSevvy8v8QnETEv1Qc8gMyu14FJ6l 05zVTB6/1MXXye4lWRO6h+8+rxbELqSjG9RyR8h56fP5/byHIinnfnR55+9FlNRno4C5 p5sZYMGOdKZQSaHy5ZhzJS+6luNBB40Xq6P8Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to; bh=xrvk3P9PNb+mbB8+P5ZO5E+A7+cfNKyV4i58F0MMnRo=; b=I3hVGJR/yjYikqhfmrdXOx/xiO9J/BLl0MRi6vRFleA2ErhiB6kB+VMKwv/6Jy+2Ac RzPwopeHQtnLFZTL7WysbnQiUIprEM1gefg4otXMEYqWkXVQ/dKDyFGNN4tFwYvnaFKW 4YL6KSadppsIFVuC8+LSGHtyp6TYpMrg3sftSKisJFGmT/Eh/6AvXAvwiVmsFiKpARA8 4S/8YiyPa/QA6H7Zu8xT5DKYmOi8KgHBl6PX1bVKNqoSWixWqMm0RvMEJWKlhYixs4zs Vtr2JTHaNHdKTKxnQ20L9+Bz0XBMrkB8EWf6cYkkxhmlLCchKmekFk1ZAEtfWjFVOgzi Yf4g== X-Gm-Message-State: AA6/9RlpX0oH5oWa+p5lQg/Qesyt5pYChyzy3bCWvf/+wC79sd7rmhcgHY0DHphntc0RtxyVEcezGy7TQ9oSF7Ra X-Received: by 10.37.174.137 with SMTP id b9mr1845635ybj.150.1475783860788; Thu, 06 Oct 2016 12:57:40 -0700 (PDT) From: Vladimir Olovyannikov References: <1475701085-11860-1-git-send-email-tapandshah@hpe.com> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQLh+uyo9Iph7/Ap8v9pRDGTJ1Y/ZwGSI08Rnm+AJ0A= Date: Thu, 6 Oct 2016 12:57:37 -0700 Message-ID: <68156d3149dc5203babb1b19b2f6ef43@mail.gmail.com> To: "Carsey, Jaben" , Tapan Shah , edk2-devel@lists.01.org Subject: Re: [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of UefiShellLib constructor X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 19:57:42 -0000 Content-Type: text/plain; charset=UTF-8 Hi Carsey, Tapan, This change breaks our platform's UEFI Shell at runtime (no asserts) : ... Press ESC in 1 seconds to skip startup.nsh or any other key to continue. Error: Image at 000B97CF000 start failed: Invalid Parameter remove-symbol-file /uefi/Build/NS2Pkg/DEBUG_GCC5/AARCH64/ShellPkg/Application/Shell/Shell/DEB UG/Shell.dll 0xB97CF000 Image Return Status = Invalid Parameter UnicodeCollation protocol is present. Attempt to open fs1:startup.nsh which is not present. There is a bug in UefiShellLib.c ShellOpenFileByName() which has nothing to do to this commit. 723 Status = gEfiShellProtocol->OpenFileByName(FileName, FileHandle, OpenMode); If there is no file available, the status is EFI_NOT_FOUND. Line 726 (or 727) of the UefiShellLib.c must be if (EFI_ERROR(Status)) { return Status; } But it is missing, and therefore EFI_SUCCESS is returned to the Shell.c from ShellFindFilePath() (line 1228 of Shell.c), which leads to an attempt to run a non-existent script which fails, and this leads to Shell unloading with "Invalid parameter". Thank you, Vladimir -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Carsey, Jaben Sent: Wednesday, October 05, 2016 3:20 PM To: Tapan Shah; edk2-devel@lists.01.org Cc: Carsey, Jaben Subject: Re: [edk2] [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of UefiShellLib constructor And pushed. Reviewed-by: Jaben Carsey > -----Original Message----- > From: Tapan Shah [mailto:tapandshah@hpe.com] > Sent: Wednesday, October 05, 2016 1:58 PM > To: edk2-devel@lists.01.org > Cc: Carsey, Jaben ; Tapan Shah > > Subject: [PATCH] ShellPkg: Move UnicodeCollation2 Protcol locate out of > UefiShellLib constructor > Importance: High > > Move gEfiUnicodeCollation2ProtocolGuid protocol outside of UefiShellLib > constructor > function. > Locate gEfiUnicodeCollation2ProtocolGuid protocol in > ShellOpenFileByName() which > consumes this protocol API. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Tapan Shah > --- > ShellPkg/Library/UefiShellLib/UefiShellLib.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c > b/ShellPkg/Library/UefiShellLib/UefiShellLib.c > index e47d535..53f54e1 100644 > --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c > +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c > @@ -292,18 +292,12 @@ ShellLibConstructor ( > IN EFI_SYSTEM_TABLE *SystemTable > ) > { > - EFI_STATUS Status; > - > mEfiShellEnvironment2 = NULL; > gEfiShellProtocol = NULL; > gEfiShellParametersProtocol = NULL; > mEfiShellInterface = NULL; > mEfiShellEnvironment2Handle = NULL; > - > - if (mUnicodeCollationProtocol == NULL) { > - Status = gBS->LocateProtocol (&gEfiUnicodeCollation2ProtocolGuid, NULL, > (VOID**)&mUnicodeCollationProtocol); > - ASSERT_EFI_ERROR (Status); > - } > + mUnicodeCollationProtocol = NULL; > > // > // verify that auto initialize is not set false > @@ -730,6 +724,14 @@ ShellOpenFileByName( > FileHandle, > OpenMode); > > + if (mUnicodeCollationProtocol == NULL) { > + Status = gBS->LocateProtocol (&gEfiUnicodeCollation2ProtocolGuid, > NULL, (VOID**)&mUnicodeCollationProtocol); > + if (EFI_ERROR (Status)) { > + gEfiShellProtocol->CloseFile (*FileHandle); > + return Status; > + } > + } > + > if ((mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol, > (CHAR16*)FileName, L"NUL") != 0) && > (mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol, > (CHAR16*)FileName, L"NULL") != 0) && > !EFI_ERROR(Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0)){ > -- > 1.9.5.msysgit.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel