-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FFI examples use address sanitizer (#447)
## What changes are proposed in this pull request? Enable ASAN for the FFI examples, to automatically detect many memory errors. On linux, the address sanitizer automatically includes leak detection as well, but the leak sanitizer is unsupported on darwin: ``` cc: error: unsupported option '-fsanitize=leak' for target 'arm64-apple-darwin23.6.0' ``` (which is weird, given that the [leak sanitizer docs](https://clang.llvm.org/docs/LeakSanitizer.html) claim support for "macOS aarch64/i386/x86_64" ## How was this change tested? NOTE: Leak detection is temporarily disabled on the `read-table` example, because it has many memory leaks that need to be fixed first. Tracked as #448. Address sanitizer tested locally by injecting the following code (which was successfully caught and caused test failures): ```c // intentional use-after-free access char* dangling = malloc(1); free(dangling); *dangling = 0; ``` Leak sanitizer tested by temporarily adding the following code and letting github actions detect it: ```c // intentional leak char* leaked = malloc(10); *leaked = 0; ```
- Loading branch information
Showing
4 changed files
with
13 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters