Bug 45673 - _sna_damage_is_all: Assertion on damage->extents fails
Summary: _sna_damage_is_all: Assertion on damage->extents fails
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-06 01:17 UTC by Da Fox
Modified: 2012-02-21 00:23 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Backtrace of crash with --enable-debug=full (unpacked: 115MB) (2.90 MB, application/x-7z-compressed)
2012-02-06 01:17 UTC, Da Fox
no flags Details
debug log of the crash with debug full. (92mb unpacked) (2.52 MB, application/x-7z-compressed)
2012-02-20 02:03 UTC, Da Fox
no flags Details
i915 error state captured after the crash (but after restarting X) (2.12 MB, application/octet-stream)
2012-02-20 02:06 UTC, Da Fox
no flags Details

Description Da Fox 2012-02-06 01:17:52 UTC
Created attachment 56647 [details]
Backtrace of crash with --enable-debug=full (unpacked: 115MB)

When running a simulation in the omnet++ simulator (http://omnetpp.org/) an assertion triggered:
X: /var/tmp/portage/x11-drivers/xf86-video-intel-9999/work/xf86-video-intel-9999/src/sna/sna_damage.c:953: _sna_damage_is_all: Assertion `damage->extents.x1 == 0 && damage->extents.y1 == 0 && damage->extents.x2 == width && damage->extents.y2 == height' failed.

using xf86-video-intel with sna, at commit
a8ed1a02ada1f8d2f910dfefb150d26c840bf9ea .

My hardware is Dell XPS 15 (L502x) with:
00:02.0 VGA compatible controller: Intel Corporation Device 0116 (rev 09)
[    13.803] (II) intel(0): Integrated Graphics Chipset: Intel(R) Sandybridge
Mobile (GT2)
Comment 1 Chris Wilson 2012-02-06 08:10:33 UTC
This is more clipped PolyLine fail. Not surprising as the original fb code is buggy in this regard as well :( On the plus side at least we detect it rather than corrupt random memory...
Comment 2 Chris Wilson 2012-02-06 10:10:00 UTC
I'm pretty sure that this isn't the last bug here...

commit b7e3aaf773f05ce82405e135c0f99b40b3c2f434
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Feb 6 18:08:19 2012 +0000

    sna: Use the clipped end-point for recomputing segment length after clipping
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=45673
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 3 Da Fox 2012-02-20 02:03:11 UTC
Created attachment 57303 [details]
debug log of the crash with debug full. (92mb unpacked)

(In reply to comment #2)
> I'm pretty sure that this isn't the last bug here...
So true.

I'm attaching another full-debug trace for (very very probably, there was an update pushed while I was reproducing this) xf86-video-intel revision 7d147c7462ba183f5316e7e8dafeca62add6f97c .

Additionally I'd like to note that when compiling the driver without debugging, although the xserver won't crash, it will stall for several seconds at a time, making it hard to work with the software in question. The following appears in dmesg (once for every 'freeze'):
---8<---------
Feb 20 10:50:45 localhost kernel: [28738.880739] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
Feb 20 10:50:45 localhost kernel: [28738.880800] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
Feb 20 10:50:45 localhost kernel: [28738.896369] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 122079 at 122075, next 122080)
Feb 20 10:50:53 localhost kernel: [28746.146411] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
Feb 20 10:50:53 localhost kernel: [28746.146536] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 122934 at 122932, next 122935)
Feb 20 10:50:59 localhost kernel: [28752.996223] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
Feb 20 10:50:59 localhost kernel: [28752.996348] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 123584 at 123579, next 123585)
--->8---------
Comment 4 Da Fox 2012-02-20 02:06:59 UTC
Created attachment 57304 [details]
i915 error state captured after the crash (but after restarting X)
Comment 5 Chris Wilson 2012-02-20 04:55:18 UTC
A couple more steps:

commit bbb6794a3b97b1fcf72c8712ab0ec591683b128b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Feb 20 12:25:31 2012 +0000

    sna: Trim clipped lines to end within bounds
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
    References: https://bugs.freedesktop.org/show_bug.cgi?id=45673
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

commit 805bc3310cd0a13eab8e48e7615bdd42638cfa33
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Feb 20 12:09:19 2012 +0000

    sna: When reversing line-drawing direction, use the clipped endpoint
    
    Make sure we take the clipping into account if we choose to reverse the
    draw direction (to maintain left-to-right inside the box emission).
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
    References: https://bugs.freedesktop.org/show_bug.cgi?id=45673
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 6 Chris Wilson 2012-02-21 00:23:49 UTC
And with

commit 1a65e2b8a2ebfb4d736efb7631515babad75faf2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Feb 21 08:09:52 2012 +0000

    sna: Split up/down edge walking in order to handle endpoint clipping
    
    In order to prevent walking upwards off the top of the pixmap when
    rendering a clipped vertical edge, we need to tweak the boundary
    conditions for the vertical edge walker.
    
    Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
    References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

I hereby proclaim everything to be perfect! ;)

Thanks Da Fox, please keep reporting any issues you find.


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.