<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>31345</bug_id>
          
          <creation_ts>2003-10-17 05:19 0000</creation_ts>
          <short_desc>libsdl-1.2.6 gives illegal instruction crash</short_desc>
          <delta_ts>2003-11-02 02:05:51 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://www.libsdl.org/pipermail/sdl/2003-October/057304.html</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>paul@cablon.nl</reporter>
          <assigned_to>games@gentoo.org</assigned_to>
          <cc>alexs81@libero.it</cc>
    
    <cc>d3vlin@marconi.demon.nl</cc>

      

      
          <long_desc isprivate="0">
            <who>paul@cablon.nl</who>
            <bug_when>2003-10-17 05:19:26 0000</bug_when>
            <thetext>running enigma with libsdl-1.2.6 or libsdl-1.2.6-r1 crashes within 2 seconds 
with an Illegal instruction. Downgrading to libsdl-1.2.5-r2 solves the problem. 
gdb enigma gives the following information: 
Program received signal SIGILL, Illegal instruction. 
[Switching to Thread 16384 (LWP 11515)] 
0x40033bc0 in BlitRGBtoRGBPixelAlphaMMX3DNOW () from /usr/lib/libSDL-1.2.so.0 
 

Reproducible: Always
Steps to Reproduce:
1. emerge enigma 
2. emerge rsync 
3. emerge world -u -p 
4. enigma 
Actual Results:  
The program shows the title screen and disappears. The command prompt displays 
the text &quot;Illegal instruction&quot; 

Expected Results:  
Not crashed 

emerge info 
Portage 2.0.49-r13-2 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.22) 
================================================================= 
System uname: 2.4.22 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz 
Gentoo Base System version 1.4.3.10p1 
ccache version 2.2 [enabled] 
ACCEPT_KEYWORDS=&quot;x86&quot; 
AUTOCLEAN=&quot;yes&quot; 
CFLAGS=&quot;-march=pentium4 -O3 -pipe&quot; 
CHOST=&quot;i686-pc-linux-gnu&quot; 
COMPILER=&quot;gcc3&quot; 
CONFIG_PROTECT=&quot;/etc /var/qmail/control /usr/share/config 
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb 
/usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ 
/usr/share/texmf/tex/platex/config/&quot; 
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/env.d&quot; 
CXXFLAGS=&quot;-march=pentium4 -O3 -pipe&quot; 
DISTDIR=&quot;/usr/portage/distfiles&quot; 
FEATURES=&quot;autoaddcvs sandbox ccache buildpkg&quot; 
GENTOO_MIRRORS=&quot;http://ftp.easynet.nl/mirror/gentoo/ 
http://gentoo.mirror.sdv.fr http://ftp.snt.utwente.nl/pub/os/linux/gentoo 
http://ftp.gentoo.skynet.be/pub/gentoo/ 
http://mirrors.sec.informatik.tu-darmstadt.de/gentoo&quot; 
MAKEOPTS=&quot;-j4&quot; 
PKGDIR=&quot;/usr/portage/packages&quot; 
PORTAGE_TMPDIR=&quot;/var/tmp&quot; 
PORTDIR=&quot;/usr/portage&quot; 
PORTDIR_OVERLAY=&quot;&quot; 
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot; 
USE=&quot;x86 oss apm avi crypt encode foomaticdb gif jpeg gnome libg++ mad mikmod 
mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gtkhtml 
gdbm berkdb slang readline arts tetex bonobo svga ggi java guile mysql X sdl 
gpm tcpd pam libwww ssl perl python imlib oggvorbis gtk qt kde motif opengl 
mozilla acpi alsa cdr dvd esd gphoto2 pcmcia pda pnp aalib cups&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2003-10-18 00:04:27 0000</bug_when>
            <thetext>could you try this ?
