diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:21:43 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-10-20 15:21:43 +0200 |
commit | 4682deeb62247d34de87f8e777f99e2d337fd377 (patch) | |
tree | 5bd5b5605b5f3a4b3c8ea7468c34c23094afdef4 /tests/test-free.c | |
parent | 00893e79fc62966067af1a106567db96bd170338 (diff) |
New upstream version 1.3upstream/1.3upstream
Diffstat (limited to 'tests/test-free.c')
-rw-r--r-- | tests/test-free.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test-free.c b/tests/test-free.c index 703c550e..b0c084da 100644 --- a/tests/test-free.c +++ b/tests/test-free.c @@ -98,6 +98,12 @@ main () #undef N } + /* Skip this test when an address sanitizer is in use, because it would report + a "heap buffer overflow". */ + #ifndef __has_feature + #define __has_feature(a) 0 + #endif + #if !(defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)) /* Test a less common code path. When malloc() is based on mmap(), free() can sometimes call munmap(). munmap() usually succeeds, but fails in a particular situation: when @@ -115,7 +121,7 @@ main () if (open ("/proc/sys/vm/max_map_count", O_RDONLY) >= 0) { /* Preparations. */ - size_t pagesize = getpagesize (); + size_t pagesize = sysconf (_SC_PAGESIZE); void *firstpage_backup = malloc (pagesize); void *lastpage_backup = malloc (pagesize); /* Allocate a large memory area, as a bumper, so that the MAP_FIXED @@ -170,6 +176,7 @@ main () } } #endif + #endif - return 0; + return test_exit_status; } |