Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel 2.4.20 => nano Illegal instruction
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Thu Mar 13, 2003 10:46 am    Post subject: Kernel 2.4.20 => nano Illegal instruction Reply with quote

Quite a few people are having this problem (here on the forums and on the net) but I found nowhere a solution other than keeping your old 2.4.19 kernel.

Here is the problem :
You have a working and stable 2.4.19 kernel. When you upgrade to a 2.4.20 (be it vanilla or gentoo-sources) a certain number of executables don't work anymore, including nano and top. They return "Illegal instruction".

Since a lot of people having this problem have a Athlon XP (1700-1800), it may be related to Athlon-XP specific optimizations, but since everything works properly using the 2.4.19 kernel, the bug is triggered by some change between 2.4.19 and 2.4.20. I originally found the problem when I tried the 2.4.20-vanilla sources, and I have wait for the 2.4.20-gentoo sources to crosscheck : they both exhibit the same behaviour.

The *only* workaround seems to be : keep a 2.4.19 kernel

On nano for example, I tried all sorts of compile options (including a plain -mcpu=i386 -O2) without success. So I think it's not gcc-related, it's rather kernel-related. Maybe something is missing in my 2.4.20 kernel config, but I can't see what.

I searched on the kernel website and the gcc website : a lot of people reported a similar problem but I have not seen any real solution yet (like "it will be solved in 2.4.21").

Any hint ? Should I file a bug so that the 2.4.20-gentoo sources finally include a bugfix ?

-K
Back to top
View user's profile Send private message
px
Guru
Guru


Joined: 26 Sep 2002
Posts: 497
Location: Metz, France

PostPosted: Thu Mar 13, 2003 12:20 pm    Post subject: Reply with quote

I have an athlon-xp 1800, a 2.4.20 gentoo-sources kernel and nano work with no problem... It might come from your kernel config.
_________________
Nous autres, mordus d'informatique, préférons par-dessus tout passer notre temps à bidouiller nos ordinateurs, plutôt que les utiliser pour faire quelque chose de productif. [Dave Barry]
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Thu Mar 13, 2003 12:31 pm    Post subject: Re: Kernel 2.4.20 => nano Illegal instruction Reply with quote

Tried a vanilla kernel?

I'm running An Athlon xp 2100+

Might be a bug in the slower chips.
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Thu Mar 13, 2003 12:51 pm    Post subject: Re: Kernel 2.4.20 => nano Illegal instruction Reply with quote

gilesjuk wrote:
Tried a vanilla kernel?

Yes 2.4.20-vanilla and 2.4.20-gentoo-sources both have the bug.

px wrote:
I have an athlon-xp 1800, a 2.4.20 gentoo-sources kernel and nano work with no problem... It might come from your kernel config.

Maybe... But the 2.4.20 kernel used in the 1.4RC2 LiveCD also has the problem, and I figure it's been compiled with good settings...

It's more like a 2.4.20 / recent Athlon 1800XP "0.13 microns core" compatibility problem. Only happens on some Athlons, and only if you use a 2.4.20 kernel.

-K
Back to top
View user's profile Send private message
CaveDweller
n00b
n00b


Joined: 15 Feb 2003
Posts: 12

PostPosted: Fri Mar 14, 2003 1:53 am    Post subject: Reply with quote

I've been following the Athlon XP "illegal instruction" issue for three months. I, too, would like a definitive solution but I haven't seen one yet. :? It's odd that 2.4.19 seems to be the only kernel that works.

One rather ugly work around is to recompile the problem programs with "-mno-sse" in your CFLAGS. Good luck figuring out what to recompile. Tip: the nano problem is really ncurses.

I've never tried compiling kernels with "-mno-sse". Has anyone else tried that?

Cheers,
Mark
_________________
Oracle on VMS: All your global page are belong to us.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Mar 14, 2003 2:05 am    Post subject: Reply with quote

If you want to compile without sse instructions :
Code:
CFLAGS="-march=athlon ... "

This is the same as -march=athlon-xp, but without support for sse.

btw. I have a 0.13 micron athlon-xp 2600 running fine with 2.4.21-pre5-ac2 (based on 2.4.20 vanilla) and nano works fine - even with sse enabled.
Back to top
View user's profile Send private message
CaveDweller
n00b
n00b


Joined: 15 Feb 2003
Posts: 12

PostPosted: Fri Mar 14, 2003 2:11 am    Post subject: Reply with quote

cyrillic wrote:
If you want to compile without sse instructions :
Code:
CFLAGS="-march=athlon ... "

This is the same as -march=athlon-xp, but without support for sse.


Hmmm. Interesting. I'll have to play around with that. Too bad I left my Gentoo laptop at work today.

Cheers,
Mark
_________________
Oracle on VMS: All your global page are belong to us.
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Fri Mar 14, 2003 8:30 am    Post subject: Reply with quote

cyrillic wrote:
If you want to compile without sse instructions :
Code:
CFLAGS="-march=athlon ... "

This is the same as -march=athlon-xp, but without support for sse.

