Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 182dbe79a09068f45bf0fa3b0e79843e05a02c3f
      
https://github.com/tianocore/edk2/commit/182dbe79a09068f45bf0fa3b0e79843e05a02c3f
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M 
UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.c

  Log Message:
  -----------
  UnitTestFrameworkPkg/MemoryAllocationLibPosix: Add DEBUG_CLEAR_MEMORY()

Add use of DEBUG_CLEAR_MEMORY() macros on all allocation and free
operations in MemoryAllocationLibPosix to match behavior of all other
MemoryAllocationLib instances.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: 30b10dcdd0c9e6801262ac5de786d86bbb967181
      
https://github.com/tianocore/edk2/commit/30b10dcdd0c9e6801262ac5de786d86bbb967181
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c

  Log Message:
  -----------
  UnitTestFrameworkPkg/UnitTestLib: Implement Free*() services

Implement FreeUnitTestEntry(), FreeUnitTestSuiteEntry(), and
FreeUnitTestFramework() so the UnitTestLib does not introduce
any memory leaks.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: ca4e19ccc2dae7d2874fcba6bc1d78e9076d5fcc
      
https://github.com/tianocore/edk2/commit/ca4e19ccc2dae7d2874fcba6bc1d78e9076d5fcc
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTest.dsc
    M UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTestExpectFail.dsc
    M UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc
    M UnitTestFrameworkPkg/UnitTestFrameworkPkgCommon.dsc.inc

  Log Message:
  -----------
  UnitTestFraworkPkg: Enable DEBUG_CLEAR_MEMORY in host tests

Update DSC files to always enable DEBUG_CLEAR_MEMORY() macros
so memory is cleared on every memory allocation/free operation.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: 8d0e23d998e6181b3ba032bfc7e3217f8c396c69
      
https://github.com/tianocore/edk2/commit/8d0e23d998e6181b3ba032bfc7e3217f8c396c69
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    A BaseTools/Conf/Empty_C_File_Host_Application_Build.c
    M BaseTools/Conf/build_rule.template

  Log Message:
  -----------
  BaseTools/Conf: Simplify VS20xx HOST_APPLICATION builds

Add Empty_C_File_Host_Application_Build.c to BaseTools/Conf
that is a C source file with only comments that is used to
compile into an OBJ file using CC_FLAGS for a HOST_APPLICATION
module and the OBJ is passed into the VS20xx DLINK action to
provide the context required to select the correct default
windows application libraries.

Update build_rule.template to compile the empty C file and
generate OBJ in the OUTPUT_DIR of the HOST_APPLICATION
component and use the OBJ in the DLINK action.

This simplifies CC_FLAGS and DLINK_FLAGS for all modules
of type HOST_APPLICATION.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: de06288019e62ee563d6958fb0fb7d0ffb8a2e62
      
https://github.com/tianocore/edk2/commit/de06288019e62ee563d6958fb0fb7d0ffb8a2e62
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
    M 
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf
    M UnitTestFrameworkPkg/ReadMe.md
    M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc

  Log Message:
  -----------
  UnitTestFrameworkPkg: Use /MTd and enable Address Sanitizers

* Update host based unit test VS20xx builds to use /MTd instead of
  /MT to enable use of debug libraries for host based unit tests.
* Enable /fsanitize=address for host based unit test VS2019 builds
* Enable /fsanitize=address for host based unit test VS2022 builds
* Enable -fsanitize=address for host based unit test GCC builds
* Add UNIT_TESTING_ADDRESS_SANITIZER_ENABLE define that is set to
  TRUE by default so it is always enabled, but can be set to FALSE
  to temporarily disable during development/debug of unit tests.
* Add address sanitizer information to ReadMe.md

Enabling the Address Sanitizer can detect double frees, buffer
overflow, buffer underflow, access to invalid addresses, and
various exceptions. These can be detected in both the unit test
case sources as well as the code under test.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: 1c73f0e71dea4adc2da75b5eaf970e80c938a51e
      
