Thanks.  I'll submit a v2 with that change.
________________________________
From: Kinney, Michael D <[email protected]>
Sent: Tuesday, October 3, 2023 12:00 PM
To: Name [email protected] <Name [email protected]>; [email protected] 
<[email protected]>
Cc: Gao, Liming <[email protected]>; Liu, Zhiguang 
<[email protected]>; Jake Garver <[email protected]>; Kinney, Michael D 
<[email protected]>
Subject: RE: [PATCH] BaseStackCheckLib: Fix STACK FAULT message

External email: Use caution opening links or attachments


I think the macro RETURN_ADDRESS from Base.h should be used instead of
direct use of the builtin.

Mike

> -----Original Message-----
> From: Name [email protected] <Name [email protected]>
> Sent: Tuesday, October 3, 2023 6:20 AM
> To: [email protected]
> Cc: Kinney, Michael D <[email protected]>; Gao, Liming
> <[email protected]>; Liu, Zhiguang <[email protected]>; Jake
> Garver <[email protected]>
> Subject: [PATCH] BaseStackCheckLib: Fix STACK FAULT message
>
> From: Jake Garver <[email protected]>
>
> __builtin_return_address returns a pointer, not a string.  Fix the STACK
> FAULT message in BaseStackCheckLib appropriately.
>
> Signed-off-by: Jake Garver <[email protected]>
> ---
>  MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> index 0d2918668e..3b970391b7 100644
> --- a/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> +++ b/MdePkg/Library/BaseStackCheckLib/BaseStackCheckGcc.c
> @@ -34,7 +34,7 @@ __stack_chk_fail (
>  {
>    UINT8  DebugPropertyMask;
>
> -  DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow in function %a.\n",
> __builtin_return_address (0)));
> +  DEBUG ((DEBUG_ERROR, "STACK FAULT: Buffer Overflow at 0x%p.\n",
> __builtin_return_address (0)));
>
>    //
>    // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings even if
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109313): https://edk2.groups.io/g/devel/message/109313
Mute This Topic: https://groups.io/mt/101736789/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to