Log in

View Full Version : OpenSSL 0.9.8e & invalid opcodes...someone help me out here


morph166955
25th May 2007, 17:02
So as some may have read in my post probably 3 under this one right now, I'm working on my own distro targeted to a/v users and high speed. I'm on the cusp of having a working alpha but I'm stuck on one thing. OpenSSL is refusing to compile properly no matter what I do. As it stands now, everything that I have compiled that has a "make test" or some other form of checking has worked either with no or with only the expected failures. OpenSSL has been a bit more of a pain though.

I have tried several approaches and configurations for it, none have worked. When i do a "make test" I get the following error before it stops:

[QUOTE]
echo test normal x509v1 certificate
test normal x509v1 certificate
sh ./tx509 2>/dev/null
testing X509 conversions
p -> d
openssl[21986] trap invalid opcode rip:2ba27ca274d0 rsp:7fff2e27a5a8 error: 0
make[1]: *** [test_x509] Error 1
make[1]: Leaving directory `/packages/openssl-0.9.8e/test'
make: *** [tests] Error 2
[QUOTE]

If i add a -k to it, i get similar errors on x509v3 and in a few other places. Unfortunately even when piping stderr to the output file the "trap invalid opcode" lines never make it in, probably because its the kernel spitting it back and not the script which kinda screws everything up since they wont line up if I pull them out of the syslog. Im using the CLFS guide for the base system and the CBLFS guide for the extra software to do all this (links below). Heres the versions of everything (major) thats in the system:

linux-2.6.20.1 (tested also with 2.6.17.13, no change)
gcc 4.2.0
glibc 2.5 (compiled/installed both in 32 & 64 bit)
linux-headers-2.6.20.1
coreutils 6.9
binutils 2.17
autoconf 2.61
automake 1.10
make 3.81
dejagnu 1.4.4
libtool 1.5.22
perl 5.8.8

CLFS - http://cross-lfs.org/view/svn/x86_64/
CBLFS - http://cblfs.cross-lfs.org/index.php/Main_Page

Anyone have any idea why I get this? I've googled and I can't find a single thing. If anyones wants any configs/binaries/libraries or even a compressed version of what I have right now let me know and I'll figure out some way to get it to you. I'm running out of ideas and I don't have enough of a knowledge (or any) on how openssl is coded to attempt to go in and hunt this problem down myself. Thanks!

p.s. I am also sending an email to the clfs email list asking this but I was hoping someone on here may have an idea also.

Zotty
25th May 2007, 18:18
I'll be playing with openSSL this weekend. If something pops up I'll post it here. Or if the same probem occurs offcourse.

morph166955
25th May 2007, 20:35
Thanks. I decided for testing purposes I'm going to dual boot with Ubuntu server (just finished installing it as minimal as possible). I'm going to attempt to compile and test (not install though since I don't want to mess up the already installed version) openssl using the same versions and commands to see if its a problem being generated by my install or if its something related to the hardware (I may try to load my kernel with the ubuntu libraries and stuff also to eliminate things). But definitely let me know if you run into anything since obviously openssl is critical for me and anyone else who uses ssh

madluther
25th May 2007, 22:21
What platform are you building on ? if its not IA-32 you may want to check out this link.

http://wiki.linuxfromscratch.org/blfs/wiki/OpenSSL

HTH

Mad.

morph166955
25th May 2007, 22:55
im using x86_64. I've done those methods and they all produce the same opcode error. My next trick is going to be to try the ubuntu kernel with my libraries to make sure that its not a problem with my kernel & an option in it since I know openssl works in ubuntu. I'm also going to attempt to use the same version of openssl that ubuntu uses to see if its the version that is causing the issue.

Amnon82
26th May 2007, 13:45
I posted it also into my forum: http://forum.paldo.org/index.php?action=topic&topicnr=204

maybe one of my distro-devs take a look on it.

morph166955
26th May 2007, 17:23
Awesome, thanks Amnon! I'm going to be tinkering with it tomorrow probably since my parents decided to throw a graduation party for me thats today so I'm not going to be having much time as you can imagine. I suppose one plus side to loading ubuntu on this is that I don't have to use the stupid LFS boot cd to create a backup of where I am (prevents issues with archiving folders like dev) or to create a cross compile version which is one of the more annoying things to start since you have to tell it which timezone and everything your in every single time!

Another thought I had, is it possible this sprung up because I'm using gcc 4.2.0? Would using 4.1.1 (or 4.1.2) give me different results? Does my glibc version matter for this? I tested glibc 2.5 and the bz2 version of 2.6 (which I don't believe is an official release quite yet) that was on the main gnu ftp and both gave me the same issues. If memory serves me gcc 4.2.0 passed all of its tests with out complaining at all (minus the few expected failures in the suite).

Amnon82
26th May 2007, 17:49
gcc 4.1.2 is in stable in my distro. 4.2.0 is in experimental. We have lot of problems with that version. glibc-2.5-20070218-1 is used here. maybe that is your problem.

Zotty
26th May 2007, 19:06
Just gave it a spin and it compiled without problems. Same for make and make test.

Using Debian testing base install, kernel 2.6.21.3, GCC 4.1.2, OpenSSL 0.9.8e, libc 2.3.6

morph166955
26th May 2007, 20:21
ok im going to load gcc 4.1.2 now on the box and see if that makes things run nicely instead of 4.2.0.

I was really hoping to get 4.2.0 on there though although since there isnt much more in it in the way of optimizatoin (other then more choices to do the same things just easier, eg march=native) it shouldnt really make any huge impact on anything speed wize. I'll let ya all know!

morph166955
26th May 2007, 21:59
it was gcc! i loaded 4.1.2, compiled openssl and it flew through the tests and all passed. THANKS GUYS!

Zotty
26th May 2007, 22:36
Glad to hear you solved the puzzle ;)

Amnon82
27th May 2007, 12:40
As I told ya ...

morph166955
27th May 2007, 17:31
Yes you did. TBH, my first guess was that I left something out of the kernel config since I haven't had much experience rebuilding linux kernels (I do however have quite a bit experience with freebsd kernels so I do understand most of what its asking though). My second guess was going to be something to do with the versions of either gcc, glibc or the linux headers. After that, well I think after that would have been a period of thought on why something was being stupid when it worked elsewhere on the same hardware with no issues.

THANKS AGAIN! This post right here, is one reason I visit these forums. People with knowledge of such a vast array of topics and access to others with even more knowledge who freely share advice with each other. You guys rule!

Amnon82
27th May 2007, 18:58
When you want you can join the paldo distro and take some packages as basis for your fork ... >> irc://irc.freenode.net/paldo