From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31238 invoked by alias); 14 Nov 2006 21:12:56 -0000 Received: (qmail 31226 invoked by uid 22791); 14 Nov 2006 21:12:55 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e5.ny.us.ibm.com (HELO e5.ny.us.ibm.com) (32.97.182.145) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 14 Nov 2006 21:12:49 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.13.8/8.12.11) with ESMTP id kAELCiQu024932 for ; Tue, 14 Nov 2006 16:12:44 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id kAELCOEX221408 for ; Tue, 14 Nov 2006 16:12:27 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id kAELCNgV017716 for ; Tue, 14 Nov 2006 16:12:23 -0500 Received: from [127.0.0.1] (IBM-5A3C6334CF9-009047017074.beaverton.ibm.com [9.47.17.74]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id kAELCI19017367; Tue, 14 Nov 2006 16:12:23 -0500 Message-ID: <455A3128.4050509@us.ibm.com> Date: Tue, 14 Nov 2006 21:21:00 -0000 From: Mike Mason User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: "Stone, Joshua I" CC: systemtap@sources.redhat.com Subject: Re: Pointer chain paranoia References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q4/txt/msg00432.txt.bz2 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