Illegal instruction

Hi
Using SDL-1.2.6.-1.i386.rpm from libsdl.org on Celeron with P4 core I
get error “Illegal instruction”.
Here there is output /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel® Celeron® CPU 2.00GHz
stepping : 9
cpu MHz : 2018.003
cache size : 128 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 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4023.91

Source code of test program is here

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_video.h>
#include
#include <unistd.h>

using namespace std;
#define IMAGE "test.png"
int main(char argc,char **argv)
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1 )
{
cerr << “Cannot initialize SDL” << endl;
return 0;
}
atexit(SDL_Quit);

SDL_Surface *screen;
screen = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE | SDL_NOFRAME |

SDL_HWACCEL);
if (screen == NULL)
{
cerr << “Canoot set video mode” << endl;
return 0;
}

SDL_Surface *image = IMG_Load(IMAGE);
if (image == NULL)
{
	cerr << "Canoot load image" << endl;
	return 0;
}

SDL_Surface *copy = SDL_DisplayFormatAlpha(image);

SDL_Rect dest;
dest.x = dest.y = 0;
dest.w = copy->w;
dest.h = copy->h;
	
cout << "Display" << endl;

SDL_BlitSurface(copy,&dest,screen,&dest);
SDL_UpdateRects(screen,1,&dest);

SDL_Quit();

return 1;

}

When using SDL-1.2.5.rp from libsdl.org everything is ok

I’ve got the same here :
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 1078472128 (LWP 13266)]
0x4004b7d9 in SDL_CalculateAlphaBlit () from /usr/lib/libSDL-1.2.so.0
(gdb) frame 0
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
(gdb) backtrace
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
#1 0x4003f221 in SDL_UnRLESurface () from /usr/lib/libSDL-1.2.so.0
#2 0x40056ff2 in SDL_LowerBlit () from /usr/lib/libSDL-1.2.so.0
#3 0x4005723d in SDL_UpperBlit () from /usr/lib/libSDL-1.2.so.0
#4 0x08048b6d in main (argc=1 ‘\001’, argv=0xbffffc44) at bugsdl.cpp:43

(gdb) disas 0x4004b7d9 0x4004b7ff
Dump of assembler code from 0x4004b7d9 to 0x4004b7ff:
0x4004b7d9 <SDL_CalculateAlphaBlit+1001>: prefetch 0x40(%edx)
0x4004b7dd <SDL_CalculateAlphaBlit+1005>: prefetch 0x40(%ecx)
0x4004b7e1 <SDL_CalculateAlphaBlit+1009>: cmpb $0xff,0x3(%edx)
0x4004b7e5 <SDL_CalculateAlphaBlit+1013>: mov (%edx),%esi
0x4004b7e7 <SDL_CalculateAlphaBlit+1015>: je 0x4004b823
<SDL_CalculateAlphaBlit+1075>
0x4004b7e9 <SDL_CalculateAlphaBlit+1017>: movd (%edx),%mm0
0x4004b7ec <SDL_CalculateAlphaBlit+1020>: movd (%ecx),%mm1
0x4004b7ef <SDL_CalculateAlphaBlit+1023>: movq %mm0,%mm2
0x4004b7f2 <SDL_CalculateAlphaBlit+1026>: psrld $0x18,%mm2
0x4004b7f6 <SDL_CalculateAlphaBlit+1030>: punpcklwd %mm2,%mm2
0x4004b7f9 <SDL_CalculateAlphaBlit+1033>: punpckldq %mm2,%mm2
0x4004b7fc <SDL_CalculateAlphaBlit+1036>: punpcklbw %mm6,%mm0

So the illegal instruction is prefetch 0x40(%edx).

gav at osiris:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 9
model name : Intel® Pentium® M processor 1500MHz
stepping : 5
cpu MHz : 598.231
cache size : 1024 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 mce cx8 sep mtrr pge mca cmov
pat clflush dts acpi mmx fxsr sse sse2 tm pbe tm2 est
bogomips : 1182.92

My system is a Debian Sid with XFree 4.3, DRI enabled, ATI Radeon DRI
drivers.

Here are my sdl libs :

gav at osiris:~$ COLUMNS=200 dpkg -l|grep sdl|awk '{print $2, $3; }'
libsdl-console 1.3-3
libsdl-gfx1.2 2.0.9-2
libsdl-image1.2 1.2.3-2
libsdl-image1.2-dev 1.2.3-2
libsdl-mixer1.2 1.2.5-3
libsdl-net1.2 1.2.5-3
libsdl-net1.2-dev 1.2.5-3
libsdl-perl 1.20.0-12
libsdl-ttf1.2 1.2.2-5
libsdl-ttf1.2-dev 1.2.2-5
libsdl-ttf2.0-0 2.0.6-5
libsdl1.2-dev 1.2.6-3
libsdl1.2debian 1.2.6-3
libsdl1.2debian-oss 1.2.6-3

