From owner-freebsd-x11@FreeBSD.ORG Wed Aug 8 05:36:11 2012 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88D7E106564A for ; Wed, 8 Aug 2012 05:36:11 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 57F118FC0C for ; Wed, 8 Aug 2012 05:36:11 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so920595pbb.13 for ; Tue, 07 Aug 2012 22:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=wqETj06jzP1jlTdIU0rHMdW1sUKVtN9X4SBzfbzCXXo=; b=CInF3wwhQhHqyhg1ShVoHMNMuQNbwd9E079gcYOguHhGtVsYLM1KBnFkuOBbAV4eh7 3/XtXVLeoMCGNDbKULm2WCq2RBk0sSpUTzJ69KtP3fVUHa0okZK+g7tq6/ZttAzS6FeG pFmBmGIACnnQ3VDY+Te4N6AdbPo8rjZSPQmr71HELk9N/DBhs+zNEGJtcqR8oH6PlGHv 3riwTu0ymK8ezUATIr8BZ6epjdy2LZFGNfFL8Z2ql/WLJDQyW+2YWbg4/v7YfqHJGKeI 1sDZ4KXkfnlLy01A2mK+hic0Vqmm8iMIY+GQKX6alRiMfUFGBYeUtbTVtqm0JmpSQtqY jPrg== Received: by 10.68.232.103 with SMTP id tn7mr33289478pbc.86.1344404170815; Tue, 07 Aug 2012 22:36:10 -0700 (PDT) Received: from flatline.local (70-36-223-239.dsl.dynamic.sonic.net. [70.36.223.239]) by mx.google.com with ESMTPS id qx8sm9230143pbc.63.2012.08.07.22.36.08 (version=SSLv3 cipher=OTHER); Tue, 07 Aug 2012 22:36:09 -0700 (PDT) Message-ID: <5021FABF.9040802@gmail.com> Date: Tue, 07 Aug 2012 22:35:59 -0700 From: matt User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120731 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-x11@freebsd.org References: <5021CA0E.6080608@gmail.com> <5021CBD6.6010607@gmail.com> In-Reply-To: <5021CBD6.6010607@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Problem with new Xorg, radeon & compiz/Kwin revisited X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2012 05:36:11 -0000 On 08/07/12 19:15, matt wrote: > > A while back, I was having a strange issue with the new Xorg and compiz. > In a nutshell, closing certain windows caused Xorg to exit on nasty > signals. At the same time, a few users with Radeon cards were having > issues with Kwin disabling opengl for no apparent reason. > > After some research, I had posted a patch seen in a debian mailing list > as a possible solution, and it did indeed solve the immediate problem of > crashing Xorg (and later I found out Kwin worked with OpenGL effects > when the patch is applied). > > It was requested I file a PR but first investigate what issues such a > patch might cause. I'm glad I waited, because there are a few. The > medicine is a little worse than the disease. First, with Compiz & Xfce4, > if X was told to shutdown while the previously affected programs > (xfce4-terminal running under compiz & xfce4 was obvious), the machine > would immediately reboot. This is obviously not good. So usually I would > only logout after closing all windows (except Xfce4-panel and the root > window). This would work, and the machine could be shut down from the > TTY. > > Recently, I installed KDE4. I was so impressed that I was trying to use > it as my "daily desktop". OpenGL Kwin was working fine. However, > engaging the screen lock would reboot the machine, as well as the > machine occasionally spontaneously rebooting. This was much worse than > the above issue. > > The patch had one other odd effect, which was that Dri2 was disabled for > some reason. > > I reverted the patch to xorg-server I had been running, and now Kwin > will not start OpenGL mode, because it can't find an ARGBGLX visual. If > Kwin is started alone, OpenGL suprisingly works. Xfce4+compiz crashes > Xorg as before, however Dri2 is now enabled. The signal is a segfault at > 0x0. AIGLX on/off have no effect. > > Here was the patch (I applied it manually looking at the file, the > offsets are wrong for us): > > diff --git a/glx/glxdri.c b/glx/glxdri.c > index 326f539..f6ef784 100644 > --- a/glx/glxdri.c > +++ b/glx/glxdri.c > @@ -230,7 +230,7 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable) > > /* If the X window was destroyed, the dri DestroyWindow hook will > * aready have taken care of this, so only call if pDraw isn't > NULL. */ > - if (drawable->pDraw != NULL) { > + if (drawable->pDraw != NULL&& drawable->pDraw->type == > DRAWABLE_WINDOW) { > screen = (__GLXDRIscreen *) glxGetScreen(drawable->pDraw->pScreen); > (*screen->core->destroyDrawable)(private->driDrawable); > > It seems like this shouldn't be having as much effect as it does. I can > only guess the reboots are from memory problems resulting from lingering > drawables? I can't explain the Dri2 interaction, nor can I explain > Kwin's behavior (fairly new to KDE, last time I used it was last century > :) ). > > For what it's worth, my driver is xf86-video-ati on a Radeon HD4650. > I'm thoroughly confused by this problem and I'd welcome some help trying > to solve the bug. Anyone else seeing problems with RV710 radeons and > OpenGL compositing? > > Matt > > > > A quick follow up...dri2 issue was something else, it works with the patch. I've tried base gcc as well as gcc47 no difference for xorg-server and the above behavior. The initial check for pDraw != NULL was to prevent a double free, and the patch adds a check to prevent an instance. My best guess now is that there is a double free situation that passes the DRAWABLE_WINDOW check. Matt