[Bug tapsets/19489] printing array from memory

fche at redhat dot com sourceware-bugzilla@sourceware.org
Mon Jan 18 14:27:00 GMT 2016


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

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

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

--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
Thanks for your report.

The core of the problem appears to be our use of user_string_n2_quoted in the
syscall.write alias (see .../tapset/linux/syscalls2.stp), specifically the
interpretation of the "n".  The function interprets it as a maximum, not an
exact buffer length (see [man function::user_string_n2_quoted]'s mention of C
strings).

We could revise the behaviour of that function to treat its input as a buffer
of definite size, if most or all other uses of that function would benefit.

In the interim, you can use

    printf("%.*M", $count, $buf)

(note the    ^    dot!)

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


More information about the Systemtap mailing list