SWIG related: Error after installing m2crypto undefined symbol: EVP_rc5_32_12_16_ofb

S

Sean

System is Redhat 9.0, Python 2.2.3, Zope 2.6.2

built OpenSSL from source:

2791797 Sep 30 14:50:15 2003 openssl-0.9.7c.tar.gz [LATEST]

used configure options to set for /usr/local and /usr/local/openssl
make
make test
make install

--all-ok

generated demo certificates ok

modified build_ext.py in both places

built SWIG-1.3.20

make check gave error:
....
/usr/bin/ld: cannot find -lswigtcl8
collect2: ld returned 1 exit status
make[2]: *** [tcl_multi_cpp] Error 1
make[1]: *** [all] Error 2
make[1]: Target `check' not remade because of errors.
....
example.i:20: Warning(451): Setting const char * variable may leak memory
make: *** [check-tcl-examples] Error 1

(googled -lswigtcl8 with no joy) so ...

make install gave no errors

installed m2crypto 0.11 (Target for ZServerSSL is Zope-2.6.2)

[root@host tests]# python alltests.py
Traceback (most recent call last):
File "alltests.py", line 6, in ?
from M2Crypto import Rand
File "/usr/lib/python2.2/site-packages/M2Crypto/__init__.py", line 7, in ?
import __m2crypto
ImportError: /usr/lib/python2.2/site-packages/M2Crypto/__m2crypto.so: undefined
symbol: EVP_rc5_32_12_16_ofb

Theoretically I have the correct (or later) versions, so what should I check next?

TIA
 
N

Ng Pheng Siong

According to Irmen de Jong said:

I should update the FAQ. The file CHANGES in the most recent release, 0.12,
says:

Changes since 0.11
--------------------
- Excluded RC5. IDEA was taken out several releases ago. This should
allow M2Crypto to build with stock OpenSSL on various Linuxen.

Of course if you have an earlier release - you appear to have 0.11 - the
file CHANGES does not contain the above. Duh! ;-)

What to do... what to do...
 
N

Ng Pheng Siong

According to Ng Pheng Siong said:
Of course if you have an earlier release - you appear to have 0.11 - the

Sorry, "you" here means Sean, not Irmen. I actually wanted to type "OP".

FAQ updated. Zope + ExternalEditor makes it easy. ;-)

Cheers.
 
S

Sean

FAQ updated. Zope + ExternalEditor makes it easy. ;-)

I went to 0.12 and got it working, docs in 0.12 seem
identical to 0.11, maybe the zip files need to be updated?

Not quite yet. I moved up to the 2.7 version of ZServerSSL.
I had to correct a problem in z2s.py that was preventing z2s.py
from workiong with python 2.2.3

consider updating the language check to the following:

if python_version[:3] == '2.1':
if python_version[4:5] < '3':
import warnings
err = ('You are running Python version %s. This Python
version '
'has known bugs that may cause Zope to run
improperly. '
'Consider upgrading to a Python in the 2.1 series '
'with at least version number 2.1.3.' %
python_version)
warnings.warn(err)

if python_version[:3] == '2.2':
if python_version[4:5] < '2':
import warnings
err = ('You are running Python version %s. This Python
version '
'has known bugs that may cause Zope to run
improperly. '
'Consider upgrading to a Python in the 2.2 series '
'with at least version number 2.2.2.' %
python_version)
warnings.warn(err)

I also had to relocate some certificate related files (since I use
instances)
and now I'm getting a little farther. The next problem deals with:

File /usr/lib/python2.2/site-packages/M2Crypto/SSL/Context.py, line
155, in set_tmp_dh
File /usr/lib/python2.2/site-packages/M2Crypto/BIO.py, line 150, in
openfile
File /usr/lib/python2.2/site-packages/M2Crypto/BIO.py, line 139, in
__init__
SSLError: system lib

After logging this to the file it spits another message to the screen
about can't find file attribute _pyfree. I'm not sure that this
is/isn't a problem with the python version. I remember somewhere
there is a hack designed to fix something in python 2.1.3 that works
in 2.2.2 and above.

Any ideas?
 
S

Sean

Cheers.

Additional information:

Got the /usr/local/zope/z2s.py cli version to start/stop
correctly.

The bug in M2Crypto.BIO.File is only occurring when trying
to start an instance. So the question is now: what else
about an instance can I examine?

TIA
 
N

Ng Pheng Siong

According to Sean said:
I went to 0.12 and got it working, docs in 0.12 seem
identical to 0.11, maybe the zip files need to be updated?

Yes, they do. ;-)
Not quite yet. I moved up to the 2.7 version of ZServerSSL.
I had to correct a problem in z2s.py that was preventing z2s.py
from workiong with python 2.2.3

I don't understand. The following command finds nothing:

ngps@vista:~/prog/ngps/m2/demo/Zope27$ find . -name z2s.py

z2s.py is for Zope 2.6 and is found in demo/Zope/.
I also had to relocate some certificate related files (since I use
instances)

As mentioned in demo/Zope27/INSTALL.txt:

<instance-home>
-----------------------

The following files are to be copied to the corresponding directories
in your <instance-home>:

- instance_home/ssl/ca.pem
- instance_home/ssl/server.pem
- instance_home/ssl/dh1024.pem

After logging this to the file it spits another message to the screen
about can't find file attribute _pyfree.

_pyfree is used in M2Crypto to denote whether a given C pointer should be
freed on the Python side or the C side. In the case of a C-level crap-out,
a Python hashtable^Wobject instance ;-) is incompletely initialised so may
not have the _pyfree attribute. It is a benign error, in that, by the time
you get here, the python process should be cleaning up and on its way out.
;-)


Please try the steps in demo/Zope27/INSTALL.txt.

Oh, I believe I've only tested Zope 2.7 using Python 2.1 (or whichever
version zope.org's docs recommends specifically). I can't keep up with all
these version variations.

Cheers.
 
S

Sean

I don't understand. The following command finds nothing:

Actually I have 0.12, but the z2s.py from it's Zope folder.
Modified to the newer python version checker.

I'm working OK for the /usr/local/zope/z2s.py, but still
not up to speed on the instances. Still trying to determine
what's out of synch there.

Thanks again for the valuable feedback. If you have any other
suggestions I'd appreciate them!

TIA
 
S

Sean

(e-mail address removed) (Sean) wrote in message Final Scoop, I got it working!

If anyone ever has the same error:

2004-02-05T13:40:45 PANIC(300) z2 Startup exception
Traceback (innermost last):
File /usr/local/zope/z2s.py, line 789, in ?
(Object: ZLogger)
File /usr/lib/python2.2/site-packages/M2Crypto/SSL/Context.py, line
155, in set_tmp_dh
File /usr/lib/python2.2/site-packages/M2Crypto/BIO.py, line 150, in
openfile
File /usr/lib/python2.2/site-packages/M2Crypto/BIO.py, line 139, in
__init__
SSLError: system lib

What they will discover is this:

ssl_ctx.set_tmp_dh('%s/dh1024.pem' % INSTANCE_HOME)

But the file is there!
The error actually has to do with a missing server.pem!
This also fixed the missing attribute _pyfree ignored error.

But I'll leave explaining why to Ng Pheng Siong ...

Thanks to all for the help, it is sincerely appreciated!

P.S.

Ng, switch the python version test and you're python 2.2.3 ready! ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top