Issue |
138581
|
Summary |
ThreadSanitizer doesn't work with memory overcommit disabled
|
Labels |
new issue
|
Assignees |
|
Reporter |
zackw
|
On Linux, if memory overcommit has been disabled (`sysctl -w vm.overcommit_memory=2`), all programs compiled with `-fsanitize=thread` crash on startup with an error message...
```
==363640==ERROR: ThreadSanitizer failed to allocate 0x200000000000 (35184372088832) bytes at address 100000000000 (errno: 12)
FATAL: ThreadSanitizer can not mmap the shadow memory
FATAL: Make sure to compile with -fPIE and to link with -pie.
```
... that indicates ThreadSanitizer attempted to allocate *32 terabytes* of RAM. That's not a reasonable amount of memory to expect a developer workstation to have.
Please change ThreadSanitizer so that it only allocates shadow memory proportional to the amount of RAM that the program actually uses. You can probably use `MAP_NORESERVE` to allocate a range of *address space* without also allocating RAM.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs