Illegal instruction (SIGILL) occured!

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.
Post Reply
browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Illegal instruction (SIGILL) occured!

Post by browny_amiga » Wed Apr 30, 2008 4:33 am

Hi all

I am having trouble compiling Linuxsampler and the respective libs and tools on a Kubuntu 7.10

Everything runs well, but when I start up Qsampler and load an instrument, the backend crashes with the below message.
I know that this illegal instruction comes from compiling with the wrong options for my CPU (which is according do /proc/cpuinfo a
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) Processor
stepping : 2
cpu MHz : 1343.222
)
Now first I tried to tell the config that it should compile for that CPU,
CXXFLAGS="-O3 -march=k6 -ffast-math -fomit-frame-pointer -funroll-loops" in the configure line in the debian/rules file and then compiling and building with
dpkg-buildpackage -rfakeroot -b exactly how you specified in the debian tutorial.
Unfortunately, this still produces the illegal instructions, so I removed the -march=k6 directive totally, including the other 3 (-ffast-math -fomit-frame-pointer -funroll-loops), leaving it with just -O3 but that produces the same result.

Could it be that the recompiling with the changed debian/rules file does not work, since I have to do a clean or autoclean? (since the config and some files have been written already)
If I don't specify any architecture, it should just assume I486 right? Unoptimized code, running on all that is I486 (or I386).

Would be glad for any pointers, can't wait to start fiddling around with linuxsampler.

Markus

---------crash log----------------------------------------
LinuxSampler 0.5.1
Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
Copyright (C) 2005-2007 Christian Schoenebeck
Detected features: MMX
Creating Sampler...OK
Registered sampler engines: 'GIG'
Registered MIDI input drivers: ALSA
Registered audio output drivers: ALSA,JACK
Loading instrument editor plugins...OK
Registered instrument editors:
Starting LSCP network server (0.0.0.0:8888)...OK
LinuxSampler initialization completed. :-)

LSCPServer: Client connection established on socket:4.
LSCPServer: Client connection established on socket:5.
Starting disk thread...OK
Scheduling '/home/browny/gig/Pipe Organ Full.gig' (Index=0) to be loaded in background (if not loaded yet).
Loading gig file '/home/browny/gig/Pipe Organ Full.gig'...OK
Loading gig instrument ('/home/browny/gig/Pipe Organ Full.gig',0)...>>> FATAL ERROR: Illegal instruction (SIGILL) occured! <<<
Showing stack trace...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
Attaching to program: /usr/bin/linuxsampler, process 10840
Reading symbols from /usr/lib/linuxsampler/liblinuxsampler.so.1...done.
Loaded symbols for /usr/lib/linuxsampler/liblinuxsampler.so.1
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread -1213688112 (LWP 10840)]
[New Thread -1480688752 (LWP 10853)]
[New Thread -1481217136 (LWP 10852)]
[New Thread -1224795248 (LWP 10850)]
[New Thread -1216402544 (LWP 10849)]
[New Thread -1213690992 (LWP 10841)]
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /lib/tls/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /usr/lib/libgig.so.6...done.
Loaded symbols for /usr/lib/libgig.so.6
Reading symbols from /lib/libuuid.so.1...done.
Loaded symbols for /lib/libuuid.so.1
Reading symbols from /usr/lib/libjack-0.100.0.so.0...done.
Loaded symbols for /usr/lib/libjack-0.100.0.so.0
Reading symbols from /usr/lib/libasound.so.2...done.
Loaded symbols for /usr/lib/libasound.so.2
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xffffe410 in __kernel_vsyscall ()
(gdb) Hangup detected on fd 0
error detected on stdin
The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]
Detaching from program: /usr/bin/linuxsampler, process 10840
Killing LinuxSampler...
Killed

browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Re: Illegal instruction (SIGILL) occured!

Post by browny_amiga » Thu May 01, 2008 3:44 pm

Doesn't anybody know what I could try else? I am not that great in compiling, always try to avoid whenever possible.
The illegal instruction must be due to code getting generated for the wrong CPU, right?

Glad for any pointers, no matter how remote.

Markus

Alex
Moderator
Posts: 316
Joined: Wed Jan 23, 2008 9:08 pm

Re: Illegal instruction (SIGILL) occured!

