public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* RE: Pointer chain paranoia
@ 2006-11-14 21:29 Stone, Joshua I
  0 siblings, 0 replies; 7+ messages in thread
From: Stone, Joshua I @ 2006-11-14 21:29 UTC (permalink / raw)
  To: Mike Mason; +Cc: systemtap

On Tuesday, November 14, 2006 1:12 PM, Mike Mason wrote:
> Are pointer chain references in the regular stap language (not
> embedded C) always safe?  In other words, if I use something of the
> form $ptr1->ptr2->ptr3->var, does stap automatically convert that to
> the needed deref() macros? I looked at the resulting module code and
> I think it does, but want to be sure.    

Yes, dereferencing in the script language is guaranteed safe.  If you
find a case where it's not protecting the access, that's a bug.

We really should hold tapsets to the same standard -- unprotected
dereferencing should be treated as a bug.  (Some will be dependent on
bug #3079 though...)

Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Pointer chain paranoia
@ 2006-11-14 18:36 Stone, Joshua I
  2006-11-14 19:23 ` Vara Prasad
  2006-11-14 21:21 ` Mike Mason
  0 siblings, 2 replies; 7+ messages in thread
From: Stone, Joshua I @ 2006-11-14 18:36 UTC (permalink / raw)
  To: Mike Mason, systemtap

On Tuesday, November 14, 2006 9:15 AM, Mike Mason wrote:
> I'm looking for opinions from the systemtap community... How paranoid
> should we be when following pointer chains in tapsets and scripts?  I
> think we should use deref() unless we're absolutely sure there's no
> chance of referencing a null or bad pointer, but, of course, that'll
> add a lot of code. I'm not sure how you can ever be absolutely sure,
> particularly for longer chains.  What guidance should we give tapset
> and script writers?      
> 
> Mike

I agree with you.  Safety is always more important than efficiency,
especially in tapsets which may be used by non-guru users.  Any
questionable pointers should be carefully dereferenced, e.g., parameters
passed to functions should be assumed bogus.

When a pointer is known to originate from a kernel source, like from
'current' or as a return value from a kernel function, then we might
relax a bit.


Josh

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Pointer chain paranoia
@ 2006-11-14 18:33 Mike Mason
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Mason @ 2006-11-14 18:33 UTC (permalink / raw)
  To: systemtap

I'm looking for opinions from the systemtap community... How paranoid should we be when following pointer chains in tapsets and scripts?  I think we should use deref() unless we're absolutely sure there's no chance of referencing a null or bad pointer, but, of course, that'll add a lot of code. I'm not sure how you can ever be absolutely sure, particularly for longer chains.  What guidance should we give tapset and script writers?

Mike


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-11-14 21:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-14 21:29 Pointer chain paranoia Stone, Joshua I
  -- strict thread matches above, loose matches on Subject: below --
2006-11-14 18:36 Stone, Joshua I
2006-11-14 19:23 ` Vara Prasad
2006-11-14 19:25   ` Roland McGrath
2006-11-14 21:21 ` Mike Mason
2006-11-15 10:06   ` Roland McGrath
2006-11-14 18:33 Mike Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).