SWIG related: Error after installing m2crypto undefined symbol: EVP_rc5_32_12_16_ofb

Discussion in 'Python' started by Sean, Feb 3, 2004.

  1. Sean

    Sean Guest

    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
    Sean, Feb 3, 2004
    #1
    1. Advertising

  2. Re: SWIG related: Error after installing m2crypto undefined symbol:EVP_rc5_32_12_16_ofb

    Sean wrote:

    > System is Redhat 9.0, Python 2.2.3, Zope 2.6.2
    >
    > built OpenSSL from source:


    [...]

    > 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?


    The FAQ: http://sandbox.rulemaker.net/ngps/m2/faq.html

    --Irmen
    Irmen de Jong, Feb 3, 2004
    #2
    1. Advertising

  3. Re: SWIG related: Error after installing m2crypto undefined symbol:EVP_rc5_32_12_16_ofb

    According to Irmen de Jong <>:
    > Sean wrote:
    > > ImportError: /usr/lib/python2.2/site-packages/M2Crypto/__m2crypto.so:
    > > undefined symbol: EVP_rc5_32_12_16_ofb

    >
    > The FAQ: http://sandbox.rulemaker.net/ngps/m2/faq.html


    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...


    --
    Ng Pheng Siong <>

    http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
    http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL
    Ng Pheng Siong, Feb 4, 2004
    #3
  4. Re: SWIG related: Error after installing m2crypto undefined symbol:EVP_rc5_32_12_16_ofb

    According to Ng Pheng Siong <>:
    > According to Irmen de Jong <>:
    > > Sean wrote:
    > > > ImportError: /usr/lib/python2.2/site-packages/M2Crypto/__m2crypto.so:
    > > > undefined symbol: EVP_rc5_32_12_16_ofb

    > >
    > > The FAQ: http://sandbox.rulemaker.net/ngps/m2/faq.html

    >
    > 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.

    --
    Ng Pheng Siong <>

    http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
    http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL
    Ng Pheng Siong, Feb 4, 2004
    #4
  5. Sean

    Sean Guest

    > 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?

    > Cheers.


    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?
    Sean, Feb 4, 2004
    #5
  6. Sean

    Sean Guest

    > 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
    Sean, Feb 4, 2004
    #6
  7. According to Sean <>:
    > 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.


    --
    Ng Pheng Siong <>

    http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
    http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL
    Ng Pheng Siong, Feb 5, 2004
    #7
  8. Sean

    Sean Guest

    > 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
    Sean, Feb 5, 2004
    #8
  9. Sean

    Sean Guest

    (Sean) wrote in message news:<>...
    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! ;-)
    Sean, Feb 5, 2004
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. fredy
    Replies:
    2
    Views:
    393
    jimleaton
    Jul 16, 2004
  2. modemer
    Replies:
    0
    Views:
    544
    modemer
    Mar 4, 2005
  3. Adam Mercer
    Replies:
    5
    Views:
    1,176
    Robert Schuon
    Dec 21, 2010
  4. Adam Mercer
    Replies:
    3
    Views:
    341
    geremy condra
    Jul 15, 2010
  5. Replies:
    6
    Views:
    1,721
Loading...

Share This Page