So all SDL apps that call SDL_CalculateAlphaBlit fail to work properly
(frozen-bubble for example).

I hope somebody will find a solution…

Xavier
PS: Please CC-me as I haven’t subscribed to the SDL mailing-list.

Le mer 15/10/2003 ?? 16:03, Anton Piotukh a ??crit :> Hi

Using SDL-1.2.6.-1.i386.rpm from libsdl.org on Celeron with P4 core I
get error “Illegal instruction”.
Here there is output /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel® Celeron® CPU 2.00GHz
stepping : 9
cpu MHz : 2018.003
cache size : 128 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 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4023.91

Source code of test program is here

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_video.h>
#include
#include <unistd.h>

using namespace std;
#define IMAGE "test.png"
int main(char argc,char **argv)
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1 )
{
cerr << “Cannot initialize SDL” << endl;
return 0;
}
atexit(SDL_Quit);

SDL_Surface *screen;
screen = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE | SDL_NOFRAME |
SDL_HWACCEL);
if (screen == NULL)
{
cerr << “Canoot set video mode” << endl;
return 0;
}

SDL_Surface *image = IMG_Load(IMAGE);
if (image == NULL)
{
cerr << “Canoot load image” << endl;
return 0;
}

SDL_Surface *copy = SDL_DisplayFormatAlpha(image);

SDL_Rect dest;
dest.x = dest.y = 0;
dest.w = copy->w;
dest.h = copy->h;

cout << “Display” << endl;

SDL_BlitSurface(copy,&dest,screen,&dest);
SDL_UpdateRects(screen,1,&dest);

SDL_Quit();

return 1;
}

When using SDL-1.2.5.rp from libsdl.org everything is ok

This is fixed in CVS:
http://www.libsdl.org/cvs/SDL-1.2.tar.gz

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I’ve got the same here :
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 1078472128 (LWP 13266)]
0x4004b7d9 in SDL_CalculateAlphaBlit () from /usr/lib/libSDL-1.2.so.0
(gdb) frame 0
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
(gdb) backtrace
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
#1 0x4003f221 in SDL_UnRLESurface () from /usr/lib/libSDL-1.2.so.0
#2 0x40056ff2 in SDL_LowerBlit () from /usr/lib/libSDL-1.2.so.0
#3 0x4005723d in SDL_UpperBlit () from /usr/lib/libSDL-1.2.so.0
#4 0x08048b6d in main (argc=1 ‘\001’, argv=0xbffffc44) at bugsdl.cpp:43

(gdb) disas 0x4004b7d9 0x4004b7ff
Dump of assembler code from 0x4004b7d9 to 0x4004b7ff:
0x4004b7d9 <SDL_CalculateAlphaBlit+1001>: prefetch 0x40(%edx)
0x4004b7dd <SDL_CalculateAlphaBlit+1005>: prefetch 0x40(%ecx)
0x4004b7e1 <SDL_CalculateAlphaBlit+1009>: cmpb $0xff,0x3(%edx)
0x4004b7e5 <SDL_CalculateAlphaBlit+1013>: mov (%edx),%esi
0x4004b7e7 <SDL_CalculateAlphaBlit+1015>: je 0x4004b823
<SDL_CalculateAlphaBlit+1075>
0x4004b7e9 <SDL_CalculateAlphaBlit+1017>: movd (%edx),%mm0
0x4004b7ec <SDL_CalculateAlphaBlit+1020>: movd (%ecx),%mm1
0x4004b7ef <SDL_CalculateAlphaBlit+1023>: movq %mm0,%mm2
0x4004b7f2 <SDL_CalculateAlphaBlit+1026>: psrld $0x18,%mm2
0x4004b7f6 <SDL_CalculateAlphaBlit+1030>: punpcklwd %mm2,%mm2
0x4004b7f9 <SDL_CalculateAlphaBlit+1033>: punpckldq %mm2,%mm2
0x4004b7fc <SDL_CalculateAlphaBlit+1036>: punpcklbw %mm6,%mm0

So the illegal instruction is prefetch 0x40(%edx).

gav at osiris:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 9
model name : Intel® Pentium® M processor 1500MHz
stepping : 5
cpu MHz : 598.231
cache size : 1024 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 mce cx8 sep mtrr pge mca cmov
pat clflush dts acpi mmx fxsr sse sse2 tm pbe tm2 est
bogomips : 1182.92

My system is a Debian Sid with XFree 4.3, DRI enabled, ATI Radeon DRI
drivers.

Here are my sdl libs :

gav at osiris:~$ COLUMNS=200 dpkg -l|grep sdl|awk '{print $2, $3; }'
libsdl-console 1.3-3
libsdl-gfx1.2 2.0.9-2
libsdl-image1.2 1.2.3-2
libsdl-image1.2-dev 1.2.3-2
libsdl-mixer1.2 1.2.5-3
libsdl-net1.2 1.2.5-3
libsdl-net1.2-dev 1.2.5-3
libsdl-perl 1.20.0-12
libsdl-ttf1.2 1.2.2-5
libsdl-ttf1.2-dev 1.2.2-5
libsdl-ttf2.0-0 2.0.6-5
libsdl1.2-dev 1.2.6-3
libsdl1.2debian 1.2.6-3
libsdl1.2debian-oss 1.2.6-3

So all SDL apps that call SDL_CalculateAlphaBlit fail to work properly
(frozen-bubble for example).

I hope somebody will find a solution…

Xavier
PS: Please CC-me as I haven’t subscribed to the SDL mailing-list.

Le mer 15/10/2003 ? 16:03, Anton Piotukh a ??crit :

Hi
Using SDL-1.2.6.-1.i386.rpm from libsdl.org on Celeron with P4 core I
get error “Illegal instruction”.
Here there is output /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel® Celeron® CPU 2.00GHz
stepping : 9
cpu MHz : 2018.003
cache size : 128 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 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4023.91

Source code of test program is here

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_video.h>
#include
#include <unistd.h>

using namespace std;
#define IMAGE "test.png"
int main(char argc,char **argv)
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1 )
{
cerr << “Cannot initialize SDL” << endl;
return 0;
}
atexit(SDL_Quit);

SDL_Surface *screen;
screen = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE | SDL_NOFRAME |
SDL_HWACCEL);
if (screen == NULL)
{
cerr << “Canoot set video mode” << endl;
return 0;
}

SDL_Surface *image = IMG_Load(IMAGE);
if (image == NULL)
{
cerr << “Canoot load image” << endl;
return 0;
}

SDL_Surface *copy = SDL_DisplayFormatAlpha(image);

SDL_Rect dest;
dest.x = dest.y = 0;
dest.w = copy->w;
dest.h = copy->h;

cout << “Display” << endl;

SDL_BlitSurface(copy,&dest,screen,&dest);
SDL_UpdateRects(screen,1,&dest);

SDL_Quit();

return 1;
}

When using SDL-1.2.5.rp from libsdl.org everything is ok


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

----- Original Message -----
From: xbr@info.ucl.ac.be (Xavier Brouckaert)
To:
Cc:
Sent: Monday, February 02, 2004 4:33 AM
Subject: Re: [SDL] Illegal instruction

Who built this library? What compiler was used? What architecture tuning
and optimization was used?> ----- Original Message -----

From: “Xavier Brouckaert”
To:
Cc:
Sent: Monday, February 02, 2004 4:33 AM
Subject: Re: [SDL] Illegal instruction

I’ve got the same here :
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 1078472128 (LWP 13266)]
0x4004b7d9 in SDL_CalculateAlphaBlit () from /usr/lib/libSDL-1.2.so.0
(gdb) frame 0
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
(gdb) backtrace
#0 0x4004b7d9 in SDL_CalculateAlphaBlit () from
/usr/lib/libSDL-1.2.so.0
#1 0x4003f221 in SDL_UnRLESurface () from /usr/lib/libSDL-1.2.so.0
#2 0x40056ff2 in SDL_LowerBlit () from /usr/lib/libSDL-1.2.so.0
#3 0x4005723d in SDL_UpperBlit () from /usr/lib/libSDL-1.2.so.0
#4 0x08048b6d in main (argc=1 ‘\001’, argv=0xbffffc44) at bugsdl.cpp:43

