Skip to content

Commit d2ddb6e

Browse files
authored
Merge pull request #1165 from KFilipek/asan_test
[CI] Fix failing address sanitizer
2 parents feeb424 + cda4356 commit d2ddb6e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/base_alloc/base_alloc_linux.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
/*
2-
* Copyright (C) 2024 Intel Corporation
2+
* Copyright (C) 2024-2025 Intel Corporation
33
*
44
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
*/
77

88
#include <assert.h>
9-
#include <stdio.h>
109
#include <sys/mman.h>
11-
#include <sys/syscall.h>
1210
#include <unistd.h>
1311

14-
#include "base_alloc.h"
15-
#include "base_alloc_global.h"
1612
#include "utils_concurrency.h"
1713

1814
static UTIL_ONCE_FLAG Page_size_is_initialized = UTIL_ONCE_FLAG_INIT;
1915
static size_t Page_size;
2016

2117
void *ba_os_alloc(size_t size) {
22-
void *ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
23-
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
18+
void *ptr = utils_mmap(NULL, size, PROT_READ | PROT_WRITE,
19+
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
2420
// this should be unnecessary but pairs of mmap/munmap do not reset
2521
// asan's user-poisoning flags, leading to invalid error reports
2622
// Bug 81619: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81619
@@ -29,7 +25,7 @@ void *ba_os_alloc(size_t size) {
2925
}
3026

3127
void ba_os_free(void *ptr, size_t size) {
32-
int ret = munmap(ptr, size);
28+
int ret = utils_munmap(ptr, size);
3329
assert(ret == 0);
3430
(void)ret; // unused
3531
}

0 commit comments

Comments
 (0)