This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Pointer chain paranoia
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Mike Mason" <mmlnx at us dot ibm dot com>, <systemtap at sources dot redhat dot com>
- Date: Tue, 14 Nov 2006 10:33:03 -0800
- Subject: RE: Pointer chain paranoia
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