Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

libevent won't build if libssl-dev is installed #55

Closed
jtracey opened this issue Jul 30, 2018 · 3 comments
Closed

libevent won't build if libssl-dev is installed #55

jtracey opened this issue Jul 30, 2018 · 3 comments

Comments

@jtracey
Copy link
Contributor

jtracey commented Jul 30, 2018

After updating my lab machine to Ubuntu 18.04, libevent stopped building successfully:

make[2]: Entering directory '/home/j3tracey/shadow-plugin-tor/build/libevent-2.0.21-stable'
/bin/bash ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./compat -I./include -I./include    -fPIC -I/home/j3tracey/.shadow -Wall -fno-strict-aliasing -pthread -MT bufferevent_openssl.lo -MD -MP -MF .deps/bufferevent_openssl.Tpo -c -o bufferevent_openssl.lo bufferevent_openssl.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -fPIC -I/home/j3tracey/.shadow -Wall -fno-strict-aliasing -pthread -MT bufferevent_openssl.lo -MD -MP -MF .deps/bufferevent_openssl.Tpo -c bufferevent_openssl.c  -fPIC -DPIC -o .libs/bufferevent_openssl.o
bufferevent_openssl.c: In function 'bio_bufferevent_new':
bufferevent_openssl.c:106:3: error: dereferencing pointer to incomplete type 'BIO {aka struct bio_st}'
  b->init = 0;
   ^~

Poking around a bit showed it was getting the <openssl/bio.h> header from my machine's installed libraries instead of the locally built copy. Uninstalling libssl-dev on my machine let it work properly, but since other packages (e.g. node) depend on it (and just generally the build script shouldn't be looking there), this isn't a general solution.

I'm currently fixing shadow/shadow#423, but depending on how long that takes I might be able to see what's going on and fix this.

@robgjansen
Copy link
Member

It seems like we might be able to fix this with a change to CFLAGS or some other minor cmake change.

I wonder if this would be fixed in the latest version of libevent:
https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz

Although, the new version might cause other issues to appear, so I'm not sure if that is the best approach (although we should probably upgrade at some point.)

@robgjansen
Copy link
Member

I wonder if we still need to build libevent or openssl thanks to elf loader namespaces, as long as we already have the OS provided packages. I haven't tried yet if that actually works.

For libevent, we want to intercept the dns function.

For openssl, we still want to intercept the crypt and cipher functions to avoid unnecessary computation.

The test would be to link to the OS provided packages and break on those preloaded functions to see if they still get called.

robgjansen pushed a commit that referenced this issue Oct 15, 2018
Fixed include and lib paths when configuring libevent. Now references
the customized openssl library in $(HOME)/.shadow instead of the
default one. This PR should fix issue #55.
@robgjansen
Copy link
Member

Fixed in #56 (e2c6343)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants