Memory Sanitizer reports use of uninitialized stream/pstream pointers
while recording results of open/listen:
WARNING: MemorySanitizer: use-of-uninitialized-value
0 0x7c48cf in pstream_open lib/stream.c:567:5
1 0x7c71ed in pstream_open_with_default_port lib/stream.c:772:13
2 0x6c7731 in jsonrpc_pstream_open lib/jsonrpc.c:80:12
3 0x509345 in ovsdb_jsonrpc_server_add_remote ovsdb/jsonrpc-server.c:374:13
4 0x508eed in ovsdb_jsonrpc_server_set_remotes ovsdb/jsonrpc-server.c:355:22
5 0x4dca59 in reconfigure_remotes ovsdb/ovsdb-server.c:1778:5
6 0x4c9d42 in reconfigure_ovsdb_server ovsdb/ovsdb-server.c:686:19
7 0x4c432a in main ovsdb/ovsdb-server.c:788:10
8 0x7fb979 in __libc_start_call_main
9 0x7fb979 in __libc_start_main@GLIBC_2.2.5
10 0x432b64 in _start (ovsdb/ovsdb-server+0x432b64)
It complains just about the function call even if the value inside the
function is not being used. Can be fixed by initializing the stream
pointer to NULL. However, there is a possibility of it being used when
we also fail to record the result. We should be using the provided
name in the error log instead of trying to access the name through the
potentially uninitialized or NULL pointer.
While at it, also fixing the log message to be more accurate.
Fixes: fae1ae0434cd ("stream: Add record/replay functionality.")
Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
For debugging purposes it is useful to be able to record all the
incoming transactions and commands and replay them locally under
debugger or with additional logging enabled. This patch introduces
ability to record all the incoming stream data and replay it via new
stream provider named 'stream-replay'. During the record phase all
the incoming stream data written to special replay_* files in the
application rundir. On replay phase instead of opening real streams
application will open replay_* files and read all the incoming data
directly from them.
If enabled for ovsdb-server, for example, this allows to record all
the connections and transactions from the big setup and replay them
locally afterwards to debug the behaviour or test performance.
To start application in recording mode there is a --record cmdline
option. --replay is to replay previously recorded streams.
Current version doesn't work well with time-based stream events like
inactivity probes or any other events generated internally. This is
a point for further improvement.
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>