Opened 15 years ago

Closed 14 years ago

#21959 closed defect (fixed)

Erlang: Undefined symbol _SSL_CTX_set_info_callback

Reported by: jadenb1729@… Owned by: bfulgham@…
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc: jabronson@…, joshgr@…, claudio.martella@…, ryandesign (Ryan Carsten Schmidt)
Port: erlang

Description (last modified by mf2k (Frank Schima))

I have a bug very similar to ticket:21930, but note that it is not related to the openssl library --I have re-installed that already.

--->  Building erlang
Error: Target org.macports.build returned: shell command " cd "/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02" && /usr/bin/make all " returned error 2
Command output: === Entering application syntax_tools
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application syntax_tools
=== Entering application pman
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application pman
=== Entering application public_key
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application public_key
=== Entering application ssl
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make -f i386-apple-darwin9.8.0/Makefile TYPE=opt
/usr/bin/gcc-4.0  -m32 -O2 -arch i386 -I/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/Users/Shared/Applications/Utilities/MacPorts/include  -o ../priv/bin/i386-apple-darwin9.8.0/ssl_esock ../priv/obj/i386-apple-darwin9.8.0/esock.o ../priv/obj/i386-apple-darwin9.8.0/debuglog.o ../priv/obj/i386-apple-darwin9.8.0/esock_poll.o ../priv/obj/i386-apple-darwin9.8.0/esock_osio.o ../priv/obj/i386-apple-darwin9.8.0/esock_utils.o ../priv/obj/i386-apple-darwin9.8.0/esock_posix_str.o ../priv/obj/i386-apple-darwin9.8.0/esock_openssl.o -lutil -ldl -lm   -L/usr/lib -lssl -lcrypto
Undefined symbols:
  "_SSL_CTX_set_info_callback", referenced from:
      _set_ssl_parameters in esock_openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [../priv/bin/i386-apple-darwin9.8.0/ssl_esock] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

(Note that it's not just me --alin.popa on the linked bug seems to have had the same problem.)

Attachments (1)

erlang.log (605.5 KB) - added by claudio.martella@… 15 years ago.
port -d install erlang log

Download all attachments as: .zip

Change History (27)

comment:1 Changed 15 years ago by mf2k (Frank Schima)

Description: modified (diff)
Owner: changed from macports-tickets@… to erlang

comment:2 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from erlang to bfulgham@…

comment:3 in reply to:  description Changed 15 years ago by alin.popa@…

Replying to jadenb1729@…:

I have a bug very similar to ticket:21930, but note that it is not related to the openssl library --I have re-installed that already.

--->  Building erlang
Error: Target org.macports.build returned: shell command " cd "/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02" && /usr/bin/make all " returned error 2
Command output: === Entering application syntax_tools
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application syntax_tools
=== Entering application pman
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application pman
=== Entering application public_key
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application public_key
=== Entering application ssl
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make -f i386-apple-darwin9.8.0/Makefile TYPE=opt
/usr/bin/gcc-4.0  -m32 -O2 -arch i386 -I/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/Users/Shared/Applications/Utilities/MacPorts/include  -o ../priv/bin/i386-apple-darwin9.8.0/ssl_esock ../priv/obj/i386-apple-darwin9.8.0/esock.o ../priv/obj/i386-apple-darwin9.8.0/debuglog.o ../priv/obj/i386-apple-darwin9.8.0/esock_poll.o ../priv/obj/i386-apple-darwin9.8.0/esock_osio.o ../priv/obj/i386-apple-darwin9.8.0/esock_utils.o ../priv/obj/i386-apple-darwin9.8.0/esock_posix_str.o ../priv/obj/i386-apple-darwin9.8.0/esock_openssl.o -lutil -ldl -lm   -L/usr/lib -lssl -lcrypto
Undefined symbols:
  "_SSL_CTX_set_info_callback", referenced from:
      _set_ssl_parameters in esock_openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [../priv/bin/i386-apple-darwin9.8.0/ssl_esock] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

(Note that it's not just me --alin.popa on the linked bug seems to have had the same problem.)

Yes, indeed I'm still having the problem. I just did a general upgrade of all ports and that started it (upgrade of erlang's port crashed with exactly the same reason like in this situation).

comment:4 in reply to:  description Changed 15 years ago by alin.popa@…

Replying to jadenb1729@…:

I have a bug very similar to ticket:21930, but note that it is not related to the openssl library --I have re-installed that already.

--->  Building erlang
Error: Target org.macports.build returned: shell command " cd "/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02" && /usr/bin/make all " returned error 2
Command output: === Entering application syntax_tools
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application syntax_tools
=== Entering application pman
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application pman
=== Entering application public_key
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
=== Leaving application public_key
=== Entering application ssl
make[3]: Nothing to be done for `opt'.
make[3]: Nothing to be done for `opt'.
make -f i386-apple-darwin9.8.0/Makefile TYPE=opt
/usr/bin/gcc-4.0  -m32 -O2 -arch i386 -I/Users/Shared/Applications/Utilities/MacPorts/var/macports/build/_Users_Shared_Applications_Utilities_MacPorts_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/Users/Shared/Applications/Utilities/MacPorts/include  -o ../priv/bin/i386-apple-darwin9.8.0/ssl_esock ../priv/obj/i386-apple-darwin9.8.0/esock.o ../priv/obj/i386-apple-darwin9.8.0/debuglog.o ../priv/obj/i386-apple-darwin9.8.0/esock_poll.o ../priv/obj/i386-apple-darwin9.8.0/esock_osio.o ../priv/obj/i386-apple-darwin9.8.0/esock_utils.o ../priv/obj/i386-apple-darwin9.8.0/esock_posix_str.o ../priv/obj/i386-apple-darwin9.8.0/esock_openssl.o -lutil -ldl -lm   -L/usr/lib -lssl -lcrypto
Undefined symbols:
  "_SSL_CTX_set_info_callback", referenced from:
      _set_ssl_parameters in esock_openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [../priv/bin/i386-apple-darwin9.8.0/ssl_esock] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

(Note that it's not just me --alin.popa on the linked bug seems to have had the same problem.)

Here is my output:

sudo port install erlang
--->  Computing dependencies for erlang
--->  Fetching erlang
--->  Verifying checksum(s) for erlang
--->  Extracting erlang
--->  Applying patches to erlang
--->  Configuring erlang
--->  Building erlang
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02" && /usr/bin/make all " returned error 2
Command output: esock.c: In function 'do_accept':
esock.c:1625: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
esock.c: In function 'dump_connections':
esock.c:1719: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
esock.c:1725: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
esock.c:1730: warning: pointer targets in passing argument 3 of 'getpeername' differ in signedness
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/debuglog.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 debuglog.c
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/esock_poll.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 esock_poll.c
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/esock_osio.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 esock_osio.c
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/esock_utils.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 esock_utils.c
esock_utils.c: In function 'esock_malloc':
esock_utils.c:38: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
esock_utils.c: In function 'esock_realloc':
esock_utils.c:50: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/esock_posix_str.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 esock_posix_str.c
/usr/bin/gcc-4.0 -c -o ../priv/obj/i386-apple-darwin9.8.0/esock_openssl.o -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include -DHAVE_CONFIG_H -O2 -I/usr/include esock_openssl.c
esock_openssl.c: In function 'set_ssl_parameters':
esock_openssl.c:905: warning: pointer targets in initialization differ in signedness
esock_openssl.c:906: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
/usr/bin/gcc-4.0  -m32 -O2 -arch i386 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R13B02/erts/i386-apple-darwin9.8.0  -no-cpp-precomp  -I/opt/local/include  -o ../priv/bin/i386-apple-darwin9.8.0/ssl_esock ../priv/obj/i386-apple-darwin9.8.0/esock.o ../priv/obj/i386-apple-darwin9.8.0/debuglog.o ../priv/obj/i386-apple-darwin9.8.0/esock_poll.o ../priv/obj/i386-apple-darwin9.8.0/esock_osio.o ../priv/obj/i386-apple-darwin9.8.0/esock_utils.o ../priv/obj/i386-apple-darwin9.8.0/esock_posix_str.o ../priv/obj/i386-apple-darwin9.8.0/esock_openssl.o -lutil -ldl -lm   -L/usr/lib -lssl -lcrypto
Undefined symbols:
  "_SSL_CTX_set_info_callback", referenced from:
      _set_ssl_parameters in esock_openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[4]: *** [../priv/bin/i386-apple-darwin9.8.0/ssl_esock] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

Error: Status 1 encountered during processing.

comment:5 Changed 15 years ago by jabronson@…

Cc: jabronson@… added

Cc Me!

comment:6 Changed 15 years ago by alin.popa@…

ok, so I managed to workaround this issue by doing these steps:

  1. uninstall openssl
  2. install erlang
  3. install openssl

It seems to me that the openssl here is the problem.

comment:7 Changed 15 years ago by joshgr@…

Cc: joshgr@… added

Cc Me!

comment:8 in reply to:  6 Changed 15 years ago by joshgr@…

Replying to alin.popa@…:

ok, so I managed to workaround this issue by doing these steps:

  1. uninstall openssl
  2. install erlang
  3. install openssl

I'm seeing this issue, and the fix suggested above (for both this and ticket:21930) did NOT fix the problem for me. I am unable to build the erlang port due to "Undefined symbols: _SSL_CTX_set_info_callback"

comment:9 Changed 15 years ago by bfulgham@…

Are you running Leopard or earlier?

In earlier versions of Erlang I had a patch that removed the call to SSL_CTX_set_info_callback. However, current builds of openssl on Snow Leopard (and in MacPorts) seem to have this function exported in its SSL library.

If this is only happening for non-SL users, I can revise the pre-SL targets to incorporate this patch.

comment:10 in reply to:  9 Changed 15 years ago by joshgr@…

Replying to bfulgham@…:

Are you running Leopard or earlier?

Yes, running Leopard. Good catch.

If this is only happening for non-SL users, I can revise the pre-SL targets to incorporate this patch.

Please do! I'll be happy to report my findings here once I've tried it.

comment:11 Changed 15 years ago by valeriy.zamarayev@…

I've just hit the same problem on Leopard, the erlang port attempts to use the system version of OpenSSL (in /usr/lib). I've worked around the problem by editing the Portfile so that the following is added to configure:

--with-ssl=/opt/local 

I think the fix should do this rather than patch Erlang sources.

comment:12 in reply to:  11 Changed 15 years ago by joshgr@…

Replying to valeriy.zamarayev@…:

I've just hit the same problem on Leopard, the erlang port attempts to use the system version of OpenSSL (in /usr/lib). I've worked around the problem by editing the Portfile so that the following is added to configure:

--with-ssl=/opt/local 

I think the fix should do this rather than patch Erlang sources.

Adding this to configure in the Portfile fixed me, too, thanks!

comment:13 Changed 15 years ago by bfulgham@…

It turns out that the problem was caused by the fact that Erlang builds with SSL *by default*. This means that the build was attempting to find (and use) SSL, even when the "+ssl" was not supplied by the user.

Correction was to disable SSL in the default build, and make sure that the SSL support builds proper with the +ssl variant.

comment:14 Changed 15 years ago by bfulgham@…

Resolution: fixed
Status: newclosed

comment:15 Changed 15 years ago by bfulgham@…

comment:16 Changed 15 years ago by mf2k (Frank Schima)

Cc: claudio.martella@… added

Cc reporter of duplicate #22086.

comment:17 Changed 15 years ago by jabronson@…

i am still getting this as of tuesday morning. please see 21809#comment:7 for a log. is this problem in fact resolved?

comment:18 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: closedreopened

Confirmed, the error still occurs for me on 10.5.8 with Xcode 3.1.3.

comment:19 in reply to:  17 Changed 15 years ago by bfulgham@…

Replying to jabronson@…:

i am still getting this as of tuesday morning. please see 21809#comment:7 for a log. is this problem in fact resolved?

Can uninstall erlang, do a "port clean --work erlang", and then run the build as "port -d install erlang" and update the ticket with the log?

My guess is that configure is still attempting to include openssl support, which is finding the Apple install of openssl (which is missing the _SSL_CTX_set_info_callback symbol.) But I can't confirm without seeing the output of the configuration stage to see if it is properly excluding SSL from the build. If it is, then the SSL portion of the Makefiles is probably bad and is being built regardless of user settings.

Changed 15 years ago by claudio.martella@…

Attachment: erlang.log added

port -d install erlang log

comment:20 Changed 15 years ago by claudio.martella@…

I did that and attached the log

comment:21 Changed 15 years ago by lucas@…

This is still happening. Is anybody working on it?

The workaround to uninstall SSL, then install Erlang, then reinstall SSL is too invasive because of how many other modules depend on SSL, so will have to be uinstalled and rebuilt from scratch. I'd guess it's a day of hassling to even try it, whether or not it works.

comment:22 Changed 15 years ago by dirker@…

I can confirm that erlang still does not compile on 10.5.8. However, this issue can easily be worked around by using the +ssl variant which sets the correct path for openssl.

comment:23 in reply to:  21 Changed 15 years ago by jadenb1729@…

Replying to lucas@…:

The workaround to uninstall SSL, then install Erlang, then reinstall SSL is too invasive because of how many other modules depend on SSL, so will have to be uinstalled and rebuilt from scratch. I'd guess it's a day of hassling to even try it, whether or not it works.

You can use the --force parameter to uninstall openssl without uninstalling its dependents.

comment:24 Changed 15 years ago by bfulgham@…

I have just committed an update that incorporates a patch from the earlier version of Erlang. Basically, it just comments out the line with the offending symbol.

Please try again with the current Portfile and let me know if the problem is resolved.

comment:25 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

erlang @R13B04_0 still links with MacPorts openssl, even if I haven't asked for the +ssl variant. It also links with ncurses, though it declares no dependency on that either.

comment:26 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.