Skip to content

MSAN errors (use-of-uninitialized-value) from GHC RTS

Summary

I get run-time errors (use-of-uninitialized-value) when running binaries built using GHC with MSAN. E.g.,

Uninitialized bytes in read_sigaction at offset 0 inside [0x7ffe7fc3b770, 4)
==242461==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f3f7b115062  ([redacted]/libHSrts_thr-ghc8.6.4.so+0x4e062)
    #1 0x7f3f7b0efe55  ([redacted]/libHSrts_thr-ghc8.6.4.so+0x28e55)
    #2 0x7f3f7b0ef5d8  ([redacted]/libHSrts_thr-ghc8.6.4.so+0x285d8)
    ...
SUMMARY: MemorySanitizer: use-of-uninitialized-value ([redacted]/libHSrts_thr-ghc8.6.4.so+0x4e062)

or

==4507==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f58adad8102  ([redacted]/libHSbase-4.12.0.0-ghc8.6.4.so+0x6d8102) 

SUMMARY: MemorySanitizer: use-of-uninitialized-value ([redacted]/libHSbase-4.12.0.0-ghc8.6.4.so+0x6d8102) 

Steps to reproduce

Build a program with msan enabled and run.

I'm doing this in our internal build system, where building with msan is as simple as passing a build flag, but I'm sorry I'm not sure how to do that in general.

Expected behavior

It should run without run-time errors such as use-of-uninitialized-value.

Environment

  • GHC version used: 8.6.4

Optional:

  • Operating System: Linux
  • System Architecture: X86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information