This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/19489] printing array from memory


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]