public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword)
@ 2016-06-28 14:05 dsmith at redhat dot com
  2016-06-28 15:56 ` [Bug translator/20307] tapset/linux/rpc.stp error dsmith at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dsmith at redhat dot com @ 2016-06-28 14:05 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

            Bug ID: 20307
           Summary: tapset/linux/rpc.stp error (possible because of
                    'private' keyword)
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com
  Target Milestone: ---

I'm seeing something odd with rpc.stp:

====
# stap -vp4 ../src/testsuite/buildok/rpc-all-probes.stp 
Pass 1: parsed user script and 115 library scripts using
159296virt/42368res/8576shr/29248data kb, in 490usr/0sys/489real ms.
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at
/usr/local/share/systemtap/tapset/linux/rpc.stp:182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

Pass 2: analyzed script: 158 probes, 880 functions, 9 embeds, 1 global using
274048virt/159104res/10624shr/144000data kb, in 24400usr/490sys/24885real ms.
Pass 2: analysis failed.  [man error::pass2]
====

Off the top of my head, I'd guess that the 'private' keyword applied to that
global array is somehow causing this problem. '__rpc_create_args' is declared
in that file like:

====
@__private30 global __rpc_create_args                                           
====

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] tapset/linux/rpc.stp error
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
@ 2016-06-28 15:56 ` dsmith at redhat dot com
  2016-06-28 18:13 ` dsmith at redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dsmith at redhat dot com @ 2016-06-28 15:56 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|tapset/linux/rpc.stp error  |tapset/linux/rpc.stp error
                   |(possible because of        |
                   |'private' keyword)          |

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
This happened to me on RHEL7.2 ppc64. It does not happen on rawhide x86_64.
This would seem to indicate that 'private' isn't the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] tapset/linux/rpc.stp error
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
  2016-06-28 15:56 ` [Bug translator/20307] tapset/linux/rpc.stp error dsmith at redhat dot com
@ 2016-06-28 18:13 ` dsmith at redhat dot com
  2016-06-29 18:33 ` dsmith at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dsmith at redhat dot com @ 2016-06-28 18:13 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
Here's how __rpc_create_args is used (from tapset/linux/rpc.stp):

====
/*                                                                              
 * Newer kernels (> 2.6.18) compiled with gcc less than version                 
 * 4.4.3-16, tend to have debuginfo that doesn't include location               
 * information for inline function arguments.  This is a problem, since         
 * we need the arguments to rpc_new_client(), which is inline.  Since           
 * we can't get them for those kernels, we stash (and delete) the value         
 * of the 'args' parameter of rpc_create().  We then use this value             
 * when probing the inline version of rpc_new_client() (if we don't             
 * have the real arguments to that inline function).                            
 */                                                                             

@__private30 global __rpc_create_args                                           

probe kernel.function("rpc_create").call !,                                     
        module("sunrpc").function("rpc_create").call ?                          
{                                                                               
        __rpc_create_args[tid()] = $args                                        
}                                                                               

probe kernel.function("rpc_create").return !,                                   
        module("sunrpc").function("rpc_create").return ?                        
{                                                                               
        delete __rpc_create_args[tid()]                                         
}                                                                               
====

First, let's see if those entry points exist:

====
# stap -L 'module("sunrpc").function("rpc_create").*'
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:489").call $args:struct
rpc_create_args* $xprtargs:struct xprt_create $servername:char[]
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:489").callee("xprt_create_transport@net/sunrpc/xprt.c:1297")
$args:struct xprt_create*
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:489").exported
$args:struct rpc_create_args* $xprtargs:struct xprt_create $servername:char[]
module("sunrpc").function("rpc_create@net/sunrpc/clnt.c:489").return
$return:struct rpc_clnt* $args:struct rpc_create_args* $xprtargs:struct
xprt_create $servername:char[]
====

So, the module version of those entry points do exist. Now let's see if those
lines are in the pass 1 output:

====
# stap -vp1 ../src/testsuite/buildok/rpc-all-probes.stp | fgrep
__rpc_create_args
%}global __rpc_create_args
(__args) = (__rpc_create_args[tid()]);
(__rpc_create_args[tid()]) = ($args);
delete __rpc_create_args[tid()];
Pass 1: parsed user script and 117 library scripts using
160640virt/43776res/8640shr/30592data kb, in 3230usr/80sys/3347real ms.
====

Yes, the lines are present. So, perhaps the optimizer has optimized the array
away - so let's try things unoptimized:

====
# stap -uvp2 ../src/testsuite/buildok/rpc-all-probes.stp
Pass 1: parsed user script and 117 library scripts using
160576virt/43648res/8576shr/30528data kb, in 2750usr/10sys/2960real ms.
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
WARNING: cannot probe .return of 1 inlined functions  rpc_release_task
semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at
/usr/local/share/systemtap/tapset/linux/rpc.stp:182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

semantic error: unresolved arity-1 global array __rpc_create_args, missing
global declaration?: identifier '__rpc_create_args' at :182:12
        source:                 __args = __rpc_create_args[tid()]
                                         ^

Pass 2: analyzed script: 158 probes, 880 functions, 9 embeds, 1 global using
272896virt/158016res/10624shr/142848data kb, in 109990usr/2110sys/117436real
ms.
Pass 2: analysis failed.  [man error::pass2]
====

Same exact errors.

More investigation will be needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] tapset/linux/rpc.stp error
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
  2016-06-28 15:56 ` [Bug translator/20307] tapset/linux/rpc.stp error dsmith at redhat dot com
  2016-06-28 18:13 ` dsmith at redhat dot com
@ 2016-06-29 18:33 ` dsmith at redhat dot com
  2016-06-29 18:34 ` [Bug translator/20307] 'private' on tapset global arrays causes errors dsmith at redhat dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dsmith at redhat dot com @ 2016-06-29 18:33 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

--- Comment #3 from David Smith <dsmith at redhat dot com> ---
This does appear to be a problem with 'private'. I've duplicated the problem on
an x86_64 rawhide system with a small test case. I believe the rpc test didn't
fail on rawhide because of kernel differences (which mean that the internal
array isn't needed). 

====
# cat tapset/foo.stp
private global __fdarray

probe kernel.function("sys_read")
{
    __fdarray[tid()] = $fd
}
probe kernel.function("sys_read").return
{
    delete __fdarray[tid()]
}

probe foo_read = kernel.function("vfs_read")
{
    fd = __fdarray[tid()]
}
#
# cat test.stp 
probe foo_read {
    printf("%d\n", fd)
    exit()
}
#
# stap -v -I tapset test.stp
Pass 1: parsed user script and 118 library scripts using
242712virt/39428res/7532shr/32124data kb, in 190usr/40sys/241real ms.
semantic error: unresolved arity-1 global array __fdarray, missing global
declaration?: identifier '__fdarray' at tapset/foo.stp:14:10
        source:     fd = __fdarray[tid()]
                         ^

Pass 2: analyzed script: 3 probes, 181 functions, 3 embeds, 1 global using
287616virt/85752res/8828shr/77028data kb, in 1580usr/240sys/1830real ms.
Pass 2: analysis failed.  [man error::pass2]
====

If you remove 'private', this small test works fine.

Note that this problem was probably not noticed during 'private' development
since on RHEL7 ppc64 there is another error in rpc.stp due to missing
debuginfo.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] 'private' on tapset global arrays causes errors
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
                   ` (2 preceding siblings ...)
  2016-06-29 18:33 ` dsmith at redhat dot com
@ 2016-06-29 18:34 ` dsmith at redhat dot com
  2016-06-29 20:44 ` fche at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dsmith at redhat dot com @ 2016-06-29 18:34 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|tapset/linux/rpc.stp error  |'private' on tapset global
                   |                            |arrays causes errors

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] 'private' on tapset global arrays causes errors
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
                   ` (3 preceding siblings ...)
  2016-06-29 18:34 ` [Bug translator/20307] 'private' on tapset global arrays causes errors dsmith at redhat dot com
