Skip to content

Make sure Asan failures are detected in 'make test' #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

gilles-peskine-arm
Copy link
Collaborator

@gilles-peskine-arm gilles-peskine-arm commented Oct 21, 2019

Make sure that all defects reported by Asan, including memory leaks, are treated as failures. This was not the case when running make test: we could see the Asan messages in the logs, but only if we went looking for them, because the tests were recorded as passing.

One memory leak went undetected for a while due to this bug: in test_suite_psa_crypto_se_driver_hal (fix duplicated here and in #298).

Fix #303.

Use a common set of options when building with Asan without CMake.
Some sanitizers default to displaying an error message and recovering.
This could result in a test being recorded as passing despite a
complaint from the sanitizer. Turn off sanitizer recovery to avoid
this risk.
When running 'make test' with GNU make, if a test suite program
displays "PASSED", this was automatically counted as a pass. This
would in particular count as passing:
* A test suite with the substring "PASSED" in a test description.
* A test suite where all the test cases succeeded, but the final
  cleanup failed, in particular if a sanitizer reported a memory leak.

Use the test executable's return status instead to determine whether
the test suite passed. It's always 0 on PASSED unless the executable's
cleanup code fails, and it's never 0 on any failure.

Fix ARMmbed#303
@gilles-peskine-arm gilles-peskine-arm added bug Something isn't working needs: review The pull request is ready for review. This generally means that it has no known issues. labels Oct 21, 2019
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gilles-peskine-arm
Copy link
Collaborator Author

The CI failures are a known problem with the job getting-started-CY8CKIT_062_WIFI_BT-IAR which is not related to this PR. Ok to merge.

@gilles-peskine-arm gilles-peskine-arm merged commit 0eaf49c into ARMmbed:development Oct 24, 2019
gilles-peskine-arm added a commit to gilles-peskine-arm/mbed-crypto that referenced this pull request Feb 3, 2020
* ARMmbed#321: Replace config.pl by config.py
* ARMmbed#322: Update Mbed Crypto with latest Mbed TLS changes as of 2019-11-15
* ARMmbed#308: Small performance improvement of mbedtls_mpi_div_mpi()
* ARMmbed#324: test_psa_constant_names: support key agreement, better code structure
* ARMmbed#320: Link to the PSA crypto portal page from README.md
* ARMmbed#293: Always gather MBEDTLS_ENTROPY_BLOCK_SIZE bytes of entropy
* ARMmbed#310: Clarify test descriptions in test_suite_memory_buffer_alloc
* ARMmbed#307: Add ASN.1 ENUMERATED tag support
* ARMmbed#328: Remove dependency of crypto_values.h on crypto_extra.h
* ARMmbed#325: Rename psa_asymmetric_{sign_verify} to psa_{sign,verify}_hash

Missed listing in the previous submodule update:

* ARMmbed#304: Make sure Asan failures are detected in 'make test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs: review The pull request is ready for review. This generally means that it has no known issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some ASan failures go undetected in all.sh
3 participants