HaxeFoundation / HaxeFoundation/hashlink

TLS exhaustion

Open
#891 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
901
Forks
201
Avg merge
18h 9m
Merged PRs (30d)
8

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.