Bug 74494 - gm45: dies with X: kgem.h:564: kgem_bo_is_busy: Assertion `bo->refcnt' failed.
Summary: gm45: dies with X: kgem.h:564: kgem_bo_is_busy: Assertion `bo->refcnt' failed.
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-04 08:32 UTC by Arkadiusz Miskiewicz
Modified: 2014-02-04 09:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Clear composite state after flushing glyphs (1.96 KB, patch)
2014-02-04 08:51 UTC, Chris Wilson
no flags Details | Splinter Review
Reset composite state between switching glyph formats (1.32 KB, patch)
2014-02-04 09:47 UTC, Chris Wilson
no flags Details | Splinter Review

Description Arkadiusz Miskiewicz 2014-02-04 08:32:26 UTC
I'm using tkabber (jabber IM client) with tabs. Someone send me a message, with regular text that when tkabber displays it causes intel ddx to die. If I display it with text editor (based on tkabber conversation log) then nothing bad happens. So I'm able to trigger it (very, very reliably) with tkabber.

When debugging is enabled it dies with:
X: kgem.h:564: kgem_bo_is_busy: Assertion `bo->refcnt' failed.

When debugging is disabled then immediately all texts on screen gets corrupted and few seconds after X freezes, even sysrq+r doesn't work.


I'm keeping that tkabber tab for future testing (I can switch to other git versions or apply some patches to test).

Note that this is first time I see such problem. I'm using tkabber a lot, getting different messages and no problem occurs. That one, single message contents makes driver go nuts. I've also tried git versions from december and few from january - all these die with this "tkabber test".

Here is debug=full log:
http://ixion.pld-linux.org/~arekm/intel-weird1.txt.gz

and kdm log:
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Error:            Meta_L added to symbol map for multiple modifiers
>                   Using Mod4, ignoring Mod1.
> Error:            Key <META> added to map for multiple modifiers
>                   Using Mod4, ignoring Mod1.
> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
>                   Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server
Allocated pixmaps: 672 (cached: 5), bo: 236, 45162496 bytes (CPU bo: 9, 9752576 bytes)
Allocated pixmaps: 902 (cached: 5), bo: 301, 51916800 bytes (CPU bo: 25, 10063872 bytes)
X: kgem.h:566: kgem_bo_is_busy: Assertion `bo->refcnt' failed.


xserver 1.15
driver at 1cbc59a917e7352fc68aa0e26b1575cbd0ceab0d (so current git)
3.13.1 kernel
Comment 1 Chris Wilson 2014-02-04 08:46:14 UTC
Right, the debug log says it is the glyph cache that gets accidentally destroyed - which fits in with the non-debug failure mode.

Now to piece together where the missing ref / extra unref is.

Thanks as this is likely the key to bug 73406 as well!
Comment 2 Chris Wilson 2014-02-04 08:51:58 UTC
Created attachment 93346 [details] [review]
Clear composite state after flushing glyphs

I wonder if it is this simple...
Comment 3 Arkadiusz Miskiewicz 2014-02-04 09:08:33 UTC
Works. No longer crashses.

(ps. That tkabber message did contain � character in it. The rest was pure ascii.)
Comment 4 Chris Wilson 2014-02-04 09:47:30 UTC
Created attachment 93349 [details] [review]
Reset composite state between switching glyph formats

v2, replace the shotgun with a precise scalpel.
Comment 5 Arkadiusz Miskiewicz 2014-02-04 09:53:34 UTC
v2 works, too. Thanks.
Comment 6 Chris Wilson 2014-02-04 09:57:51 UTC
Thanks,

commit c6a21f0355447d398a8b857ad046cd27141d4744
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Feb 4 08:51:17 2014 +0000

    sna/glyphs: Reset composite state between switching glyph formats
    
    One path uses the mask channel, the other does not. We cannot rely on
    overwriting all reused state in this case, and so we must clear the
    composite state prior to use each time.
    
    Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74494
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>


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.