I got semantic error when I compiled a script which overwrote a kernel local variable in guru-mode. --- probe kernel.function("icmp_rcv") { printf("skb = %x\n", $skb); $skb = 0; } --- (NOTE: this script will crash kernel, so don't run it.) Here is an error log. $ stap -vg -p3 mini.stp Pass 1: parsed user script and 38 library script(s) in 230usr/20sys/657real ms. semantic error: Expecting symbol or array index expression: identifier '$skb' at <input>:3:9 Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s) in 340usr/430sys/8696real ms. semantic error: unknown type of arg to print operator: identifier '$skb' at <input>:2:30 Pass 3: translated to C into "/tmp/stapUtkYiN/stap_4974e47d8036f6f2354d350ccb2ada6a_556.c" in 0usr/0sys/0real ms. Pass 3: translation failed. Try again with more '-v' (verbose) options.
Two errors here: Proper error messages are being lost by triggering exceptions early during symbolic/optimization processing rather type checking. Target pointers don't allow themselves to be overwritten.
(In reply to comment #1) > Target pointers don't allow themselves to be overwritten. Could you tell me why we can't overwrite the pointers?
> > Target pointers don't allow themselves to be overwritten. > Could you tell me why we can't overwrite the pointers? I can't think of a good reason, so it's the second "error", by which I meant "bug", that I'll try to fix.
patch committed