From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19473 invoked by alias); 16 Jul 2007 22:53:19 -0000 Received: (qmail 19452 invoked by uid 22791); 16 Jul 2007 22:53:18 -0000 X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e3.ny.us.ibm.com (HELO e3.ny.us.ibm.com) (32.97.182.143) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Jul 2007 22:53:16 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id l6GLnAsD004024 for ; Mon, 16 Jul 2007 17:49:10 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.4) with ESMTP id l6GMr68C500628 for ; Mon, 16 Jul 2007 18:53:06 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l6GMr5SL005695 for ; Mon, 16 Jul 2007 18:53:05 -0400 Received: from [127.0.0.1] (wecm-9-67-65-20.wecm.ibm.com [9.67.65.20]) by d01av01.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l6GMr3q8005579; Mon, 16 Jul 2007 18:53:05 -0400 Message-ID: <469BF6BC.1060602@us.ibm.com> Date: Mon, 16 Jul 2007 23:10:00 -0000 From: Mike Mason User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Roland McGrath CC: systemtap@sourceware.org Subject: Re: kread() and NULL pointers References: <20070716204257.F200B4D05BE@magilla.localdomain> In-Reply-To: <20070716204257.F200B4D05BE@magilla.localdomain> 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-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00130.txt.bz2 Roland McGrath wrote: >> Does kread() generate an error if you pass it a NULL pointer? > > Yes. It's safely caught like all errors, but it only returns successfully > when given a valid pointer. So should the following generate an error? It doesn't. It just prints "ptr = 0" and exits. function test_addr:long () %{ void *nullptr = NULL; THIS->__retvalue = (long) kread(&(nullptr)); CATCH_DEREF_FAULT(); %} probe begin { ptr = test_addr() printf("ptr = %d\n", ptr) exit() }