[hardy] Xv causes SIGSEGV in memcpy()

Bug #212799 reported by Mikael Gerdin on 2008-04-06
92
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xserver-xorg-video-intel (Ubuntu)
High
Unassigned
Hardy
Undecided
Bryce Harrington

Bug Description

Changed the Description for the ubuntu stable release team.

1. This bug is very critical, It causes the xserver to crash if you use XV (X video extension). In the worst case you lose data. Every open Application gets interrupted.
2. This bug has been fixed thought a new driver version in Intrepid. To fix this problem in hardy I have applied an commit from upstream that fixes this problem ( http://gitweb.freedesktop.org/?p=xorg/driver/xf86-video-intel.git;a=commitdiff;h=1c0e4958564588162bc22a980567436dfc9d1e56 ). I have attached a debdiff that I have created against the latest proposed xserver-xorg-video-intel_2.2.1-1ubuntu13.5 package. So far I could not find any bugs/problems that may have been introduced through this patch.
3. You can reproduce this problem by playing some videos with totem (XV as backend). If you play a HD-Trailer the xserver crashes much earlier. If composite (compiz) is activated doesn't show any difference.
4. As I mentioned earlier I could not find any new bugs. Two other people have tested the debdiff with success. I don't know if the Graphics Media Accelerator X3100 is also affected. I know that the chips from 915 to 945 are affected.

Mikael Gerdin (mgerdin) wrote :
Mikael Gerdin (mgerdin) wrote :
Bryce Harrington (bryce) wrote :

Thanks for attaching a full backtrace. Are you able to reproduce this issue with Option "ExaNoComposite" "true" as well?

For reference, can you attach your /var/log/Xorg.0.log?

Changed in xserver-xorg-video-intel:
status: New → Incomplete
Mikael Gerdin (mgerdin) wrote :

Yes, it's reproducible with ExaNoComposite set to True as well.
I'll attach my Xorg.log from a crash.
(currently running the ubuntu11-version of intel driver and from a KDE4 session with opengl compositing)

JockeTF (jocketf) wrote :

I have the same problem with Ubuntu (32-bit) and an Intel 945GM. It doesn't seem to matter whether I use compiz or not.

X crashes sometimes when trying to play something in mplayer using XV. I've found out that X always crashes if I launch tvtime and after closing tvtime play something in mplayer using XV. I can often start and close tvtime more than once time without crashing X, but launching mplayer after that always forces X to restart.

If I use a framebuffer device (replacing splash with vga=792 in /boot/grub/menu.lst) I can keep on using the text-mode ttys even after X has crashed and restarted.

I also tried to (build and) install the xserver-xorg-video-intel package from Gutsy. This solves the problem with XV crashing my X-server. (I can't use Compiz with Gutsy's intel drivers. It starts, but the windows aren't updated properly and I have to resize them If I want to see what's going on. OpenGL and metacity works fine though.)

Bryce Harrington (bryce) on 2008-04-15
Changed in xserver-xorg-video-intel:
importance: Undecided → High
status: Incomplete → Triaged
Øyvind Stegard (oyvinst) wrote :

I'm also seeing random (i.e. doesn't always happen) X crashes when playing videos on Intel-graphics hardware using XV. If a crash occurs, it happens immediately when trying to
play a video through XV. Last time it happened was playing a small video (dimension-wise) in the Totem-browser plugin. Before that I had played a rather large HD-video with mplayer without a crash.

X is restarted by GDM and non-framebuffer console is *not* garbled after a crash. I run standard Compiz with the settings that are enabled by default in Hardy.

Description: Ubuntu Hardy (Release Candidate)
Release: 8.04
Arch: 32bit
Graphics card: i915GM

This is the lspci-info on the card:
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 04) (prog-if 00 [VGA controller])
 Subsystem: Uniwill Computer Corp Unknown device 9800
 Flags: bus master, fast devsel, latency 0, IRQ 20
 Memory at ffe80000 (32-bit, non-prefetchable) [size=512K]
 I/O ports at ec00 [size=8]
 Memory at d0000000 (32-bit, prefetchable) [size=256M]
 Memory at ffe40000 (32-bit, non-prefetchable) [size=256K]
 Capabilities: [d0] Power Management version 2

Please notify me if you want me to provide more information.

Helle (lapidar-web) wrote :

I have the same symptoms and the same crash backtrace.
User "Jocke" reported the most details to reproduce this bug.

The greedy setting come from different bug reports with similar symptoms.

Section "Device"
        Identifier "Configured Video Device"
        Driver "intel"
        Option "DRI" "true"
        Option "Xinerama" "false"
        Option "ModeDebug" "true"
        Option "AccelMethod" "EXA"
        Option "ExaNoComposite" "false"
        Option "MigrationHeuristic" "greedy"
EndSection

Binary package hint: xserver-xorg-video-intel

