oracle / oracle/dtrace

TLS struct variables should be allocated only for nonzero values

Open
#58 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.