在 C++ 项目的上下文中使用 valgrind,我一直在尝试抑制来自第三方库中的
uninitialised byte
的信息。如何针对以下类似警告生成特定抑制?system calls
Syscall param sendmsg(msg.msg_iov[12]) points to uninitialised byte(s)
==9473== at 0x740E6F7: sendmsg (sendmsg.c:28)
==9473== by 0xA2AB34A: tcp_send(int, msghdr const*, int) (in /usr/local/lib/libgrpc.so.15.0.0)
==9473== by 0xA2ACB6C: tcp_flush((anonymous namespace)::grpc_tcp*, grpc_error**) (in /usr/local/lib/libgrpc.so.15.0.0)
Syscall param sendmsg(msg.msg_iov) points to uninitialised byte(s)
==9473== at 0x740E6F7: sendmsg (sendmsg.c:28)
==9473== by 0xA2AB34A: tcp_send(int, msghdr const*, int) (in /usr/local/lib/libgrpc.so.15.0.0)
==9473== by 0xA2ACB6C: tcp_flush((anonymous namespace)::grpc_tcp*, grpc_error**) (in /usr/local/lib/libgrpc.so.15.0.0)
我都试过了
Syscall param sendmsg(msg.msg_iov[2]) points to uninitialised byte(s)
==9473== at 0x740E6F7: sendmsg (sendmsg.c:28)
==9473== by 0xA2AB34A: tcp_send(int, msghdr const*, int) (in /usr/local/lib/libgrpc.so.15.0.0)
==9473== by 0xA2ACB6C: tcp_flush((anonymous namespace)::grpc_tcp*, grpc_error**) (in /usr/local/lib/libgrpc.so.15.0.0)
和
{
sendmsg_uninitialized_bytes
Memcheck:Param
sendmsg(msg.msg_iov)
fun:sendmsg
}
但是,它们都不起作用。
这是一个抑制示例:
{
sendmsg_uninitialized_bytes
Memcheck:Param
sendmsg(msg.msg_iov*)
fun:sendmsg
}
希望这对解决这个问题有帮助。