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]

Re: consistent printf race conditions


Here's clean_string():
-----
function clean_string:string(str:string) {
    newstr = str_replace(str, "\"", "|||q")
    newstr = str_replace(newstr, "\n", "|||n")

    return newstr
}
-----

It's not happening as often as I'd thought...if I see it happening more, I'll try to capture it using the method you described and will let you know.

Thanks!

Nick

On Oct 24, 2012, at 8:48 PM, fche@redhat.com (Frank Ch. Eigler) wrote:

> 
> Hi, Nicholas -
> 
> 
> halcyonic wrote:
> 
>> Scripts below.  [...]
>> probe syscall.close.return { [...]
>>        printf("{\"execname\":\"%s\",\"fd\":%d,\"op\":\"%s\",\"pid\":%d,\"ppid\":%d,\"return\":%d,\"timestamp\":%d,\"uid
>> \":%d}\n",clean_string(execname()),$fd,clean_string("CLOSE"),pid(),ppid(),$return,gettimeofday_ms(),uid())
>> [...]
> 
> What does clean_string() look like?  Does it by any chance run
> sprintf() or similar?
> 
> 
>> Here's some output surrounding one of those errors (changed some
>> values for security):
> 
> Could you try stap -b (bulk mode), resulting in some per-cpu trace files,
> and then stap_merge'ing them back together?
> 
> 
> - FChE


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