Skip to content

0.13.2

Choose a tag to compare

@Sunrisepeak Sunrisepeak released this 13 Sep 20:33
dc84bf5

Every std::thread on Windows ended in an access violation when it was joined.

musl declares pthread_t as a pointer for C and as unsigned long for C++. On
LLP64 Windows a long is thirty-two bits, so C++ code above this library — libc++'s
std::thread among it — kept half of the thread's address, and pthread_join
read through the truncated value.

  • C++ pthread_t is now unsigned _Addr: unchanged (long) on x86_64, aarch64 and
    riscv64, long long on x86_64-windows. Recorded in musl/PATCHES.md as the
    fifth patched line.
  • examples/threads-cxx asserts the width at compile time and joins a thread on
    every CI row.

openkal-llvm-runtime pins this package exactly, so C++ programs reach the fix through openkal-llvm-runtime 0.9.3 (mcpplibs/openkal-llvm-runtime#18).