I tried -march=athlon on the nano build without success. But if the problem lies in ncurses, I suppose we should rather test new flags on the emerge ncurses, rather than on nano/top/whatever exhibits the bug...

Note that would explain why on the problematic configs make menuconfig hangs just after the functions parsing (ncurses display)...

Any explanation on why this ncurses/some-athlonXP-related-optimization problem only occurs on 2.4.20 kernels ?

-K
Back to top
View user's profile Send private message
CaveDweller
n00b
n00b


Joined: 15 Feb 2003
Posts: 12

PostPosted: Sat Mar 15, 2003 2:15 am    Post subject: Reply with quote

Koon wrote:

Any explanation on why this ncurses/some-athlonXP-related-optimization problem only occurs on 2.4.20 kernels ?

It's not just 2.4.20 kernels. I've experienced this problem with acpi-sources, ac-sources, vanilla-sources and three flavors of 2.5 kernels (around 2.5.55) from kernel.org. Gentoo-sources (2.4.19-r10) is the only kernel I've found that doesn't exhibit this problem.

I have no clue why. I'm still looking for a solution.

Cheers,
Mark
_________________
Oracle on VMS: All your global page are belong to us.
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Sat Mar 15, 2003 3:00 am    Post subject: Reply with quote

Interesting differences between the makefiles:

2.4.20 (Gentoo sources)

HOSTCFLAGS = -Wall -Wstrict-prototypes -O3 -fomit-frame-pointer -pipe

2.4.19 (Gentoo sources)

HOSTCFLAGS = -Wall -Wstrict-prototypes -Os -fomit-frame-pointer

Those CFLAGS for 2.4.20 look a bit suspect. I would change them to what they were before.

Just checked 2.5.64 (Gentoo sources), -02. I would think it's a good idea to remove optimisation flags if you're having problems.
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
m00dawg
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jan 2003
Posts: 145
Location: Texas

PostPosted: Sun Mar 16, 2003 8:02 pm    Post subject: Kernel 2.4.20 Makefile modifications Reply with quote

I tried stepping down the optimizations in the Makefile of the 2.4.20 kernel, but I am still having Illegal Instruction problems with BitchX, gkrellm, mozilla, and alsamixer (at least). This problem was not evident before I did 'make world' or before I upgraded to 2.4.20.

I'm running an Athlon XP 1800+ that I just bought from Googlegear. I don't yet know what revision, however - didn't really care too much :)
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Mon Mar 17, 2003 1:18 am    Post subject: Re: Kernel 2.4.20 Makefile modifications Reply with quote

more /proc/cpuinfo

See if there are any "bugs" listed.

This is mine, no bugs listed:

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 2100+
stepping : 1
cpu MHz : 1785.656
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 apic sep mtrr pge mca cmov pat pse36 mmx
fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 3514.36
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Mon Mar 17, 2003 8:37 am    Post subject: Re: Kernel 2.4.20 Makefile modifications Reply with quote

CaveDweller wrote:
It's not just 2.4.20 kernels. I've experienced this problem with acpi-sources, ac-sources, vanilla-sources and three flavors of 2.5 kernels (around 2.5.55) from kernel.org. Gentoo-sources (2.4.19-r10) is the only kernel I've found that doesn't exhibit this problem.

I have no clue why. I'm still looking for a solution.

It would be annoying if we were stucked to 2.4.19-gentoo for some kind of bug we are the only one to have :cry:
We should join forces to solve this one. Join the Illegal Instruction Club !

gilesjuk wrote:
more /proc/cpuinfo
See if there are any "bugs" listed.

There's mine, exhibiting the nano illegal instruction bug :

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 1800+
stepping : 0
cpu MHz : 1526.857
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 tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 3047.42

Differences are : stepping and flags pse & apic. I don't know what these represent.

-K
Back to top
View user's profile Send private message
msx2
n00b
n00b


Joined: 15 Sep 2002
Posts: 1
Location: Bennebroekl/Netherlands

PostPosted: Mon Mar 17, 2003 11:40 am    Post subject: Reply with quote

and another victim... Athlon-xp 2000 at 2100. Compiling ncurses with just the -march=athlon flag fixed the nano problem and I was able to compile a 2.4.20 kernel. Although with that kernel I couldn't even get X to work (nvidia/nv drivers caused some problems)

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 2100+
stepping : 0
cpu MHz : 1725.160
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 tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 3447.19
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Mon Mar 17, 2003 5:04 pm    Post subject: Reply with quote

msx2 wrote:
and another victim...

Welcome to the Illegal Instruction Club.

Your CPU looks like mine (except the frequency) so maybe it's linked somehow to the absence of pse/apic flag ? To the stepping 0 ? Anyone knows what these reprensent ?

-K
Back to top
View user's profile Send private message
CaveDweller
n00b
n00b


Joined: 15 Feb 2003
Posts: 12

PostPosted: Tue Mar 18, 2003 2:00 am    Post subject: Reply with quote

OK, I'll add my "Illegal Instruction" CPU to the list. Maybe we can find something in common.

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : mobile AMD Athlon(tm) XP 1800+
stepping : 0
cpu MHz : 1523.492
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 tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips : 3014.65
_________________
Oracle on VMS: All your global page are belong to us.
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Tue Mar 18, 2003 2:30 am    Post subject: Reply with quote

Hmm, so far my CPU appears to be the only one with stepping=1. I have a recent Thoroughbred core (the B core).

I also have apic as one of the flags, where are others don't.
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
Sastraxi
Apprentice
Apprentice


Joined: 25 Feb 2003
Posts: 258

PostPosted: Tue Mar 18, 2003 5:40 am    Post subject: Reply with quote

Some people have problems with apic and boot the kernel without them. They really aren't that useful (only for symmetric multi-processing).
Back to top
View user's profile Send private message
really
Guru
Guru


Joined: 27 Aug 2002
Posts: 430
Location: nowhere

PostPosted: Tue Mar 18, 2003 5:16 pm    Post subject: Reply with quote

i have the same problem :)

ogg123 nano and some other programs fail to run, and xfree and texinfo and gcc fails to compile by an "Illegal Instruction" error.

my cpu is a AMD Duron 750Mhz and it worked just fine until i reinstalled it. :/
_________________
NoManNoProblem

Get lost before you get shot.
Back to top
View user's profile Send private message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Tue Mar 18, 2003 9:35 pm    Post subject: Reply with quote

I still think this is a compiler flag problem, illegal instruction suggests to me that the compiler has created illegal code. A bugged compiler or heavy optimisation could in some case generate bad code.

I would suggest those who have this problem should remove any optimisation flags from the kernel makefile
(in each directory, drivers etc..). Either that or stick to 2.4.19 until someone cracks the problem.

Processors do have bugs too, the compilers are supposed to be altered to never generate the sequence that causes a problem. This might happen if there is a bug in the compiler or an older version of the compiler hasn't had any fixes backported.
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Wed Mar 19, 2003 9:22 am    Post subject: Reply with quote

gilesjuk wrote:
I still think this is a compiler flag problem, illegal instruction suggests to me that the compiler has created illegal code. A bugged compiler or heavy optimisation could in some case generate bad code.

I hear you, but then why is the same generated code running properly on my 2.4.19-gentoo-sources kernel and generating Illegal Instructions on a 2.4.20(-vanilla or -gentoo-sources) ? I just switch kernels (I don't recompile anything else)...

Maybe it's a 2.4.20 config option problem ? I tested the 2.4.20 kernel from boot CD 1.4RC2 and vanilla and gentoo-sources compiled kernels (with the same .config as my working 2.4.19) : they all exhibit the bug. Next step : I will try another Install-CD 2.4.20 (from Knoppix ?) to see if a have Illegal Instructions on the Gentoo-compiled executables on the mounted hard disk.

-K (confused)
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Apr 23, 2003 7:18 am    Post subject: Reply with quote

Koon wrote:

Next step : I will try another Install-CD 2.4.20 (from Knoppix ?) to see if a have Illegal Instructions on the Gentoo-compiled executables on the mounted hard disk.


I am currently experiencing this same bug. What were the results of your test? How can I work around this?
Back to top
View user's profile Send private message
Koon
Retired Dev
Retired Dev


Joined: 10 Dec 2002
Posts: 518

PostPosted: Wed Apr 23, 2003 7:25 am    Post subject: Reply with quote

I didn't have the time to do the test, so for the moment I use a 2.4.19 kernel.
When I will have to upgrade I will test the following :

- try a Knoppix 2.4.20 and run Gentoo-optimized binaries from the disk, just to check if the problem is kernel-related
- compile an advanced-optimized 2.4.20 kernel (2.4.21 should it exist by then)
- compile a 2.5.xxx kernel

But I have no time to test for now so I will do it when I will have no other choice than to upgrade...

-K
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Apr 23, 2003 7:40 am    Post subject: Reply with quote

Koon wrote:

- try a Knoppix 2.4.20 and run Gentoo-optimized binaries from the disk, just to check if the problem is kernel-related


Thanks for the mega-quick reply. I just tried booting from a knoppix_3.2 cd (with 2.4.20), chrooted to the hard disk and tried to run top. I got the illegal instruction again. So you don't need to do this test again.
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Apr 23, 2003 8:27 am    Post subject: Reply with quote

Check this link:
https://forums.gentoo.org/viewtopic.php?t=42459&highlight=illegal+instruction

It seems that this is a kernel bug in that the kernel is not turning on the sse flag for the newer athlons. Check your /proc/cpuinfo when running 2.4.20 versus 2.4.19. It should be fixed in 2.4.21.

My problem is that I have an older athlon (model 4), which doesn't seem to support this flag), but I stupidly turned on the sse flag anyway. This means that such actions as building texinfo and running top try to use this flag, but cannot. In my case, I need to re-emerge without sse. In your case, you need to get the kernel patch, or wait for 2.4.21.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum