Skip to content

runtime/cgo: "pthread_create failed" during syscall.Exec on Darwin/OpenBSD/DragonFly #18146

Closed
@bcmills

Description

@bcmills

Twice this week I've helped people debug panics in Go programs due to runtime/cgo: pthread_create failed: Resource temporarily unavailable. Both times, it has turned out that they were calling syscall.Exec and it happened to execute concurrently with a pthread_create for a background goroutine, causing the pthread_create to fail with EAGAIN.

There have been a couple of previous threads on go-nuts involving similar issues.

We could consider modifying the runtime to stop the world and/or shutdown threads during calls to syscall.Exec, but that seems like a fair amount of work and the syscall package is frozen / deprecated anyway.

As a simpler step, I think we should have vet warn about any calls to syscall.Exec from outside the standard library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions