[igt-dev] [PATCH i-g-t 3/6] runner: Continue using socket comms when getting an invalid packet
Kamil Konieczny
kamil.konieczny at linux.intel.com
Mon Nov 7 16:16:05 UTC 2022
On 2022-11-07 at 14:01:48 +0200, Petri Latvala wrote:
> If a packet of invalid size is received, inject a message in the dump,
> override result to warn, and continue grabbing packets.
>
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> Cc: Arkadiusz Hiler <arek at hiler.eu>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> runner/executor.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/runner/executor.c b/runner/executor.c
> index 1fcc9afe..c6389e25 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -1079,10 +1079,21 @@ static int monitor_output(pid_t child,
>
> packet = (struct runnerpacket *)buf;
> if (s < sizeof(*packet) || s != packet->size) {
> + struct runnerpacket *message, *override;
> +
> errf("Socket communication error: Received %zd bytes, expected %zd\n",
> s, s >= sizeof(packet->size) ? packet->size : sizeof(*packet));
> - close(socketfd);
> - socketfd = -1;
> + message = runnerpacket_log(STDOUT_FILENO,
> + "\nrunner: Socket communication error, invalid packet size. "
> + "Packet is discarded, test result and logs might be incorrect.\n");
> + write_packet_with_canary(outputs[_F_SOCKET], message, false);
> + free(message);
> +
> + override = runnerpacket_resultoverride("warn");
> + write_packet_with_canary(outputs[_F_SOCKET], override, settings->sync);
> + free(override);
> +
> + /* Continue using socket comms, hope for the best. */
> goto socket_end;
> }
>
> --
> 2.30.2
>
More information about the igt-dev
mailing list