From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11874 invoked by alias); 6 Nov 2009 01:08:30 -0000 Received: (qmail 11865 invoked by uid 22791); 6 Nov 2009 01:08:30 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from acsinet11.oracle.com (HELO acsinet11.oracle.com) (141.146.126.233) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Nov 2009 01:08:26 +0000 Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nA6194ko020045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Nov 2009 01:09:06 GMT Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nA5LleNJ025755; Fri, 6 Nov 2009 01:09:05 GMT Received: from abhmt007.oracle.com by acsmt355.oracle.com with ESMTP id 117944941257469683; Thu, 05 Nov 2009 17:08:03 -0800 Received: from dhcp-beijing-cdc-10-182-120-164.cn.oracle.com (/10.182.121.213) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Nov 2009 17:08:03 -0800 Message-ID: <4AF37691.6000601@oracle.com> Date: Fri, 06 Nov 2009 01:08:00 -0000 From: Wenji Huang Reply-To: wenji.huang@oracle.com User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: fche@redhat.com CC: "systemtap@sourceware.org" Subject: Re: [RFC PATCH] Fix segmentation fault of listing kprocess.create References: <20091105150217031.00000001204@ETSD-Ora-lap2> <20091105153851046.00000002852@ETSD-Ora-lap2> 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-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00449.txt.bz2 fche@redhat.com wrote: >>> /* trick from visit_target_symbol_context */ >>> target_symbol *tsym = new target_symbol; >>> token *t = new token; >>> tsym->tok = t; >>> tsym->base_name = "$"; >>> tsym->base_name += arg_name; > > Right, such an empty token should not exist. (We may be able to > remove this default constructor and force clients to fill in the > fields immediately.) > > When synthesizing new parse tree structures, the token pointer > assigned to the new objects usually relates to the original > script-level object that caused the synthesis. So for example in a > return probe that uses a saved entry-time $var, a whole new synthetic > probe and global variables could all be assigned to the same "$var" > token. > > Perhaps the recently introduced saveargs() function should be supplied > with an appropriate token*, for examples q.base_probe->tok. The empty token is from my patch for 10820, sorry for the error. Maybe the following patch can fix that. Regards, Wenji diff --git a/tapsets.cxx b/tapsets.cxx index d2c3334..17e315e 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2928,6 +2928,14 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex /* trick from visit_target_symbol_context */ target_symbol *tsym = new target_symbol; token *t = new token; + /* We hypothesize accessing the argument + * The source_loc will be base_loc since no real one */ + t->content = "$"; + t->content += arg_name; + t->type = tok_identifier; + t->location.file = q.base_loc->tok->location.file; + t->location.column = q.base_loc->tok->location.column; + t->location.line = q.base_loc->tok->location.line; tsym->tok = t; tsym->base_name = "$"; tsym->base_name += arg_name;