consistent printf race conditions

Nicholas Murphy halcyonic@gmail.com
Thu Oct 25 04:08:00 GMT 2012


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



More information about the Systemtap mailing list