Skip to content
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

Sanitizer CHECK failed: ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:73 ((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg))) (105553116266496, -12) #1329

Open
jerryc05 opened this issue Oct 10, 2020 · 4 comments

Comments

@jerryc05
Copy link

I got this error when I was running on a remote Fedora Linux machine via ssh:

$ cat test.cpp
int main(){
   int* arr=new int[10];
   return 0;
}
$ ./a.out
==16497==Sanitizer CHECK failed: ../../.././libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:73 ((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg))) (105553116266496, -12)
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 86191
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) 21600
max user processes              (-u) 500
virtual memory          (kbytes, -v) 9000000
file locks                      (-x) unlimited

This is similar to #1243, but I was using the regular asan, not hwasan.

Note that I only encountered this error on this particular remote machine. ASAN worked very well on my local machines. Any clue?

@dmoody256
Copy link

@jerryc05 I ran into this and set the ulimit -v to unlimited to get past it.

@madler
Copy link

madler commented Jul 11, 2023

I am seeing the same thing with a fresh install of clang/llvm 16 (16.0.6) from apt.llvm.org using bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" on a Raspberry Pi 3. Both ASAN and MSAN fail before the program is even run. Compiling and attempting to run the standard hello world C program gives:

$ clang-16 -fsanitize=address -o hello hello.c && ./hello
AddressSanitizer: CHECK failed: sanitizer_allocator_primary64.h:133 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0x600000000000, 0xfffffffffffffff4) (tid=6629)
    <empty stack>

$ clang-16 -fsanitize=memory -o hello hello.c && ./hello
MemorySanitizer: CHECK failed: sanitizer_allocator_primary64.h:133 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0xe00000000000, 0xfffffffffffffff4) (tid=6633)
    <empty stack>

$

The virtual memory is set to unlimited:

$ ulimit -a
real-time non-blocking time  (microseconds, -R) unlimited
core file size              (blocks, -c) 0
data seg size               (kbytes, -d) unlimited
scheduling priority                 (-e) 0
file size                   (blocks, -f) unlimited
pending signals                     (-i) 2598
max locked memory           (kbytes, -l) 116429
max memory size             (kbytes, -m) unlimited
open files                          (-n) 1024
pipe size                (512 bytes, -p) 8
POSIX message queues         (bytes, -q) 819200
real-time priority                  (-r) 0
stack size                  (kbytes, -s) 8192
cpu time                   (seconds, -t) unlimited
max user processes                  (-u) 2598
virtual memory              (kbytes, -v) unlimited
file locks                          (-x) unlimited

@madler
Copy link

madler commented Aug 9, 2023

Same thing with clang 17.0.0 and 18.0.0.

$ clang-16 -fsanitize=memory -o hello hello.c && ./hello
MemorySanitizer: CHECK failed: sanitizer_allocator_primary64.h:133 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0xe00000000000, 0xfffffffffffffff4) (tid=22663)
    <empty stack>

$ clang-17 -fsanitize=memory -o hello hello.c && ./hello
MemorySanitizer: CHECK failed: sanitizer_allocator_primary64.h:133 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0xe00000000000, 0xfffffffffffffff4) (tid=22668)
    <empty stack>

$ clang-18 -fsanitize=memory -o hello hello.c && ./hello
MemorySanitizer: CHECK failed: sanitizer_allocator_primary64.h:133 "((kSpaceBeg)) == ((address_range.Init(TotalSpaceSize, PrimaryAllocatorName, kSpaceBeg)))" (0xe00000000000, 0xfffffffffffffff4) (tid=22672)
    <empty stack>

@pmatos
Copy link

pmatos commented Oct 9, 2024

Still same issue in 19.1.1 unfortunately - testing on ARM64 with 48bit VA size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants