bro 1.4 - pybroccoli error

Hi all,

On Freebsd 7:

bro-sensor# python -c 'import broccoli'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "broccoli.py", line 6, in <module>
    from _broccoli_intern import *
ImportError: /usr/local/lib/python2.5/site-packages/_broccoli_intern.so:
Undefined symbol "BIO_ctrl"

This does not happen on Gentoo Linux.

--mel

Are there different OpenSSL versions installed on these systems?
Could you try one of the Broccoli test programs in aux/broccoli/test
to see if the problem occurs without the Python bindings as well?

Robin

Robin Sommer wrote:

Are there different OpenSSL versions installed on these systems?

Freebsd: OpenSSL 0.9.8e 23 Feb 2007

Gentoo: OpenSSL 0.9.8h 28 May 2008

bro-1.4-prerelease does not have such errors on both systems.

Could you try one of the Broccoli test programs in aux/broccoli/test
to see if the problem occurs without the Python bindings as well?

The test scripts fail on FreeBSD. The pybroccoli from svn also generates
the same error on FreeBSD.

Robin

--mel

mel wrote:

Freebsd: OpenSSL 0.9.8e 23 Feb 2007

I've built it using the latest OpenSSL from FreeBSD ports (0.8.9i), and
it is still giving the same error.

--mel

mel wrote:

bro-sensor# python -c 'import broccoli'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "broccoli.py", line 6, in <module>
    from _broccoli_intern import *
ImportError: /usr/local/lib/python2.5/site-packages/_broccoli_intern.so:
Undefined symbol "BIO_ctrl"

In Bro 1.4 release, running autogen.sh followed by the normal
./configure fixes this issue.

--mel

That's good to know, thanks! Not sure what the underlying problem is
but we'll see if we can find something.

Robin

We have identified the cause of the problem. On FreeBSD 7, the libtool
script we include in the Broccoli tree does not correctly create a .so
symlink in the local build directory. This causes the Python module to
be statically linked against Broccli, which in turn causes the
additional dependencies of libssl and libcrypto to remain unresolved at
runtime.

For the time being, re-running autogen.sh in aux/broccoli is the correct
workaround. Alternatively you can apply this patch to
aux/broccoli/bindings/python/setup.py:

--- setup.py~ 2008-07-14 19:17:59.000000000 -0400
+++ setup.py 2008-10-21 19:55:53.000000000 -0400
@@ -14,6 +14,6 @@
     ext_modules = [
         Extension("_broccoli_intern", ["broccoli_intern_wrap.c"],
                   library_dirs=["../../src/.libs"],
- libraries=["broccoli"])]
+ libraries=["broccoli", "ssl", "crypto"])]
)

We'll fix the issue in the 1.4.1 release.