Bug 5516 - stap can not overwrite kernel local variables in guru mode
Summary: stap can not overwrite kernel local variables in guru mode
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Frank Ch. Eigler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-20 22:08 UTC by Masami Hiramatsu
Modified: 2008-03-03 21:37 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masami Hiramatsu 2007-12-20 22:08:15 UTC
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.
Comment 1 Frank Ch. Eigler 2008-03-02 19:26:59 UTC
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.
Comment 2 Masami Hiramatsu 2008-03-03 15:03:27 UTC
(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?
Comment 3 Frank Ch. Eigler 2008-03-03 15:39:20 UTC
> > 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.

Comment 4 Frank Ch. Eigler 2008-03-03 21:37:23 UTC
patch committed