(gdb) disas 0x4004b7d9 0x4004b7ff
Dump of assembler code from 0x4004b7d9 to 0x4004b7ff:
0x4004b7d9 <SDL_CalculateAlphaBlit+1001>: prefetch 0x40(%edx)
0x4004b7dd <SDL_CalculateAlphaBlit+1005>: prefetch 0x40(%ecx)
0x4004b7e1 <SDL_CalculateAlphaBlit+1009>: cmpb $0xff,0x3(%edx)
0x4004b7e5 <SDL_CalculateAlphaBlit+1013>: mov (%edx),%esi
0x4004b7e7 <SDL_CalculateAlphaBlit+1015>: je 0x4004b823
<SDL_CalculateAlphaBlit+1075>
0x4004b7e9 <SDL_CalculateAlphaBlit+1017>: movd (%edx),%mm0
0x4004b7ec <SDL_CalculateAlphaBlit+1020>: movd (%ecx),%mm1
0x4004b7ef <SDL_CalculateAlphaBlit+1023>: movq %mm0,%mm2
0x4004b7f2 <SDL_CalculateAlphaBlit+1026>: psrld $0x18,%mm2
0x4004b7f6 <SDL_CalculateAlphaBlit+1030>: punpcklwd %mm2,%mm2
0x4004b7f9 <SDL_CalculateAlphaBlit+1033>: punpckldq %mm2,%mm2
0x4004b7fc <SDL_CalculateAlphaBlit+1036>: punpcklbw %mm6,%mm0

So the illegal instruction is prefetch 0x40(%edx).

gav at osiris:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 9
model name : Intel® Pentium® M processor 1500MHz
stepping : 5
cpu MHz : 598.231
cache size : 1024 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 mce cx8 sep mtrr pge mca cmov
pat clflush dts acpi mmx fxsr sse sse2 tm pbe tm2 est
bogomips : 1182.92

My system is a Debian Sid with XFree 4.3, DRI enabled, ATI Radeon DRI
drivers.

Here are my sdl libs :

gav at osiris:~$ COLUMNS=200 dpkg -l|grep sdl|awk '{print $2, $3; }'
libsdl-console 1.3-3
libsdl-gfx1.2 2.0.9-2
libsdl-image1.2 1.2.3-2
libsdl-image1.2-dev 1.2.3-2
libsdl-mixer1.2 1.2.5-3
libsdl-net1.2 1.2.5-3
libsdl-net1.2-dev 1.2.5-3
libsdl-perl 1.20.0-12
libsdl-ttf1.2 1.2.2-5
libsdl-ttf1.2-dev 1.2.2-5
libsdl-ttf2.0-0 2.0.6-5
libsdl1.2-dev 1.2.6-3
libsdl1.2debian 1.2.6-3
libsdl1.2debian-oss 1.2.6-3

So all SDL apps that call SDL_CalculateAlphaBlit fail to work properly
(frozen-bubble for example).

I hope somebody will find a solution…

Xavier
PS: Please CC-me as I haven’t subscribed to the SDL mailing-list.

Le mer 15/10/2003 ? 16:03, Anton Piotukh a ??crit :

Hi
Using SDL-1.2.6.-1.i386.rpm from libsdl.org on Celeron with P4 core I
get error “Illegal instruction”.
Here there is output /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel® Celeron® CPU 2.00GHz
stepping : 9
cpu MHz : 2018.003
cache size : 128 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 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4023.91

Source code of test program is here

#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_video.h>
#include
#include <unistd.h>

using namespace std;
#define IMAGE "test.png"
int main(char argc,char **argv)
{
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1 )
{
cerr << “Cannot initialize SDL” << endl;
return 0;
}
atexit(SDL_Quit);

SDL_Surface *screen;
screen = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE | SDL_NOFRAME |
SDL_HWACCEL);
if (screen == NULL)
{
cerr << “Canoot set video mode” << endl;
return 0;
}

SDL_Surface *image = IMG_Load(IMAGE);
if (image == NULL)
{
cerr << “Canoot load image” << endl;
return 0;
}

SDL_Surface *copy = SDL_DisplayFormatAlpha(image);

SDL_Rect dest;
dest.x = dest.y = 0;
dest.w = copy->w;
dest.h = copy->h;

cout << “Display” << endl;

SDL_BlitSurface(copy,&dest,screen,&dest);
SDL_UpdateRects(screen,1,&dest);

SDL_Quit();

return 1;
}

When using SDL-1.2.5.rp from libsdl.org everything is ok


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

model name : Intel® Pentium® M processor 1500MHz
stepping : 5
cpu MHz : 598.231

Yeah? 1500Mhz Genuine Intel running at 600MHz?On Fri, 2006-03-24 at 00:52 -0800, Warren Schwader wrote:


John Skaller
Felix, successor to C++: http://felix.sf.net

Sam Lantinga wrote:

Who built this library? What compiler was used? What architecture tuning
and optimization was used?

It’s a bug that was present at some point in time in the SDL cpu
detection functions, it would fail on mobile CPUs.
It’s been fixed for some time.

Stephane