From owner-freebsd-emulation@FreeBSD.ORG Thu Jun 12 14:29:27 2014 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FD9A8A0 for ; Thu, 12 Jun 2014 14:29:27 +0000 (UTC) Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 314A72361 for ; Thu, 12 Jun 2014 14:29:27 +0000 (UTC) Received: by mail-oa0-f47.google.com with SMTP id n16so1407452oag.20 for ; Thu, 12 Jun 2014 07:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bluelife.at; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=+LQjdWjyRg3XJ7cb4EpUfGQtWW9vgvcNCD48K+wwilI=; b=GLnq5r64d4tj1ahMiC0dIAPsLNfLvYVwNe86hV33mXUBUrLHZvsw8KEXHCbl6aEQ5D Gq+HK2yfpgZu60b6fYTJFGaZuqh6A9qbnx0++4n/5GFlZfXjsfAIuxOHokK1gq1ZsahV 3ve8ery4bNhDCi3lkeAkisluvwzJEX/jNPbwE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+LQjdWjyRg3XJ7cb4EpUfGQtWW9vgvcNCD48K+wwilI=; b=c4Qj/wRQaH2GbO+egh7aHQ+ZrII/YFHhP94tM1LoVrxDTwwAm+sgoDHdeE9hytgZ+6 9FW0bvcZHXOrHqxjnAlu6pyRky2R8ZujZscK4HdJhX6lkqjqXY6cgRDr3REZExqVmWG0 zMAhI/oYjUdSiVe6ODJrPAXGp9aZXZblcnNJKfUo17KfHjmkD4WqUS9+Nw3YKXVm4q9X nLo/KkKPw6E15ixKp4WlekkzEIqaUKJjSkOX95CcDDnDsTcfRktgeMwvOONXMKbuxqP0 RKow+jkZCGabbFZu5VaANxCxp2UwB4Bx+gCSLlE5y1noDlR2flDlBeK3rqJx+9jEGG1a EobA== X-Gm-Message-State: ALoCoQna/4IqucV4Ldj7sfNY9RkFa1OyeLF7qAbGDsda/hbJM5gos62dWf28Dzt4GSPcyKkH3Vmv MIME-Version: 1.0 X-Received: by 10.182.153.163 with SMTP id vh3mr2626651obb.85.1402583366237; Thu, 12 Jun 2014 07:29:26 -0700 (PDT) Sender: decke@bluelife.at Received: by 10.76.131.113 with HTTP; Thu, 12 Jun 2014 07:29:26 -0700 (PDT) X-Originating-IP: [2001:470:1f15:673::1000] In-Reply-To: References: Date: Thu, 12 Jun 2014 16:29:26 +0200 X-Google-Sender-Auth: WesNHr1QiK_GQT1UN3RhARWdwlE Message-ID: Subject: Re: FreeBSD Port: emulators/virtualbox-ose From: =?UTF-8?Q?Bernhard_Fr=C3=B6hlich?= To: Ron Thomas Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-emulation@freebsd.org" X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 14:29:27 -0000 On Thu, Jun 12, 2014 at 3:17 AM, Ron Thomas wrote: > Not sure if this is the right venue for this, if not, could you point me in > the right direction? You're absolutely at the right place. > VBoxHeadless crashes on VNC disconnect. Every time I close a VNC session > VBoxHeadless crashes. I am starting VirtualBox using "service vboxheadless > start" > > #uname -a > FreeBSD my.domain.com 9.2-RELEASE-p6 FreeBSD 9.2-RELEASE-p6 #0: Tue May 13 > 08:21:53 UTC 2014 > root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC > amd64 > > #pkg version | grep 'virtualbox' > virtualbox-ose-4.3.12_1 = > virtualbox-ose-kmod-4.3.12 = > > Installed with following options: > DBUS > DEBUG > GUESTADDITIONS > PYTHON > UDPTUNNEL > VNC > > > (gdb) backtrace > #0 0x0000000805963e48 in ConsoleVRDPServer::AuthDisconnect > (this=0x805013f00, uuid=@0x7ffffeeb3ce0, u32ClientId=4294967295) at > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.12/src/VBox/Main/src-client/ConsoleVRDPServer.cpp:3339 > #1 0x0000000805919ddb in Console::VRDPClientDisconnect (this=0x805095800, > u32ClientId=4294967295, fu32Intercepted=0) at > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.12/src/VBox/Main/src-client/ConsoleImpl.cpp:1411 > #2 0x000000080596962c in ConsoleVRDPServer::VRDPCallbackIntercept > (pvCallback=0x805013f00, u32ClientId=4294967295, fu32Intercept=0, > ppvIntercept=0x80596962c) > at > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.12/src/VBox/Main/src-client/ConsoleVRDPServer.cpp:1016 > #3 0x00000008084014c0 in VNCServerImpl::clientGoneHook (cl=0x80a078000) at > /usr/ports/emulators/virtualbox-ose/work/VirtualBox-4.3.12/src/VBox/ExtPacks/VNC/VBoxVNC.cpp:1294 > #4 0x00000008086178f8 in rfbClientConnectionGone () from > /usr/local/lib/libvncserver.so.0 > #5 0x0000000808611dec in clientInput () from > /usr/local/lib/libvncserver.so.0 > #6 0x0000000800829d34 in pthread_getprio () from /lib/libthr.so.3 > #7 0x0000000000000000 in ?? () The stacktrace looks very much like a bug in libvncserver. There is no information passed to libvncserver that makes me believe that the passed data is wrong so I guess it this is nothing that VBox can fix. https://www.virtualbox.org/browser/vbox/trunk/src/VBox/ExtPacks/VNC/VBoxVNC.cpp#L1297 It might be worth trying to recompile libvncserver port with debug options to get a full stacktrace but it is somewhere here: https://github.com/LibVNC/libvncserver/blob/79e68d065004b24811d68e211c27b918654aabed/libvncserver/main.c#L509 and the patch that we have in our libvncserver port looks quite like it fixes a similar issue in another place to me http://svnweb.freebsd.org/ports/head/net/libvncserver/files/patch-libvncserver__sockets.c?revision=340725&view=markup so my first idea would be to do something like that to libvncserver: --- main.c.orig 2014-06-12 16:20:35.163489814 +0200 +++ main.c 2014-06-12 16:22:00.598491327 +0200 @@ -546,10 +546,10 @@ } /* We have some space on the transmit queue, send some data */ - if (FD_ISSET(cl->sock, &wfds)) + if (cl->sock >= 0 && FD_ISSET(cl->sock, &wfds)) rfbSendFileTransferChunk(cl); - if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds)) + if (cl->sock >= 0 && (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))) rfbProcessClientMessage(cl); } This patch is completely untested was produced within 2 minutes of looking at the code and I am not familiar with the VNC code at all so this might be completely nonsense - please take it for what it's worth. Since the libvncserver port is unmaintained right now but bapt@ was the former maintainer I will CC him just in case he knows something about it. -- Bernhard Froehlich http://www.bluelife.at/