public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mike Mason <mmlnx@us.ibm.com>
To: "Stone, Joshua I" <joshua.i.stone@intel.com>
Cc: systemtap@sources.redhat.com
Subject: Re: Pointer chain paranoia
Date: Tue, 14 Nov 2006 21:21:00 -0000	[thread overview]
Message-ID: <455A3128.4050509@us.ibm.com> (raw)
In-Reply-To: <C56DB814FAA30B418C75310AC4BB279DEEF8FD@scsmsx413.amr.corp.intel.com>

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.

Mike

Stone, Joshua I wrote:
> 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

  parent reply	other threads:[~2006-11-14 21:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2006-11-15 10:06   ` Roland McGrath
  -- strict thread matches above, loose matches on Subject: below --
2006-11-14 21:29 Stone, Joshua I
2006-11-14 18:33 Mike Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=455A3128.4050509@us.ibm.com \
    --to=mmlnx@us.ibm.com \
    --cc=joshua.i.stone@intel.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).