oracle / dtrace-utils

DTrace-utils contains the DTrace port to Linux
Other
133 stars 19 forks source link

TLS variables (self->x) can be declared with an array datatype but cannot be used as such #61

Open kvanhees opened 2 years ago

kvanhees commented 2 years ago

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

kvanhees commented 2 years ago

For reference: this behaves the same in BPF-based DTrace as it does with legacy DTrace. So this is actually an issue with the overall implementation of TLS variables in D.