variables in scopes

Frank Ch. Eigler fche@redhat.com
Thu Apr 14 21:17:00 GMT 2005


Hi -


On Thu, Apr 14, 2005 at 02:05:29PM -0700, Jim Keniston wrote:
> [...]
> > Please be more specific.  Having implicitly declared and typed
> > systemtap variables poses a crash risk to the kernel how?
> 
> probe s;	// array of pointers to structs
> j = -1;
> ...
> jj = what_j_should_be;	// misspelled "j" as "jj"
> ... s[j]->foo ...
> 
> This gives you at least a stray memory reference.  

That would at worst yield some garbage.

> If it's an assignment to s[j]->foo, it scribbles on God-knows-what.

It is obvious that any assignment like this, if at all supported,
would be a guru-mode-only operation.

Can you please spell out how this relates to implicitly typed/declared
variables?  How might the same mistake not be made in C?


> > [...] Can you provide motivation for each
> > of these constructs as really useful/necessary to a systemtap user?
> > They clearly toss the barn door wide open.
>
> Yes, I'm sure I could, but I think we agree that it would more
> useful to create real-world instrumentation and see which features
> we need.  [so let's build it and see if it is needed].

Er, ok, if such an experiment were of disposably low cost, I wouldn't
stand in its way.  But really we ought to be able to do at least a bit
of thought-experimenting before coding.


- FChE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20050414/cb20b73f/attachment.sig>


More information about the Systemtap mailing list