You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runtime/cgo: pthread attribute object leaked on every new thread on BSD, illumos and AIX #82242
runtime/cgo/pthread_unix.c calls pthread_attr_init but never calls pthread_attr_destroy. Several libcs allocate in pthread_attr_init, so every cgo-created thread leaks one heap object.
The non-cgo OpenBSD path in runtime/os_openbsd.go already destroys its attribute object.
Each successfully init'd attribute should be destroyed after pthread_create. In the example code, the memory usage should plateau and exit without a fault.
Activity
gopherbot commentedon Oct 15, 2026
Change https://go.dev/cl/849468 mentions this issue:
runtime/cgo: destroy pthread attributes after use