runtime/cgo: improve Error Handling in gcc_stack_unix.c
with Assertions
#71896
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Description
The
pthread
function calls ingcc_stack_unix.c
currently do not check return values, which may lead to silent failures in stack attribute retrieval. This issue proposes addingassert()
statements to validate these function calls, ensuring that failures are detected early during development.Affected File
src/runtime/cgo/gcc_stack_unix.c
Proposed Solution
<assert.h>
to useassert()
.assert()
to verify their return values:pthread_attr_init
pthread_getattr_np
pthread_attr_get_np
pthread_attr_getstack
Rationale
Steps to Reproduce
pthread_attr_init
or related function.Expected Behavior
pthread
functions fail, providing clear debugging information.The text was updated successfully, but these errors were encountered: