Discussion:
named illegal instruction on i486
Frank Wille
2014-04-22 00:52:33 UTC
Permalink
Hi!

I have some trouble with named(8) after having updated my Soekris Net-4501
from 5.1.2 to 6.1.4.

The Soekris is used as a router and has an AMD Elan SC (486-class) CPU.

When launching the new named it runs into an illegal instruction very
early and dumps a core into /etc/namedb. In this core file the top three
functions from the backtrace were:

atomic_cas_64_ni (libc)
atomic_add_64_nv (libc)
isc_stats_increment (libisc)
...

The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.

Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?

Thanks in advance.
--
Frank Wille
Christos Zoulas
2014-04-22 11:43:37 UTC
Permalink
Post by Frank Wille
Hi!
I have some trouble with named(8) after having updated my Soekris Net-4501
from 5.1.2 to 6.1.4.
The Soekris is used as a router and has an AMD Elan SC (486-class) CPU.
When launching the new named it runs into an illegal instruction very
early and dumps a core into /etc/namedb. In this core file the top three
atomic_cas_64_ni (libc)
atomic_add_64_nv (libc)
isc_stats_increment (libisc)
...
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.

christos
Dave Huang
2014-04-22 13:19:40 UTC
Permalink
Post by Christos Zoulas
Post by Frank Wille
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.
I thought cmpxchg was available on the 486 (but not on the 386)...
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: ***@azeotrope.org | they raise a paw / the bat, the cat /
FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 38 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++
Christos Zoulas
2014-04-22 14:23:48 UTC
Permalink
Post by Dave Huang
Post by Christos Zoulas
Post by Frank Wille
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.
I thought cmpxchg was available on the 486 (but not on the 386)...
that's cmpxchg8b...
The easiest way is to comment out __HAVE_ATOMIC64_OPS in
/usr/src/sys/arch/i386/include/types.h and rebuild everything.

christos
Christos Zoulas
2014-04-22 15:57:50 UTC
Permalink
Post by Christos Zoulas
Post by Dave Huang
Post by Christos Zoulas
Post by Frank Wille
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.
I thought cmpxchg was available on the 486 (but not on the 386)...
that's cmpxchg8b...
The easiest way is to comment out __HAVE_ATOMIC64_OPS in
/usr/src/sys/arch/i386/include/types.h and rebuild everything.
That breaks rumpzfs which I ``fixed'' on head.

christos
Frank Wille
2014-04-22 21:23:47 UTC
Permalink
Post by Christos Zoulas
Post by Frank Wille
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.
Ok, I managed to rebuild named with NAMED_USE_PTHREADS=no (actually I
had to rebuild the whole release). It works now. Thanks!

Maybe it would be nice to fix the atomic operations in future as there
are still some embedded 486-class boards, like Soekris, in use. :)
--
Frank Wille
Christos Zoulas
2014-04-23 02:58:45 UTC
Permalink
Post by Frank Wille
Post by Christos Zoulas
Post by Frank Wille
The disassembly shows that the CPU fails on executing the instruction
"lock cmpxchg...", which is only available for Pentium CPUs and higher.
Any idea what went wrong? Is it a general problem in libc or was named
built for >=Pentium?
Looks that way (our assembly files are written for >= pentium). Until
that gets fixes, you can turn off NAMED_USE_PTHREADS.
Ok, I managed to rebuild named with NAMED_USE_PTHREADS=no (actually I
had to rebuild the whole release). It works now. Thanks!
Maybe it would be nice to fix the atomic operations in future as there
are still some embedded 486-class boards, like Soekris, in use. :)
It is fixed in head...

christos

Loading...