Description: Ubuntu hardy (development branch)
Release: 8.04
Arch: i386
Graphics card: i945
xserver-xorg-video-intel:
  Installed: 2:2.2.1-1ubuntu12

With i810 (of course no exa) in the driver section everything works fine.

Helle (lapidar-web) wrote :

Maybe this bug is fixed in the devel version?
After building the debian version xserver-xorg-video-intel (2:2.2.99.903-1) I had no crash until now.

from Changelog:

commit 1c0e4958564588162bc22a980567436dfc9d1e56
Author: Zhenyu Wang <email address hidden>
Date: Thu Mar 13 10:15:55 2008 +0800

    Always bind memory after agp aperture allocation

    This fixed the crash appearing for Xv buffer memory, which appears
    allocation and free happening in stolen memory. We should always
    try to bind for stolen memory for correct protect setup, otherwise
    we might get fault that stolen memory protect reverted to non-r/w
    after previous free and unbind.

    Credit goes to Lukas Hejtmanek to identify the real problem of Xv
    crash!

Mikael Gerdin (mgerdin) wrote :

I've tested building and running the latest debian version (2.3.0-1) and I've failed to reproduce the crash.
However there are Severe performance issues when using Xv and compositing with 2.3.0, Playback of a 1280x720 video with "desktop effects" enabled causes my cpu usage to reach about 80% on both cores, but when playing the same video without the effects i get around 10%. But at least my X server doesn't crash...

Mikael Gerdin (mgerdin) wrote :

Update:
The performance issues only appeared when using the "Textured Video" Xv adapter.
The overlay adapter does not show those issues.
After massaging "11_hw_overlay_option.diff" to apply to 2.3.0-1 I disabled textured video in my xorg.conf and now I can use Xv without segfaults and with reasonable performance.

Benjamin Thyreau (benji2) wrote :

Hi
I can confirm Mikael's experience. I can deterministically make X crash simply by watching some specific video with current driver (2:2.2.1-1ubuntu13). See similar X Backtrace attached. Yet, "Upgrading" (and forcing) to Debian's xserver-xorg-video-intel_2.3.0-1_i386.deb package fixed the crash problem. But then, the large videos display very slowly. I didn't try to apply Mikael's suggested patch, though, since i used a precompiled binary.
Running Ubuntu Hardy on DELL Latitude D430

Benjamin Thyreau (benji2) wrote :
Mikael Gerdin (mgerdin) wrote :

I'll attach a debdiff to disable textured video that applies to 2.3.0-1 so that it can be more tested.

Hi,
Indeed, this aforementioned patch corrects the problem of lagging large videos on 2.3.x debian serie. This is especially visible in my system when enabling metacity compositing manager.
Note that both 2.3.0 and 2.3.1 Debian packages didn't fix the lagging video problem (although they fix the X crash initial problem), only applying Mikael .debdiff does fix it.

Achim (ach1m) wrote :

Hello,
I have an Dell Inspiron6400L preinstalled with ubuntu. I am also effected by this XV problem with ubuntu 8.04.
I would like to know if there is a chance that the LTS version will get a fix for this critical problem.
Maybe in the mean time, someone can point my to a package were this problem hast been fixed.

Thanks in advance

Achim (ach1m) wrote :

Hello,
I have a Dell Inspiron6400L preinstalled with ubuntu. I am also effected by this XV problem with ubuntu 8.04.
I would like to know if there is a chance that the LTS version will get a fix for this critical problem.
Maybe in the mean time, someone can point my to a package were this problem hast been fixed.

Thanks in advance

Achim (ach1m) wrote :

Sorry for the noise, I didn't saw/knew if the first post has been published. I pushed the abort button but as it seems it was to late.
I don't know if there is a way to delete one of this two posts, maybe an admin can delete the first one of them, if possible.

Mikael Gerdin (mgerdin) wrote :

I've uploaded the latest ubuntu intrepid version built for ubuntu hardy in my ppa
https://launchpad.net/~mgerdin/+archive
It contains the fix for this problem.

Achim (ach1m) wrote :

thank you very much Mikael.

I am more than happy now.
As far as I can tell everything is working again.

Bryce Harrington (bryce) wrote :

We've got the 2.3.2 driver uploaded to Intrepid, with a fixed version of the TexturedVideo patch, so I think this bug should be resolved now in Intrepid. If not, please feel free to reopen.

Changed in xserver-xorg-video-intel:
status: Triaged → Fix Released
Bryce Harrington (bryce) wrote :

Opening a Hardy task, so if someone can identify the exact change that caused the fix, we could SRU it.

Changed in xserver-xorg-video-intel:
status: New → Triaged
Achim (ach1m) wrote :

How can we bring the solution for ubuntu 8.04.1 LTS (hardy) forward?

I mean it isn't very easy to find the actual problem, at least for me.

