This demonstrates a bug in Rust with thread local variables. To reproduce: Run on CentOS 7, or another system with glibc 2.17 cargo build gcc test.c -ldl -pthread ./a.out Observe segfault