trace: Initialize USDT arguments to 0 before reading (#725)
Fixes #722, in which a USDT probe that has more than
one location and the type of the argument is a string
caused trace to potentially access an uninitialized
stack variable, thereby not passing BPF program
verification at load time.
diff --git a/tools/trace.py b/tools/trace.py
index 0cb1c3e..6722bea 100755
--- a/tools/trace.py
+++ b/tools/trace.py
@@ -301,7 +301,7 @@
expr = self.values[idx].strip()
text = ""
if self.probe_type == "u" and expr[0:3] == "arg":
- text = (" u64 %s;\n" +
+ text = (" u64 %s = 0;\n" +
" bpf_usdt_readarg(%s, ctx, &%s);\n") % \
(expr, expr[3], expr)