https://github.com/tianocore/edk2/commit/1c73f0e71dea4adc2da75b5eaf970e80c938a51e
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M 
UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGoogleTest.cpp
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestBufferOverflow/SampleUnitTestBufferOverflow.c
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestBufferOverflow/SampleUnitTestBufferOverflow.inf
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestBufferUnderflow/SampleUnitTestBufferUnderflow.c
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestBufferUnderflow/SampleUnitTestBufferUnderflow.inf
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestDoubleFree/SampleUnitTestDoubleFree.c
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestDoubleFree/SampleUnitTestDoubleFree.inf
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestInvalidAddress/SampleUnitTestInvalidAddress.c
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestInvalidAddress/SampleUnitTestInvalidAddress.inf
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestNullAddress/SampleUnitTestNullAddress.c
    A 
UnitTestFrameworkPkg/Test/UnitTest/Sample/SampleUnitTestNullAddress/SampleUnitTestNullAddress.inf
    M UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTestExpectFail.dsc
    M UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml

  Log Message:
  -----------
  UnitTestFrameworkPkg: Add failing unit tests cases for sanitizer

Add GoogleTest and Framework based unit tests that are expected
to fail and be caught by Address Sanitizer. These unit tests
verify that an address sanitizer is enabled and detecting the
following conditions. It also provide examples of the expected
output when an Address Sanitizer detected these types of issues.

* double free
* buffer overflow
* buffer underflow
* null ptr
* invalid address
* divide by zero

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: 5f97d5391eadc592548aa635b8b16e811df046fc
      
https://github.com/tianocore/edk2/commit/5f97d5391eadc592548aa635b8b16e811df046fc
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M 
UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.cpp
    M UnitTestFrameworkPkg/Library/UnitTestLib/AssertCmocka.c
    M UnitTestFrameworkPkg/Library/UnitTestLib/RunTestsCmocka.c

  Log Message:
  -----------
  UnitTestFrameworkPkg/UnitTestLib: Reduce sanitizer false positive

Use snprintf() in host based unit tests to format log messages
and add host specific wrapper for LongJump() that is decorated
with NORETURN to provide hint to address sanitizer that LongJump()
never returns.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: e78fb8a366fcd39329f86ce5a095d88d9be8dcb6
      
https://github.com/tianocore/edk2/commit/e78fb8a366fcd39329f86ce5a095d88d9be8dcb6
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    A UnitTestFrameworkPkg/Include/Library/HostMemoryAllocationBelowAddressLib.h
    A 
UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/AllocateBelowAddress.c
    M 
UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf
    A UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/WinInclude.h
    M 
UnitTestFrameworkPkg/Test/GoogleTest/Sample/SampleGoogleTest/SampleGoogleTest.cpp
    M UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
    M UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
    M UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc

  Log Message:
  -----------
  UnitTestFrameworkPkg/MemoryAllocationLibPosix: Add allocate below address

Add HostMemoryAllocationBelowAddressLib class and implementation that
uses OS specific services to perform pool and page allocations below
a specified address in a host based unit test application execution
environment. This library class is only required for mocking buffers
that are assumed to be below a specific address by code under test.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


  Commit: 139cbb266b4847d1b63a20c568a5df9b26f7489b
      
https://github.com/tianocore/edk2/commit/139cbb266b4847d1b63a20c568a5df9b26f7489b
  Author: Michael D Kinney <michael.d.kin...@intel.com>
  Date:   2025-01-21 (Tue, 21 Jan 2025)

  Changed paths:
    M BaseTools/Plugin/HostBasedUnitTestRunner/HostBasedUnitTestRunner.py

  Log Message:
  -----------
  BaseTools/Plugin/HostBasedUnitTestRunner: Set ASAN env vars

The environment variable `GTEST_CATCH_EXCEPTION` must be
set to `0` for so all exceptions are handled by the
address sanitizer and not GoogleTest. This allows stack
back trace and other details to be logged by the address
sanitizer so the source of the issue identified address
sanitizer can be determined.

The environment variable `ASAN_OPTIONS` must be set to
`detect_leaks=0` to disable memory leak detection. The
unit test frameworks may have memory leaks and some
firmware code under test use cases may perform a memory
allocation without a matching memory free as their
expected behavior.

Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>


Compare: https://github.com/tianocore/edk2/compare/f9a0e5495375...139cbb266b48

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to