compiler-explorer icon indicating copy to clipboard operation
compiler-explorer copied to clipboard

[BUG]: Thread Sanitizer doesn't work

Open ericriff opened this issue 1 year ago • 1 comments

Describe the bug

TSan fails for (all?) gcc versions with

program returned: 66
Program stderr
FATAL: ThreadSanitizer: unexpected memory mapping 0x711993472000-0x711993900000

Likely due to https://github.com/google/sanitizers/issues/1716

Steps to reproduce

  1. Write a hello world app
  2. Compile with any gcc with -fsanitize=thread

Expected behavior

TSan works

Reproduction link

https://godbolt.org/z/oedPr11qc

Screenshots

Not applicable

Operating System

Ubuntu 22.04

Browser version

Google Chrome 126.0.6478.126

ericriff avatar Jul 22 '24 17:07 ericriff

As of end of April 2025, the problem still persists so : where are we on this ?

The current solution is to change the amount of memory address randomization with : sudo sysctl vm.mmap_rnd_bits=30 so it could be nice to provide a way to do this if doable / possible (?)

grybouilli avatar Apr 29 '25 05:04 grybouilli