@ 2016-06-29 20:44 ` fche at redhat dot com
  2016-06-30 15:11 ` mcermak at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fche at redhat dot com @ 2016-06-29 20:44 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #4 from Frank Ch. Eigler <fche at redhat dot com> ---
probable fix:

diff --git a/elaborate.cxx b/elaborate.cxx
index 4a375d98098b..740e30c4bb74 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -2732,7 +2732,8 @@ symresolution_info::find_var (interned_string name, int
arity, const token* tok)
       for (unsigned j=0; j<f->globals.size(); j++)
         {
           vardecl* g = f->globals[j];
-          if (g->name == gname)
+          if ((g->name == gname) ||
+              (g->name == pname)) // private global within tapset
             {
              g->set_arity (arity, tok);

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] 'private' on tapset global arrays causes errors
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
                   ` (4 preceding siblings ...)
  2016-06-29 20:44 ` fche at redhat dot com
@ 2016-06-30 15:11 ` mcermak at redhat dot com
  2016-06-30 16:11 ` fche at redhat dot com
  2016-07-01  7:31 ` mcermak at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: mcermak at redhat dot com @ 2016-06-30 15:11 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mcermak at redhat dot com

--- Comment #5 from Martin Cermak <mcermak at redhat dot com> ---
(In reply to Frank Ch. Eigler from comment #4)
> probable fix:
> 
> diff --git a/elaborate.cxx b/elaborate.cxx
> index 4a375d98098b..740e30c4bb74 100644
> --- a/elaborate.cxx
> +++ b/elaborate.cxx
> @@ -2732,7 +2732,8 @@ symresolution_info::find_var (interned_string name,
> int arity, const token* tok)
>        for (unsigned j=0; j<f->globals.size(); j++)
>          {
>            vardecl* g = f->globals[j];
> -          if (g->name == gname)
> +          if ((g->name == gname) ||
> +              (g->name == pname)) // private global within tapset
>              {
>               g->set_arity (arity, tok);

This seems to solve the problem.  Full regression testing passed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] 'private' on tapset global arrays causes errors
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
                   ` (5 preceding siblings ...)
  2016-06-30 15:11 ` mcermak at redhat dot com
@ 2016-06-30 16:11 ` fche at redhat dot com
  2016-07-01  7:31 ` mcermak at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: fche at redhat dot com @ 2016-06-30 16:11 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Frank Ch. Eigler <fche at redhat dot com> ---
commit e5c209cfab83

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug translator/20307] 'private' on tapset global arrays causes errors
  2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
                   ` (6 preceding siblings ...)
  2016-06-30 16:11 ` fche at redhat dot com
@ 2016-07-01  7:31 ` mcermak at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: mcermak at redhat dot com @ 2016-07-01  7:31 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20307

--- Comment #7 from Martin Cermak <mcermak at redhat dot com> ---
Test covered in commit e23406b .

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-01  7:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28 14:05 [Bug translator/20307] New: tapset/linux/rpc.stp error (possible because of 'private' keyword) dsmith at redhat dot com
2016-06-28 15:56 ` [Bug translator/20307] tapset/linux/rpc.stp error dsmith at redhat dot com
2016-06-28 18:13 ` dsmith at redhat dot com
2016-06-29 18:33 ` dsmith at redhat dot com
2016-06-29 18:34 ` [Bug translator/20307] 'private' on tapset global arrays causes errors dsmith at redhat dot com
2016-06-29 20:44 ` fche at redhat dot com
2016-06-30 15:11 ` mcermak at redhat dot com
2016-06-30 16:11 ` fche at redhat dot com
2016-07-01  7:31 ` mcermak at redhat dot com

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).