alpaka-group / alpaka

Abstraction Library for Parallel Kernel Acceleration :llama:
https://alpaka.readthedocs.io
Mozilla Public License 2.0
337 stars 69 forks source link

Fix tsan error: change memory randomization #2250

Closed mehmetyusufoglu closed 3 months ago

mehmetyusufoglu commented 3 months ago

Decrease mmap randomization to fix the tsan error FATAL: ThreadSanitizer: unexpected memory mapping

psychocoderHPC commented 3 months ago

This looks like the similar issue: https://github.com/google/sanitizers/issues/1716

psychocoderHPC commented 3 months ago

If I see it correctly the bug should be solved in llvm 17+ see https://github.com/llvm/llvm-project/commit/fb77ca05ffb4f8e666878f2f6718a9fb4d686839

SimeonEhrig commented 3 months ago

If I see it correctly the bug should be solved in llvm 17+ see llvm/llvm-project@fb77ca0

No, it does not solve the problem. I already tested it: https://github.com/alpaka-group/alpaka/pull/2249/commits/812035ea3733a8854501deec9454b7dda3652ffe

I think, this fixes another bug.

mehmetyusufoglu commented 3 months ago

this is a workaround for linux OS. Tsan does not fail anymore. sudo sysctl vm.mmap_rnd_bits=28

I will put a condition to set this only for tsan or only for linux.

psychocoderHPC commented 3 months ago

@mehmetyusufoglu please update the description of this PR

mehmetyusufoglu commented 3 months ago

@mehmetyusufoglu please update the description of this PR

Done, thanks.