This is the mail archive of the systemtap@sources.redhat.com mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variables in scopes


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

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]