public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/14389] New: sprintf not formatting "%#o" output properly
@ 2012-07-23 19:34 dsmith at redhat dot com
  2012-07-23 19:52 ` [Bug runtime/14389] " jistone at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: dsmith at redhat dot com @ 2012-07-23 19:34 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14389

             Bug #: 14389
           Summary: sprintf not formatting "%#o" output properly
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
        AssignedTo: systemtap@sourceware.org
        ReportedBy: dsmith@redhat.com
    Classification: Unclassified


The "%#o" formatting string isn't handling the value of 0 properly.  '0' should
be formatted as '0', not '00'.

# stap -gve 'probe begin { x = sprintf("%#o", 0); printf("%s\n", x) }'
Pass 1: parsed user script and 86 library script(s) using
149332virt/24016res/2860shr/21924data kb, in 140usr/60sys/205real ms.
Pass 2: analyzed script: 1 probe(s), 0 function(s), 0 embed(s), 0 global(s)
using 149860virt/24764res/3112shr/22452data kb, in 10usr/0sys/6real ms.
Pass 3: translated to C into
"/tmp/stapRQJcEh/stap_0612925ba7f9e19831f534939ef39418_706_src.c" using
149860virt/25052res/3376shr/22452data kb, in 0usr/0sys/2real ms.
Pass 4: compiled C into "stap_0612925ba7f9e19831f534939ef39418_706.ko" in
3760usr/1410sys/5145real ms.
Pass 5: starting run.
00
Pass 5: run completed in 30usr/100sys/2140real ms.


(This is causing a failure in the nd_syscall.exp testcase for umask, because
the nd_syscall probe uses the 'returnstr' function, which uses the kernel's
snprintf() function which correctly handles 0.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

* [Bug runtime/14389] sprintf not formatting "%#o" output properly
  2012-07-23 19:34 [Bug runtime/14389] New: sprintf not formatting "%#o" output properly dsmith at redhat dot com
@ 2012-07-23 19:52 ` jistone at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: jistone at redhat dot com @ 2012-07-23 19:52 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=14389

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> 2012-07-23 19:52:31 UTC ---
(In reply to comment #0)
> The "%#o" formatting string isn't handling the value of 0 properly.  '0' should
> be formatted as '0', not '00'.
[...]
> (This is causing a failure in the nd_syscall.exp testcase for umask, because
> the nd_syscall probe uses the 'returnstr' function, which uses the kernel's
> snprintf() function which correctly handles 0.)

Seems like just a difference of opinion to me.  We also print %#x,0 as 0x0,
which I know differs from glibc, but I'm not sure what the kernel does with
that.

We could just as well flip this that returnstr() ought to be using stap's own
formatting functions for consistency...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

end of thread, other threads:[~2012-07-23 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-23 19:34 [Bug runtime/14389] New: sprintf not formatting "%#o" output properly dsmith at redhat dot com
2012-07-23 19:52 ` [Bug runtime/14389] " jistone 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).