]> sourceware.org Git - systemtap.git/commit
PR26131: garbled data might appear in staprun data channel output
authorYichun Zhang (agentzh) <yichun@openresty.com>
Mon, 22 Jun 2020 03:57:35 +0000 (20:57 -0700)
committerYichun Zhang (agentzh) <yichun@openresty.com>
Mon, 22 Jun 2020 04:17:20 +0000 (21:17 -0700)
commit469d20e8b160b0aadb04b65d7c35063fb02879c3
treed9d07163a88e6d02dbeeedb71a309faaedf17f1c
parent36430614d342020dc4c76f4ac5531ae84f211aab
PR26131: garbled data might appear in staprun data channel output

The relay v2 data writing lacked inode locking protection against
concurrent readers (on the stapio side).

The garbled data often contains '\0' bytes and might replace good data
or get appended to the good data stream.

Because the context of relay data writers may not allow sleeping, we use
a simple bounded spinlock to acquire the inode lock at our best effort
(up to about 300K cycles). Data loss might occur when we fail to obtain
the inode lock in which case it will be recorded as a "transportation
failure" and will get reported as a warning message. Increasing the
buffer size via 'staprun -b SIZE' would help reduce the risk of lock
contention.

The relay v1 implementation is not covered in this patch since it is old
and not even used on CentOS 6.

Succcessfully stress-tested on CentOS 6, CentOS 7, and Fedora 28. Also
tested with the kernel-debug packages' kernels on CentOS 7 and Fedora 28.
runtime/print_flush.c
runtime/transport/relay_v2.c
runtime/transport/relayfs.c
runtime/transport/ring_buffer.c
runtime/transport/transport.c
runtime/transport/transport.h
staprun/relay.c
This page took 0.02759 seconds and 5 git commands to generate.