Wouldn't it be easier to publish the new Intel 2.3.2 driver?

Maybe someone can build a package without EXA acceleration as it is still slow nowadays, so that we can test it.

Regards
Achim

Bryce Harrington (bryce) wrote :

I asked Steve Langasek if he would accept a newer version of the driver as an SRU for Hardy, and he said no absolutely not. So that is not an option.

So to bring the solution to Hardy, it is necessary for someone to do a bisection search (such as via git bisect) to find the specific patch, which we can then put an SRU in to fix for everyone. I do not plan on doing this, as I'm more focused on Intrepid now, but would encourage anyone wishing the fix to do it.

Another approach would be to put in a request for a backport of the 2.3.2 driver. The steps for doing this are:

    a. Get the current source from Intrepid
    b. Build it on $dist
    c. If it builds fine, file a bug via
        https://launchpad.net/products/$dist-backports/+filebug

        "Please backport $driver from Intrepid
         Current version: <old-version>
         New version: <intrepid-version>
         I built it successfully on $disk with no source changes needed.
         Benefits include better support for newer and older gfx hw.
        "

Achim (ach1m) wrote :

I have applied an "patch" from upstream and as far as I can tell I have no problems. The patch is the commit that Hele mentioned earlier. (See some comments above)

I applied the patch to this package version
xserver-xorg-video-intel (2:2.2.1-1ubuntu12) hardy

What I have tested:
- played several videos
- glxgears
- scrolling in Firefox was fast (only to be sure nothing else broke)
- compiz
(apps were running at the same time)

I hope this helps to release a fixed package version.

Regards
Achim

unggnu (unggnu) wrote :

Thanks for nailing the patch down. Looks like a SRU candidate.

Changed in xserver-xorg-video-intel:
assignee: nobody → bryceharrington
Achim (ach1m) wrote :

I don't know if it helps but I have created an debdiff against the latest (proposed) version of the xserver-xorg-video-intel_2.2.1-1ubuntu13.5 package.

This is my first debdiff. I hope I have done everything right.

I had no problems so far with my patched package.
But I can only test one system.

My System:
Dell Laptop (Inspiron6400L)
hardy 8.04.1 32-bit
kernel 2.6.24-19-generic

*-pci
          description: Host bridge
          product: Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub
          vendor: Intel Corporation
          physical id: 100
          bus info: pci@0000:00:00.0
          version: 03
          width: 32 bits
          clock: 33MHz
          configuration: driver=agpgart-intel module=intel_agp

I don't want to be the one who breaks the system of others because of this patch ;-) It would be nice if you could verify my debdiff and tell my if I did something wrong.

Regards
Achim

I have tested the package from Achim (xserver-xorg-video-intel_2.2.1-1ubuntu13.6) and noticed no regressions so far.

My System:
Sony VGN-FS215B with Intel 915GM
Ubuntu 8.04.1 32bit with kernel 2.6.24-19-generic

Videoplayback works great. Without this patch the xserver restarted everytime I played back a HD Video and then switched to a normal Video. I couldn't reproduce this behaviour with the updated package!

Thanks for this debdiff, Achim!

Benjamin Thyreau (benji2) wrote :

Hi,

I also successfully tested Achim aforementioned debdiff. It applied and built without problems on Hardy.

Now the 2.2.X driver doesn't crash anymore on some video playing, and there is no such lagging video problem as there was on the 2.3.X serie.

I strongly suggest getting this package published as an Hardy SRU, as it fixes a severe bug on some Intel card, such as those on the DELL Latitude D430...

Thanks

Achim (ach1m) on 2008-07-24
description: updated
Achim (ach1m) wrote :

I had the opportunity to test an Intel G965. I was not able to crash the system (xserver). The reason is that it is based on PCI Express.

Difference between the two systems that I have tested.

Dell Laptop Inspiron6400L:
product: Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub
configuration: driver=agpgart-intel module=intel_agp

Desktop PC:
product: 82P965/G965 PCI Express Root Port
configuration: driver=pcieport-driver

If you take a look at the upstream commit (see bug description)
you also can see this headline "Always bind memory after agp aperture allocation"

In conclusion, we can see that all newer systems that have PCI Express shouldn't be affected by this bug.

I have installed my patched package on the G965 System to see if it would have some negative affects. As expected I hadn't any problems.

I know everybody is busy with Intrepid but I think such a dangerous bug should really be fixed for all the users that have an system with Intel agp.

Can we change the Importance to HIGH please and eliminate this problem.

Regards
Achim

Martin Pitt (pitti) wrote :

Sponsored, thank you!

Changed in xserver-xorg-video-intel:
status: Triaged → In Progress
status: In Progress → Fix Committed
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Achim (ach1m) wrote :

I have installed the proposed update and so far I had no problems.

Regards
Achim

