On Tue, Aug 31, 2021 at 01:13:40AM +0300, Michael Tokarev wrote:
> dann, can you please add a printf to util/qemu-sockets.c
> before the assert() which is failing, to see what's the
> value of salen? since you can reproduce this..
> I'm still not 100% sure what the actual problem is -
> or _which_ problem it is in particular.
> 
> It is either one byte too large (for the trailing \0)
> or one byte too small (with zero-length sun_path).
> 
> Like this:
> 
> diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
> index f2f3676d1f..89a405476a 100644
> --- a/util/qemu-sockets.c
> +++ b/util/qemu-sockets.c
> @@ -1345,6 +1345,10 @@ socket_sockaddr_to_address_unix(struct 
> sockaddr_storage *sa,
>      SocketAddress *addr;
>      struct sockaddr_un *su = (struct sockaddr_un *)sa;
> 
> +if(!(salen >= sizeof(su->sun_family) + 1 &&
> +           salen <= sizeof(struct sockaddr_un)))
> +  fprintf(stderr, "about to fire assert: salen=%d\n", salen);
> +
>      assert(salen >= sizeof(su->sun_family) + 1 &&
>             salen <= sizeof(struct sockaddr_un));

char device redirected to /dev/pts/14 (label charserial0)
about to fire assert: salen=2
qemu-system-x86_64: ../../util/qemu-sockets.c:1352: 
socket_sockaddr_to_address_unix: Assertion `salen >= sizeof(su->sun_family) + 1 
&& salen <= sizeof(struct sockaddr_un)' failed.
2021-08-31 15:01:18.082+0000: shutting down, reason=crashed

Reply via email to