After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 518564 - goom dies with illegal instruction
goom dies with illegal instruction
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal blocker
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-25 09:10 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2008-02-26 09:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stefan Sauer (gstreamer, gtkdoc dev) 2008-02-25 09:10:32 UTC
zoom_filter_xmmx (prevX=426, prevY=320, expix1=0xb4aab080, expix2=0xb1870080, lbruS=0xb15bf080, lbruD=0xb13a9080, buffratio=127, precalCoef=0x85bddc8) at xmmx.c:212
212       __asm__ __volatile__ ("femms\n");
(gdb) bt
  • #0 zoom_filter_xmmx
    at xmmx.c line 212
  • #1 zoomFilterFastRGB
    at filters.c line 698
  • #2 goom_update
    at goom_core.c line 641
  • #3 gst_goom_chain
    at gstgoom.c line 526
  • #4 gst_pad_chain_unchecked
    at gstpad.c line 3523

Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2008-02-25 09:14:46 UTC
$ cat /proc/cpuinfo 
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 13
model name      : Intel(R) Pentium(R) M processor 1.86GHz
stepping        : 8
cpu MHz         : 800.000
cache size      : 2048 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe up est tm2
bogomips        : 1598.38
clflush size    : 64
Comment 2 Sebastian Dröge (slomo) 2008-02-25 10:12:09 UTC
Works fine for me with extended MMX, i.e. zoom_filter_xmmx()... From the /proc/cpuinfo output your CPU doesn't support extended MMX (aka XMMX, mmxext) so this looks like a liboil bug then.


$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 6
model		: 10
model name	: AMD Athlon(TM) XP 2600+
stepping	: 0
cpu MHz		: 1905.504
cache size	: 512 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up ts
bogomips	: 3814.47
clflush size	: 32
Comment 3 Bastien Nocera 2008-02-25 10:21:21 UTC
The assignment of zoom_filter_xmmx() and draw_line_xmmx() are inside:
unsigned int cpuFlavour = oil_cpu_get_flags ();
[..]
if (cpuFlavour & OIL_IMPL_FLAG_MMXEXT) {
}

Sounds like a liboil indeed.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2008-02-25 11:04:00 UTC
Strange, if I comments out
  //__asm__ __volatile__ ("femms\n");
in xmmx.c:212 it works.

I also get the artifacts that tim reported in Bug Bug #518213 though.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2008-02-25 11:21:45 UTC
I can confirm that it also works if I change the two occurances of
 __asm__ __volatile__ ("femms\n");
to
 __asm__ __volatile__ ("emms\n");

in xmmx.c
Comment 6 Bastien Nocera 2008-02-25 11:44:24 UTC
FEMMS is AMD only, but liboil says:
 * @OIL_IMPL_FLAG_MMXEXT: uses AMD's extended MMX instructions.  These
 * are a subset of what Intel calls SSE2.  If an implementation uses
 * only AMD's extended MMX instructions, it should set this flag, and
 * not @OIL_IMPL_FLAG_SSE2.
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2008-02-25 12:00:26 UTC
I can confirm that it also works if I change the two occurances of
 __asm__ __volatile__ ("femms\n");
to
 __asm__ __volatile__ ("emms\n");

in xmmx.c.

I also filed a bug against liboil
https://bugs.freedesktop.org/show_bug.cgi?id=14662

Then also the check in goom is not enough. See
http://softpixel.com/~cwright/programming/simd/3dn.php

femms is 'faster emms' and it is part of 3dnow. My cpu does not have 3dnow. So goom should either use emms or check for 3dnow as well.
Comment 8 David Schleef 2008-02-25 22:13:58 UTC
femms is a 3dnow instruction, not mmxext, so you should check for its availability with OIL_IMPL_FLAG_3DNOW.  MMXEXT are the overlap instructions between SSE2 and 3DNow!.
Comment 9 Bastien Nocera 2008-02-25 23:23:03 UTC
Let's go with emms instead then. David, is that safe to do?
Comment 10 David Schleef 2008-02-26 08:54:44 UTC
Yes.  "emms" and "femms" are identical.  According to AMD, "femms" is faster on some CPU, but I've never seen evidence of that.
Comment 11 Sebastian Dröge (slomo) 2008-02-26 09:33:23 UTC
So this bug can be closed now:

2008-02-25  Stefan Kost  <ensonic@users.sf.net>

	* gst/goom/xmmx.c:
	  Use 'emms' instead of 'femms' to not crash on cpus that do not
	  implement this 3dnow specific instruction.