TLS struct variables should be allocated only for nonzero values
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 189
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
For thread-local variables and associative arrays, the documentation says that unassigned variables are considered to be initialized to zero. Storage is not allocated until nonzero values are assigned. Storage is to be freed when zero values are assigned.
These semantics are not well handled for struct variables. Consider
struct foo {
int bar, baz;
} x;
We cannot assign zero to x to free its storage since x=0 is not defined. And we cannot initialize a member x.bar=1 unless x already exists.
These issues are not new to the port of DTrace onto BPF. They existed already in the legacy DTrace implementation on Linux.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by tracing the Linux DTrace handling for thread-local struct variables and compare it with the documented zero-allocation semantics; done means nonzero struct members can be assigned and storage is released when the struct returns to zero.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100