Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jun 2019 16:01:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 238333] bhyve random crash in rfb.c on FreeBSD current (after r346011)
Message-ID:  <bug-238333-27103-XrCRHxxP9c@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-238333-27103@https.bugs.freebsd.org/bugzilla/>
References:  <bug-238333-27103@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238333

--- Comment #19 from Mark Johnston <markj@FreeBSD.org> ---
Sorry, it occurred to me that the crash could also arise if we received
multiple encodings messages.  Please try this:

diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c
index d572037b25fe..0a0538f80e53 100644
--- a/usr.sbin/bhyve/rfb.c
+++ b/usr.sbin/bhyve/rfb.c
@@ -273,8 +273,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int c=
fd)
                        rc->enc_raw_ok =3D true;
                        break;
                case RFB_ENCODING_ZLIB:
-                       rc->enc_zlib_ok =3D true;
-                       deflateInit(&rc->zstream, Z_BEST_SPEED);
+                       if (!rc->enc_zlib_ok) {
+                               deflateInit(&rc->zstream, Z_BEST_SPEED);
+                               rc->enc_zlib_ok =3D true;
+                       }
                        break;
                case RFB_ENCODING_RESIZE:
                        rc->enc_resize_ok =3D true;

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238333-27103-XrCRHxxP9c>