Bug 40850 - [945GM SNA] X segfaults when watching Flash applets
Summary: [945GM SNA] X segfaults when watching Flash applets
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: 2011-09-13 12:24 UTC by Paul Neumann
Modified: 2011-09-14 14:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Backtrace of X crashing (3.52 KB, text/plain)
2011-09-13 12:24 UTC, Paul Neumann
no flags Details
Backtrace of the assertion failure (845 bytes, text/plain)
2011-09-13 20:44 UTC, Paul Neumann
no flags Details
Xorg.log of the crashed X with --enable-debug=full (67.53 KB, text/plain)
2011-09-13 20:46 UTC, Paul Neumann
no flags Details
Xorg.log with full debugging and the original segfault (678.49 KB, text/plain)
2011-09-14 09:27 UTC, Paul Neumann
no flags Details

Description Paul Neumann 2011-09-13 12:24:27 UTC
Created attachment 51160 [details]
Backtrace of X crashing

(Here is another bug for you, Chris ;))

Occasionally, running Flash applets in Chromium cause X to crash.
Although I cannot reproduce this behaviour reliably, after a certain number of attemps, X finally segfaults (attempt means to browse websites with Flash, mostly video but I think I recall one crash with no video involved, on it).
Comment 1 Chris Wilson 2011-09-13 15:17:03 UTC
Hmm, --enable-debug=full ;-) When that is in effect everything becomes real s.l.o.w due to the extra logging, but more importantly it enables all the assertions, including those around checking the lengths around the memcpy.

All platforms should be equally vulnerable. Is there any particular sequence that has a higher failure rate?
Comment 2 Paul Neumann 2011-09-13 20:43:34 UTC
(In reply to comment #1)
> Hmm, --enable-debug=full ;-) When that is in effect everything becomes real
> s.l.o.w due to the extra logging, but more importantly it enables all the
> assertions, including those around checking the lengths around the memcpy
> All platforms should be equally vulnerable.

> Is there any particular sequence that has a higher failure rate?

Before --enable-debug=full, (I thought) the segfault only happened when there was some heavy action playing Flash applets. However, with debugging enaled, the assert failed way earlier, sometimes even before I even did anything particular at all.
Comment 3 Paul Neumann 2011-09-13 20:44:29 UTC
Created attachment 51171 [details]
Backtrace of the assertion failure
Comment 4 Paul Neumann 2011-09-13 20:46:57 UTC
Created attachment 51172 [details]
Xorg.log of the crashed X with --enable-debug=full

I took the last 1000 lines of the log, as the whole log is about 60M. Just let me know when you need more.
Comment 5 Chris Wilson 2011-09-14 01:50:11 UTC
Ok, that's a different (non-critical) bug I'm trying to understand. The goal is to mirror the active lists in the kernel and so predict which buffers I can write to without stalling, that assert tells me that a buffer I thought was idle is still on the kernel active list.

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 82c5cf1..1a1813a 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -596,7 +596,7 @@ void kgem_retire(struct kgem *kgem)
                        list_del(&bo->request);
                        bo->rq = NULL;
 
-#if 0
+#if 1
                        /* XXX we loose track of a write-flush somewhere? */
                        if (!bo->needs_flush)
                                bo->needs_flush = kgem_busy(kgem, bo->handle);

That will get you past the assertion and onto the real issue (hopefully).
Comment 6 Chris Wilson 2011-09-14 06:37:47 UTC
It seems I only encounter the tame flash applets. I've not yet reproduced this with video elements in flashplugin either in firefox or chromium. Any suggestions as to which to try?
Comment 7 Paul Neumann 2011-09-14 09:26:26 UTC
(In reply to comment #6)
> It seems I only encounter the tame flash applets. I've not yet reproduced this
> with video elements in flashplugin either in firefox or chromium. Any
> suggestions as to which to try?

First of all, my Flash version is 11.0 d1 on x86_64.Maybe it is related to a particular version of Flash.

Then, it can happen with nearly all videos. I have seen it happen on Youtube and golem.de. It sometimes happens the first time I want to play a video, sometimes after the like 20th time. I can not reproduce this bug reliably, only by starting the videos over and over again.
Comment 8 Paul Neumann 2011-09-14 09:27:58 UTC
Created attachment 51201 [details]
Xorg.log with full debugging and the original segfault
Comment 9 Chris Wilson 2011-09-14 09:44:21 UTC
"memcpy_blt: src=(0, 25), dst=(65, 409)" gives a bit of a clue - that we are skipping the first 25 lines of the PutImage data, yet still copying the full height. Hmm, are you using a compositing WM? (Which adds yet another coordinate transform I may have messed up...)
Comment 10 Chris Wilson 2011-09-14 09:48:32 UTC
I think this is the bug... I'm never wholly convinced I have these transformations right through.

commit 3565c48c4bb77c836d817de75d098791dbb529d3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Sep 14 17:45:41 2011 +0100

    sna: Yet another s/x/y/ typo
    
    Every time I do a transformation into pixmap space I like to include one
    of these copy'n'paste errors.
    
    Reported-by: Paul Neumann <paul104x@yahoo.de>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40850
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 11 Paul Neumann 2011-09-14 10:05:27 UTC
I cannot verify that the crashes are fixed (as I have not experienced any yet), but the patch fixed some visual corruption in Flash videos of around 25px at the bottom of the video (which I thought was an other bug >.<).

Anyways, thanks very much for your help :).
Comment 12 Da Fox 2011-09-14 12:53:58 UTC
(In reply to comment #10)
> I think this is the bug... I'm never wholly convinced I have these
> transformations right through.
> 
> commit 3565c48c4bb77c836d817de75d098791dbb529d3
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Wed Sep 14 17:45:41 2011 +0100
> 
>     sna: Yet another s/x/y/ typo
> 
>     Every time I do a transformation into pixmap space I like to include one
>     of these copy'n'paste errors.
> 
>     Reported-by: Paul Neumann <paul104x@yahoo.de>
>     Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40850
>     Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

That's fast. I was just trying to reproduce this bug (I first experienced it yesterday) with a flash-game, but I couldn't. This might explain why; I recompiled the driver with debug symbols from git-HEAD, and after than again without debug symbols, but still HEAD. So likely this is indeed fixed :)
Comment 13 Chris Wilson 2011-09-14 14:48:52 UTC
Let's close this one and move on to the next bug. ;-)


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.