Skip to content

TLS exhaustion #891

@Simn

Description

@Simn

I had a bug in hxcoro which caused too many TLS instances to be allocated, which resulted in a straight up segfault on MacOS HL. This was pretty hard to spot even for Claude, but he ultimately fixed it and said:

macOS caps per-process pthread TLS keys at 512 (vs Linux's 1024), and HL never calls pthread_key_delete on GC. After ~170 test runs the keys were exhausted.

So at the very least this should fail more gracefully, but it also sounds like this is a general leak. I don't have a reproducible example because I don't have a mac, but a loop that just creates TLS instances should do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions