Opened 5 years ago

Last modified 2 years ago

#12220 new defect

Give a better warning on header/library mismatch for openssl

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-relay build library mismatch easy-if-you-know-build-systems
Cc: vinod@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Reported by Vinod:

I am getting the following error building tor-0.2.4.22 on my Mac (10.6.8
Snow Leopard, g++ 4.8.1_3, openssl 1.0.1h)

Undefined symbols for architecture x86_64:
  "_SSL_set_session_secret_cb", referenced from:
      _tor_tls_session_secret_cb in libor-crypto.a(tortls.o)
      _tor_tls_new in libor-crypto.a(tortls.o)
  "_EVP_aes_128_ctr", referenced from:
      _aes_new_cipher in libor-crypto.a(aes.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [src/or/tor] Error 1
make: *** [all] Error 2

He says he's building from the tarball. I asked him to check if 0.2.5.4-alpha tarball has the same issue and he says it does.

Child Tickets

Change History (23)

comment:1 Changed 5 years ago by nickm

This almost certainly means that the headers don't match the library they're linking against.

comment:2 Changed 5 years ago by arma

Vinod, did you install too many versions of openssl? Or update it in a way that isn't the right way for your platform?

comment:3 Changed 5 years ago by nickm

One way to debug this kind of thing is to run 'make V=1 src/or/tor' to see the command line Make is giving to your compiler. Look for the -I options that say which directories have the headers. When it tries to link the tor binary, look for -L options that say which directories have the libraries. If those don't match, you might need to pass a --with-openssl-dir option on the "./configure" command line, or explicitly specify your CPPFLAGS and LDFLAGS when invoking configure.

comment:4 Changed 5 years ago by cypherpunks

Thanks -- I had an old version in /usr/bin.

I had upgraded using macports that installs in /opt/local/bin (/opt/local/lib),
but doesn't delete the old versions in /usr/bin/ and /usr/lib. The confusion is likely
because the binary path points to the new version in /opt/local/bin, but its trying
to link against the old library in /usr/lib.

comment:5 Changed 5 years ago by nickm

Milestone: Tor: 0.2.5.x-finalTor: unspecified

Usually, you can get around this kind of situation by saying "--with-openssl-dir=/opt/local" on the configure command line. (I haven't tested that on macports, but on homebrew, "./configure --with-openssl-dir=/usr/local/opt/openssl" works fine for me.)

Did this get it working for you? Please let us know if so, so that we can close this ticket.

comment:6 Changed 5 years ago by arma

Is there anything Tor could do in this situation to give the user a better hint? It sure looks, to a normal user, from the compile (linker) error like it's Tor's fault.

comment:7 Changed 5 years ago by arma

(That said, if the answer is "yes but it'll be really complex and probably introduce new problems", I'll probably argue against doing it.)

comment:8 Changed 5 years ago by nickm

Summary: "ld: symbol(s) not found for architecture x86_64" compiling 0.2.4.22 tarball on OS X 10.6.8Give a better warning on header/library mismatch for openssl

comment:9 Changed 5 years ago by nickm

Milestone: Tor: unspecifiedTor: 0.2.???

comment:10 Changed 4 years ago by nickm

Milestone: Tor: 0.2.???Tor: 0.2.7.x-final

These may be worth looking at for 0.2.7.

comment:11 Changed 4 years ago by nickm

Status: newassigned

comment:12 Changed 4 years ago by nickm

Keywords: 027-triaged-1-out added

Marking triaged-out items from first round of 0.2.7 triage.

comment:13 Changed 4 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.???

Make all non-needs_review, non-needs_revision, 027-triaged-1-out items belong to 0.2.???

comment:14 Changed 4 years ago by frewsxcv

I just ran into this. In case anyone else does who uses Homebrew on OSX and has Homebrew's openssl installed, here's how I fixed it:

  • Make sure Homebrew openssl is unlinked:
    • brew unlink openssl
  • Specify the Homebrew openssl directory when compiling
    • ./configure --with-openssl-dir=/usr/local/opt/openssl

comment:15 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:16 Changed 3 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:17 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:18 Changed 2 years ago by nickm

Keywords: 027-triaged-in added

comment:19 Changed 2 years ago by nickm

Keywords: 027-triaged-in removed

comment:20 Changed 2 years ago by nickm

Keywords: 027-triaged-1-out removed

comment:21 Changed 2 years ago by nickm

Keywords: 024-backport removed

None of these is ripe for backport to 0.2.4 even if it does get fixed.

comment:22 Changed 2 years ago by nickm

Status: assignednew

Change the status of all assigned/accepted Tor tickets with owner="" to "new".

comment:23 Changed 2 years ago by nickm

Keywords: tor-relay build library mismatch easy-if-you-know-build-systems added
Severity: Normal
Note: See TracTickets for help on using tickets.