From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18343 invoked by alias); 21 Feb 2012 21:03:19 -0000 Received: (qmail 18330 invoked by uid 22791); 21 Feb 2012 21:03:17 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Feb 2012 21:02:30 +0000 From: "dsmith at redhat dot com" To: systemtap@sourceware.org Subject: [Bug tapsets/13721] New: local variable name collision Date: Tue, 21 Feb 2012 21:03:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: tapsets X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dsmith at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-q1/txt/msg00164.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13721 Bug #: 13721 Summary: local variable name collision Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: tapsets AssignedTo: systemtap@sourceware.org ReportedBy: dsmith@redhat.com Classification: Unclassified Defining a global array with the name of 'addr' fails: ======= # stap -vp4 -e 'global addr; probe begin { addr[AF_INET()] = "addr" }' Pass 1: parsed user script and 81 library script(s) using 200892virt/22856res/2812shr kb, in 140usr/40sys/170real ms. semantic error: inconsistent arity (1 vs 0): identifier 'addr' at /usr/local/share/systemtap/tapset/nfs_proc.stp:72:2 source: addr = &@cast(cl_xprt, "rpc_xprt", "kernel:sunrpc")->addr ^ semantic error: arity 1 first inferred here: identifier 'addr' at :1:28 source: global addr; probe begin { addr[AF_INET()] = "addr" } ^ semantic error: inconsistent arity (1 vs 0): identifier 'addr' at /usr/local/share/systemtap/tapset/nfs_proc.stp:77:12 source: if (@cast(addr, "sockaddr_in")->sin_family != %{ /* pure */ AF_INET %}) { ^ semantic error: inconsistent arity (1 vs 0): identifier 'addr' at /usr/local/share/systemtap/tapset/nfs_proc.stp:81:15 source: return @cast(addr, "sockaddr_in")->sin_addr->s_addr ^ Pass 2: analyzed script: 1 probe(s), 42 function(s), 1 embed(s), 1 global(s) using 437688virt/122488res/8384shr kb, in 1560usr/340sys/1927real ms. Pass 2: analysis failed. Try again with another '--vp 01' option. ======= This is happening because the port_from_xprt() function has a local variable named 'addr' that is somehow clashing with the global 'addr' variable which has a different type. Evidently this happens before the port_from_xprt() function gets optimized away. This can be worked around by prepending '__' to the name of the port_from_xprt() local variable. There are probably other local function variables in the tapset that could clash with user variables. (The error message could perhaps use an improvement. The word 'arity' isn't a common one and probably doesn't translate well.) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.