export EXTRA_ECONF=&quot;--disable-nasm&quot;
emerge libsdl</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>paul@cablon.nl</who>
            <bug_when>2003-10-18 03:11:35 0000</bug_when>
            <thetext>Okay, I&apos;ve tried that. It gives exactly the same problem as I had originally.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>paul@cablon.nl</who>
            <bug_when>2003-10-18 07:06:20 0000</bug_when>
            <thetext>I&apos;ve been looking at the source code, unencumbered by much linux programming
knowledge...
The problem seems to occur in BlitRGBtoRGBPixelAlphaMMX3DNOW, which is interesting
as my P4 doesn&apos;t have any 3DNow instructions. Looking for the function call
we see in src/video/SDL_blit_A.c line 1457

f=CPU_Flags();
if((f&amp;(TDNOW_CPU|MMX_CPU))==(TDNOW_CPU|MMX_CPU))
  return BlitRGBtoRGBPixelAlphaMMX3DNOW;

CPU_Flags seems to be the result of a cpuid call, EAX=1 - standard level
flags. Unfortunately, as far as I can see, the 3dnow flag is not part of
the standard level flags, but part of the extended level flags (see http://www.sandpile.org/ia32/cpuid.htm).
The code checks the correct bit, but doesn&apos;t have the necessary information
available. Again, without much further knowledge, I would evaluate this as
a libSDL bug.
Hope this makes sense.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tyler@mithander.com</who>
            <bug_when>2003-10-19 19:46:40 0000</bug_when>
            <thetext>I ran into this also (with castle-combat).  Looking at the sdl archives they
know about it and have a plan to fix it.  Until then I&apos;ll just run 1.2.5</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hythloday@gentoo.org</who>
            <bug_when>2003-10-30 12:34:52 0000</bug_when>
            <thetext>*** Bug 30643 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hythloday@gentoo.org</who>
            <bug_when>2003-10-30 12:50:16 0000</bug_when>
            <thetext>*** Bug 29205 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mr_bones_@gentoo.org</who>
            <bug_when>2003-11-01 00:21:39 0000</bug_when>
            <thetext>I just added libsdl-1.2.6-r2.ebuild to CVS.  Please try it out and see if
it makes a difference for you.

Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>paul@cablon.nl</who>
            <bug_when>2003-11-01 05:53:57 0000</bug_when>
            <thetext>I just tried, but I couldn&apos;t install it.

root # emerge libsdl -u
Calculating dependencies ...done!
&gt;&gt;&gt; emerge (1 of 1) media-libs/libsdl-1.2.6-r2 to /
&gt;&gt;&gt; md5 src_uri ;-) SDL-1.2.6.tar.gz
&gt;&gt;&gt; Unpacking source...
&gt;&gt;&gt; Unpacking SDL-1.2.6.tar.gz to /var/tmp/portage/libsdl-1.2.6-r2/work
patching file src/video/xbios/SDL_xbios.c
Hunk #1 FAILED at 22.
1 out of 2 hunks FAILED -- saving rejects to file src/video/xbios/SDL_xbios.c.rej
patching file src/video/xbios/SDL_xbios.c
Hunk #1 FAILED at 22.
1 out of 2 hunks FAILED -- saving rejects to file src/video/xbios/SDL_xbios.c.rej
patching file src/video/x11/SDL_x11modes.c
Hunk #1 FAILED at 22.
1 out of 2 hunks FAILED -- saving rejects to file src/video/x11/SDL_x11modes.c.rej

!!! ERROR: media-libs/libsdl-1.2.6-r2 failed.
!!! Function src_unpack, Line 37, Exitcode 1
!!! patch failed
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mr_bones_@gentoo.org</who>
            <bug_when>2003-11-01 14:17:40 0000</bug_when>
            <thetext>Yeah, I dorked up the patch with RCS ids.  I&apos;ve fixed it in CVS, so please
resync and try it again.  Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>paul@cablon.nl</who>
            <bug_when>2003-11-02 02:05:51 0000</bug_when>
            <thetext>Yep, that seems to work. Thanks for the effort.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>