Post by Alex » Fri May 02, 2008 2:01 pm

Markus, sorry for the delay in getting back to you. We're all rather busy at the moment with different projects. :mrgreen:

Did you recompile gigedit at the same version as LS? If not, LS won't work.
Try that and get back here.

Alex.

p.s. Welcome onboard!

8-)

User avatar
cuse
Developer
Posts: 366
Joined: Wed Jan 23, 2008 10:07 pm
Location: Germany

Re: Illegal instruction (SIGILL) occured!

Post by cuse » Sat May 03, 2008 8:46 pm

Check the output, that is the actual g++ commands that are executed to compile LS. Your processor does not support SSE instructions and I guess thats exactly the problem you have, I'm pretty sure you compiled LS with SSE enabled. So there should be no "-msse" and no "-mfpmath=sse" in the g++ commands.

browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Re: Illegal instruction (SIGILL) occured!

Post by browny_amiga » Mon Jun 02, 2008 11:46 pm

Good and bad news:

the good: I got it working on a laptop, with a Pentium III 1.3 ghz.

the bad: The machine that I tried to do it on still refuses to work. I recompiled everything, even erased all the source files, so nothing old was left. I did not specify any directives in the configure file, so it should not switch on things that my CPU will not like.

# cat /proc/cpuinfo tells me:
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 4
model name : AMD Athlon(tm) Processor
stepping : 2
cpu MHz : 1343.062
cache size : 256 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 sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow up
bogomips : 2687.84
clflush size : 32

I will check out which options g++ is run with.

Markus

browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Re: Illegal instruction (SIGILL) occured!

Post by browny_amiga » Tue Jun 03, 2008 12:14 am

Now I catched a glimpse of

/bin/bash ../../libtool --mode=link g++ -Wreturn-type -ffast-math -march=i686 -g -O2 -pthread -msse -o liblinuxsamplerdb.la

in the make script being executed.

Somewhere in the debian rules files it is defining which architecture (i686 and -msse) and that is of course wrong.
Where can I switch it on or off?

there is no CXXFLAGS="
statement anywhere, so I wonder where it is defined?

Markus

browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Re: Illegal instruction (SIGILL) occured!

Post by browny_amiga » Tue Jun 17, 2008 12:52 am

Still stumped.

Even do a ./configure and make will end up compiling with options that my CPU cannot tolerate.
Isn't it Debian policy that packages should be done on i486 and nothing higher, too be compatible with everything upwards?
i know that it won't perform good, but right now I would just like to get it running at any speed, instead of crashing at illegal instructions.

Markus

browny_amiga
Newbie
Posts: 15
Joined: Tue Apr 29, 2008 4:41 pm

Re: Illegal instruction (SIGILL) occured!

Post by browny_amiga » Tue Jun 17, 2008 1:18 am

I just don't get it really!

the manual on the linuxsampler webpage does not work (the one for debian):
This is the line where you'll place all your optimization options. Remove the arguments --host and --build which are only meant for cross compilation and prefix the line with your preferred optimization flags. So, for a Pentium4 machine it could look like:

CXXFLAGS="-O3 -msse -march=pentium4 -mfpmath=sse -ffast-math -fomit-frame-pointer -funroll-loops" ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info


I reduce the line in my case to this:
CXXFLAGS="-O3" ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info

Switching all optimisations off, just to make it compile without them. But then, no matter what I do (even when I leave the original debian/rules) file or do a manual ./configure and make, I always catch this:

g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I/usr/local/include -Wreturn-type -ffast-math -O3 -pthread -msse -MT Synthesizer.lo -MD -MP -MF .deps/Synthesizer.Tpo -c Synthesizer.cpp -fPIC -DPIC -o .libs/Synthesizer.o

So obviously it is ignoring what I keep telling it and still uses optimizations like SSE and so on.

Is this broken and does not compile on any older machine or am I just doing everything wrong?

It would be a great help if you could provide debian packages for I386, just to be able to see Linuxsampler in action, even on a low end machine. I use it with just one instrument to practice the piano and works swell on another machine ( a 1.3 ghz Pentium one)

One thing that I have not mentioned before: This is a Kubuntu 7.10, but that should not make a difference should it (basically the same a Debian)

Glad for any pointers.

Markus

Post Reply