Ravindra Singh (r-singh) wrote :

This is really getting on my nerves.

Xorg log is attached.

Achim (ach1m) wrote :

Ravindra Singh can you please be more specific.

What is your output if you type this in a terminal?

$ dpkg -l | grep xserver-xorg-video-intel

Ravindra Singh (r-singh) wrote :

Sorry about that:
I have the same problem. Play a video and X server crashes. It doesn't happen every time but when it does all work is lost. I submitted a bug here:

https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/252108

And it happens with any video and any player.

sandman@procyon:~$ dpkg -l | grep xserver-xorg-video-intel
ii xserver-xorg-video-intel 2:2.2.1-1ubuntu13.4 X.Org X server -- Intel i8xx, i9xx display d
sandman@procyon:~$

hi Ravndra,

Ravindra Singh [2008-07-29 4:48 -0000]:
> I have the same problem. Play a video and X server crashes. It
> doesn't happen every time but when it does all work is lost.

Can you please upgrade to the hardy-proposed version
(2:2.2.1-1ubuntu13.6)? This should fix it.

Øyvind Stegard (oyvinst) wrote :

I've got the update from Hardy-proposed installed, and it looks OK, playing many videos with XVideo, both large and small.. However, I did get a freeze *once*, on a small video played in Totem, just right after I had installed the updated driver. The Xorg.0.log file contained many driver messages about some timeout/events, I'm sorry, I don't have the details handy at this computer (I'll see if I can provide the details when I get home, later today). It happened right at the moment when the video was loading in Totem, X froze. The mouse cursor could still be moved, and the machine otherwise running normally. However, keyboard in X was dead and console switch did not work. I rebooted with Alt+SysRq, S, B.

Info about my hardware here:
https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/212799/comments/6

I don't use any extra options in xorg.conf for the Intel-driver.

Achim (ach1m) wrote :

Øyvind Stegard, can you reproduce the crash haver a cold boot?

Øyvind Stegard (oyvinst) wrote :

Re: Øyvind Stegard, can you reproduce the crash haver a cold boot?

I will try when I get home, later today (I don't have the laptop available where I'm at, currently). The freeze did indeed happen after a fresh boot, it was the first video I tried playing .. Note also the difference, with the previous driver, things crashed and X restarted, this was a freeze, but just as bad, I guess :) ..

Øyvind Stegard (oyvinst) wrote :

Hi, unfortuntely (or fortunately, depending how you look at it), I was not able to reproduce the freeze I experienced earlier. However, I did manage to keep the Xorg log file from the incident, and I am attaching it.

Lots of messages like this at the end:
tossed event which came in late
mieqEnequeue: out-of-order valuator event; dropping.

Regards

Øyvind Stegard (oyvinst) wrote :

I've googled up on those messages, and it seems related to an Xorg bug in input layer which has since been fixed:
https://bugs.freedesktop.org/show_bug.cgi?id=14428
https://bugs.freedesktop.org/show_bug.cgi?id=13511

So, by co-incidence, that unrelated bug struck me right after I had updated the Intel-driver from proposed. I don't think there's any problem with the Intel-driver update in hardy-proposed, and X has never crashed like it did sometimes before.

Michael-250 (michael-250) wrote :

I have also tested the proposed update (2:2.2.1-1ubuntu13.6). This update works great so far. No problems with high resolution videos! And I didn't notice any regressions. I am using a laptop with Intel 915GM chip.

When will this proposed update be delivered through a regular update? Is still more feedback needed?

Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in xserver-xorg-video-intel:
status: Fix Committed → Fix Released
NeLaS (organelas) wrote :

Is anybody experiencing system freezing after the update? My systems is very unstable now... (3 to 4 freezes a day) It can freeze completely (even the music playing gets stucked) or sometimes everything freezes except for the mouse pointer...

It has happened already while using flash (firefox, epiphany), java, eye of gnome... nothing specific I could track down. Logs don't show nothing much different and I could not yet reproduce it!

I'm a bit lost indeed

Achim (ach1m) wrote :

No there are no problems. Maybe you could ask on the ubuntu forums or you start a new bug report if you know what is going wrong.

It seems like you are hitting another problem here, at least for me.
What you are describing doesn't really fit to this report.

Regards
Achim

Jan Wedekind (wedesoft) wrote :

I encountered problems when using XVideo with the "Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)". Every so often I had to reset the laptop because starting a video player would freeze X11. I disabled the option "TexturedVideo" by modifying the video device section in /etc/X11/xorg.conf as follows:

...
Section "Device"
        Identifier "Configured Video Device"
        Option "TexturedVideo" "false"
EndSection
...

I've tested this for a while now but since I changed xorg.conf it has worked just fine.
I noticed that in the meantime that there also was a security update for some Intel kernel module. However I didn't test whether X11 works with option "TexturedVideo" enabled now.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.