Go's Memory Safety: The Hidden Danger of Thread Unsafety
This article challenges the common understanding of memory safety in Go. The author argues that simple memory safety (e.g., preventing out-of-bounds access) isn't sufficient for robust programs; true safety lies in avoiding undefined behavior (UB). A Go program example demonstrates how data races can lead to UB and crashes, even without using `unsafe` operations. The author contends that Go's handling of data races is not strict enough, contradicting its claims of memory safety, making Go programs more vulnerable to security exploits. The conclusion emphasizes that language safety isn't binary but understanding a language's safety guarantees and trade-offs is crucial.
Read more