public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/16616] New: the 'servername' convenience variable returned by the rpc tapset can be NULL
@ 2014-02-20 22:56 dsmith at redhat dot com
  2014-02-20 23:22 ` [Bug tapsets/16616] " jistone at redhat dot com
  2014-02-25 19:27 ` dsmith at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2014-02-20 22:56 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 16616
           Summary: the 'servername' convenience variable returned by the
                    rpc tapset can be NULL
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: dsmith at redhat dot com

The 'servername' convenience variable returned by the rpc tapset can be NULL.
This causes the following systemtap error:

====
ERROR: kernel string copy fault at 0x          (null) near identifier
'kernel_string' at /usr/share/systemtap/tapset/linux/conversions.stp:18:10
====

From some debugging, it looks like that sometimes the the underlying kernel
variable is just NULL. Systemtap giving an error there is somewhat correct,
since the value *is* NULL.

However, there is some code in rpc_create() that if it finds a NULL servername,
it creates a string representation of the passed-in address, and uses that for
the servername. Systemtap could try to duplicate that logic.

(And what is up with all the extra space in that '0x          (null)' string?)

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

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

* [Bug tapsets/16616] the 'servername' convenience variable returned by the rpc tapset can be NULL
  2014-02-20 22:56 [Bug tapsets/16616] New: the 'servername' convenience variable returned by the rpc tapset can be NULL dsmith at redhat dot com
@ 2014-02-20 23:22 ` jistone at redhat dot com
  2014-02-25 19:27 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2014-02-20 23:22 UTC (permalink / raw)
  To: systemtap

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

Josh Stone <jistone at redhat dot com> changed:

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

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
(In reply to David Smith from comment #0)
> (And what is up with all the extra space in that '0x          (null)' string?)

We use the kernel snprintf with "0x%p", which has this comment:

  /*
   * Print (null) with the same width as a pointer so it makes
   * tabular output look nice.
   */

The default width is 2*sizeof(void*), and since we wrote "0x" ourselves, that
will show up no matter what.

If we want to be cleaner and/or more compact, we could try "%#1p" instead.

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

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

* [Bug tapsets/16616] the 'servername' convenience variable returned by the rpc tapset can be NULL
  2014-02-20 22:56 [Bug tapsets/16616] New: the 'servername' convenience variable returned by the rpc tapset can be NULL dsmith at redhat dot com
  2014-02-20 23:22 ` [Bug tapsets/16616] " jistone at redhat dot com
@ 2014-02-25 19:27 ` dsmith at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: dsmith at redhat dot com @ 2014-02-25 19:27 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

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

--- Comment #2 from David Smith <dsmith at redhat dot com> ---
Fixed in commit 1f09b39. This commit uses the new '__rpc_format_servername'
function to properly generate the 'servername' variable.

Unfortunately, I couldn't use "%#1p" to format the NULL pointer. GCC doesn't
allow '#' to be used with '%p' - you get the following error:

  error: '#' flag used with ‘%p’ gnu_printf format [-Werror=format=]

So, I ended up just removing our hardcoded '0x' (since we have lots of other
places we print pointers without '0x') and changed the format from '%p' to
'%1p'.

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

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

end of thread, other threads:[~2014-02-25 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 22:56 [Bug tapsets/16616] New: the 'servername' convenience variable returned by the rpc tapset can be NULL dsmith at redhat dot com
2014-02-20 23:22 ` [Bug tapsets/16616] " jistone at redhat dot com
2014-02-25 19:27 ` dsmith 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).