summaryrefslogtreecommitdiff
path: root/tests/test-free.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2025-03-22 18:00:25 +0100
committerJörg Frings-Fürst <debian@jff.email>2025-03-22 18:00:25 +0100
commit0737819efdd0bae112d16d874cac7e747e43cd08 (patch)
tree98a9ac84f7f347ae530c14852c68870682f3d04c /tests/test-free.c
parent163a663518f33bab48b28431972e580b366b4d49 (diff)
parente670957a8693f860cf7d77fed4ce6b4b056a8083 (diff)
Merge branch 'release/debian/1.3-1'debian/1.3-1
Diffstat (limited to 'tests/test-free.c')
-rw-r--r--tests/test-free.c11
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;
}