Bug 58174 - Xserver 1.13.99 / 1.13.99.901: dispatch.c:3953: DetachOutputGPU: Assertion `slave->isGPU' failed.
Summary: Xserver 1.13.99 / 1.13.99.901: dispatch.c:3953: DetachOutputGPU: Assertion `s...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high blocker
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: xserver-1.14
  Show dependency treegraph
 
Reported: 2012-12-12 06:54 UTC by Knut Petersen
Modified: 2014-04-26 10:56 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
detailed list of git versions (19.04 KB, text/plain)
2012-12-12 06:54 UTC, Knut Petersen
no flags Details

Description Knut Petersen 2012-12-12 06:54:44 UTC
Created attachment 71381 [details]
detailed list of git versions

Xorg failed to shut down properly. keyboard and mouse without any signs of life.
ssh login possible, remode restart of Xorg revived  local mouse/keyboard.

Xorg Log: Nothing special, but the log missed the expected final "Server terminated successfully (0). Closing log file" message.

dmesg output: Nothing special

/var/log/messages: Nothing special.

X was started from the console, so the last lines of stdout/stderr output were available. Nothing special, except one line:

.Xorg: dispatch.c:3953: DetachOutputGPU: Assertion `slave->isGPU' failed.

Reproducibility: Unfortunately pretty low. I was able to reproduce the problem only once in about 20 cycles.

Hardware: Aopen i915GMm-Hfs. Pentium M Dothan, 2GB

linux kernel: v3.7

distribution: opensuse 12.1

Xorg: X.Org X Server 1.13.99, for details see attachment

cu,
 Knut
Comment 1 Knut Petersen 2012-12-13 10:09:36 UTC
Well, it happened again.
Comment 2 Knut Petersen 2012-12-13 22:40:10 UTC
I verified the bug on a 2nd system.

Changed DetachOutputGPU in dix/dispatch.c to:

void
DetachOutputGPU(ScreenPtr slave)
{
    if (slave->isGPU == NULL) { // -kp debug
       xorg_backtrace();
       FatalError("Fatal: DetachOutputGPU called with slave->isGPU == NULL\n");
    }

    xorg_backtrace();
    // assert(slave->isGPU);
    xorg_list_del(&slave->output_head);
    slave->current_master = NULL;
}

Result:

1: during most server shutdowns DetachOutputGPU is never called, and the
shutdown succeeds without error.
2: Whenever it is called, it is called with slave->isGPU==NULL.

Below find a  backtrace, (I added some Xorg function names to make it usefull).


[ 43563.880] (II) UnloadModule: "evdev"
[ 43563.880] (II) evdev: Power Button: Close
[ 43563.880] (II) UnloadModule: "evdev"
[ 43564.043] (EE)
[ 43564.043] (EE) Backtrace:
[ 43564.043] (EE) 0: /home/knut/xorg/X11-r/usr/bin/Xorg (xorg_backtrace+0x49) [0x8218839]
[ 43564.043] (EE) 1: /home/knut/xorg/X11-r/usr/bin/Xorg (DetachOutputGPU+0x71) [0x8080b31]
[ 43564.044] (EE) 2: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0xc1347) [0x8109347]        xf86CrtcCloseScreen
[ 43564.044] (EE) 3: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x7e6fb) [0x80c66fb]        DGACloseScreen
[ 43564.044] (EE) 4: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x823d1) [0x80ca3d1]        DPMSClose
[ 43564.044] (EE) 5: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0xf8d43) [0x8140d43]        XvCloseScreen
[ 43564.044] (EE) 6: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x13b521) [0x8183521]       SyncCloseScreen
[ 43564.044] (EE) 7: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0xe7807) [0x812f807]        CursorCloseScreen
[ 43564.045] (EE) 8: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x139a50) [0x8181a50]       AnimCurCloseScreen
[ 43564.045] (EE) 9: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0xe2528) [0x812a528]        compCloseScreen
[ 43564.045] (EE) 10: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x87f95) [0x80cff95]       VidModeClose
[ 43564.045] (EE) 11: /home/knut/xorg/X11-r/usr/lib/xorg/modules/extensions/libglx.so (0xb720c000+0x44181) [0xb7250181]
[ 43564.045] (EE) 12: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x244b8) [0x806c4b8]
[ 43564.045] (EE) 13: /lib/libc.so.6 (__libc_start_main+0xf3) [0xb72f9003]
[ 43564.045] (EE) 14: /home/knut/xorg/X11-r/usr/bin/Xorg (0x8048000+0x24749) [0x806c749] _start
[ 43564.045] (EE)
[ 43564.046]
Fatal server error:
[ 43564.046] Fatal: DetachOutputGPU called with slave->isGPU == NULL
[

cu,
 Knut
Comment 3 Knut Petersen 2012-12-14 12:59:53 UTC
As far as I can see there is _one_ place where pScreen->isGPU is set to something: Init_screen() if parameter gpu is true. 

Added some extra debugging code.

Init_screen() seems to be never called here with gpu true.

Also AttachOutputGPU() seems to be never called here.

But DetachOutputGPU() occasionally gets called on server shutdown from xf86CrtcCloseScreen():

    /* detach any providers */
    if (config->randr_provider) {
        if (config->randr_provider->offload_sink) {
            DetachOffloadGPU(screen);
            config->randr_provider->offload_sink = NULL;
        }
        else if (config->randr_provider->output_source) {
            DetachOutputGPU(screen);
            config->randr_provider->output_source = NULL;
        }
        else if (screen->current_master)
            DetachUnboundGPU(screen);
    }


So calling of DetachOutputGPU() depends on config->randr_provider->output_source.

It would help if I would knew how all this code is supposed to work ;-)
Comment 4 Knut Petersen 2012-12-17 08:53:28 UTC
xf86RandR14ProviderSetOutputSource() never is called. That means output_source receives its value as a result of broken pointer arithmetic or something equivalent.
Comment 5 Guido 2013-01-07 17:39:11 UTC
I am to reproduce this bug 100% of the time using xserver v1.13.1 built by the Fedora 18 beta release.

See my description at

    <https://bugzilla.redhat.com/show_bug.cgi?id=891140>

Needs attention ASAP.
Comment 6 Knut Petersen 2013-01-08 08:03:40 UTC
(In reply to comment #5)
> I am to reproduce this bug 100% of the time using xserver v1.13.1 built by
> the Fedora 18 beta release.
> 
> See my description at
> 
>     <https://bugzilla.redhat.com/show_bug.cgi?id=891140>
> 
> Needs attention ASAP.

100% reproducibility on your systems sounds good.

It seems that the problem vanished with newer versions or xorg on my system. Could you please test the current xorg git master version?

cu,
 Knut
Comment 7 Guido 2013-01-08 16:02:22 UTC
I am not set up to build the xorg git master version. So I am waiting for Fedora 18 developers to post a new version. Their latest is 1.13.1. I have several postings on the Fedora Bugzilla web site under the name Guido.
Comment 8 Knut Petersen 2013-01-10 17:20:22 UTC
(In reply to comment #7)
> I am not set up to build the xorg git master version. So I am waiting for
> Fedora 18 developers to post a new version. Their latest is 1.13.1. I have
> several postings on the Fedora Bugzilla web site under the name Guido.

Could you try to debug the problem on your machine? Have you had a look at http://www.x.org/wiki/Development/Documentation/ServerDebugging

The problem still exists in git master, fetched and compiled yesterday. (X.Org X Server 1.13.99.901 (1.14.0 RC 1))

cu,
 Knut
Comment 9 Guido 2013-01-10 17:49:03 UTC
Knut

At my urging Fedora Bugzilla has fixed the problem.

In updates-testing, get these 2 packages

    xorg-x11-server-common-1.13.1-4.fc18.i686.rpm
    xorg-x11-server-Xorg-1.13.1-4.fc18.i686.rpm

Source is there too in case you want to build yourself.

This build #4 of v1.13.1 works for me.

Guido

PS I don't know if Fedora modifies the git master.
Comment 10 Knut Petersen 2013-02-15 09:24:41 UTC
The known fix should be applied to master: http://lists.x.org/archives/xorg-devel/2013-January/035053.html

cu,
  Knut
Comment 11 Knut Petersen 2014-04-26 10:56:05 UTC
Daves patch made it to mainline long ago.

Knut


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.