TLS variables (self->x) can be declared with an array datatype but cannot be used as such
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 189
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
dtrace -s /dev/stdin << EOT
self int n[1];
BEGIN { self->n[0] = 1; }
EOT
dtrace: script '/dev/stdin' matched 1 probe
dtrace: error on enabled probe ID 1 (ID 1: dtrace:::BEGIN): invalid address (0x0) in action #1 at DIF offset 24
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
Start by running the supplied DTrace script from the issue and confirm that declaring self->n as an array succeeds but assigning self->n[0] fails with an invalid address. Trace the TLS array declaration and indexed access handling in the DTrace implementation. Done means the example executes successfully without the invalid-address error.
Written by the indexing model from the issue text.
Assessment
- Domain
- observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100