Bug 241591 - ftp/php74-ftp: Undefined symbol "SSL_library_init"
Summary: ftp/php74-ftp: Undefined symbol "SSL_library_init"
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Torsten Zuehlsdorff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-30 15:29 UTC by Pascal Christen
Modified: 2019-11-15 09:47 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (tz)


Attachments
Log of the RC6 ftp build (9.69 KB, text/plain)
2019-11-15 09:46 UTC, Pascal Christen
no flags Details
Log of the patched RC6 ftp build (9.92 KB, text/plain)
2019-11-15 09:47 UTC, Pascal Christen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Christen 2019-10-30 15:29:26 UTC
When having PHP 7.4 installed with the php74-ftp package it fails to start:
# /usr/local/php74/bin/php
/usr/local/php74/lib/php/20190902/ftp.so: Undefined symbol "SSL_library_init"

I guess it has to do with OpenSSL 1.1.1 and the deprecated "SSL_library_init". Comparing PHP7.3 (Built with OpenSSL 1.1.1) and PHP7.4:

# readelf -a /usr/local/php74/lib/php/20190902/ftp.so  | grep SSL_library_init
00000020f6f0  004c00000007 R_X86_64_JUMP_SLO 0000000000000000 SSL_library_init + 0
    76: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND SSL_library_init
   223: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND SSL_library_init

# readelf -a /usr/local/php73/lib/php/20180731/ftp.so  | grep OPENSSL_init
00000020eb30  004c00000007 R_X86_64_JUMP_SLO 0000000000000000 OPENSSL_init_ssl@OPENSSL_1_1_0 + 0
00000020ebb8  005d00000007 R_X86_64_JUMP_SLO 0000000000000000 OPENSSL_init_crypto@OPENSSL_1_1_0 + 0
    76: 0000000000000000   238 FUNC    GLOBAL DEFAULT  UND OPENSSL_init_ssl@OPENSSL_1_1_0 (3)
    93: 0000000000000000   962 FUNC    GLOBAL DEFAULT  UND OPENSSL_init_crypto@OPENSSL_1_1_0 (4)
   232: 0000000000000000   238 FUNC    GLOBAL DEFAULT  UND OPENSSL_init_ssl@@OPENSSL
   254: 0000000000000000   962 FUNC    GLOBAL DEFAULT  UND OPENSSL_init_crypto@@OPEN
Comment 1 Pascal Christen 2019-10-30 19:38:06 UTC
I guess the problem is that the ftp module doesn't get built against the OpenSSL-Port version. Instead it's using the base version. That's the reason it choose the "SSL_library_init" instead of the new OpenSSL 1.1.1 "OPENSSL_init_ssl".

I saw some changes in the Makefile of the 7.4 port compared to the 7.2/7.3...so I just added the ENV settings on as I see so far it works...not sure if it's a general problem?

 .if ${PHP_MODNAME} == "ftp"
-CONFIGURE_ARGS+=--enable-ftp \
-               --with-openssl-dir=${OPENSSLBASE}
+CONFIGURE_ARGS+=    --enable-ftp
+CONFIGURE_ENV+=     OPENSSL_CFLAGS="-I${OPENSSLINC}" \
+            OPENSSL_LIBS="-L${OPENSSLLIB} -lssl -lcrypto"

# /usr/local/php74/bin/php -v
PHP 7.4.0RC4 (cli) (built: Oct 30 2019 15:17:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0RC4, Copyright (c), by Zend Technologies
Comment 2 Torsten Zuehlsdorff freebsd_committer 2019-11-10 21:07:53 UTC
I clearly fail to reproduce this error. Its possible that it is a general problem. This port had problems while porting it and another committer has helped me through the various SSL problems. So your change looks at least reasonable.

But i can't reproduce the error with RC 4 nor RC 5. Which FreeBSD version do you use? Can you provide a full build log if the error persists with RC 5?
Comment 3 Pascal Christen 2019-11-10 21:29:48 UTC
(In reply to Torsten Zuehlsdorff from comment #2)

For sure it only happens with FreeBSD 11.X because it doesn't have OpenSSL 1.1.1 in the base like the 12.X

Ok, I will test with the RC5 and will provide a build log if needed. But give me time until Wednesday, not in the office before this day 😉
Comment 4 Torsten Zuehlsdorff freebsd_committer 2019-11-11 11:13:33 UTC
Last time i tested it on 11.2, because i suspected the problem in the older version of the base system - like you already suspected ;)

Today RC 6 was released. Let my work on this before you test it again.

Thank you!
Comment 5 Pascal Christen 2019-11-13 12:27:08 UTC
Ok, let me know if you need any logs, [...]
Comment 6 Torsten Zuehlsdorff freebsd_committer 2019-11-15 08:28:50 UTC
RC 6 is committed. Please test again. If it still fails, i need a build log from poudriere. And logs if the error manifests in another way than already described.

Thank you!
Torsten
Comment 7 Pascal Christen 2019-11-15 09:39:24 UTC
(In reply to Torsten Zuehlsdorff from comment #6)

With the changes, I've implemented in a previous comment:

# /usr/local/php74/bin/php -v
PHP 7.4.0RC6 (cli) (built: Nov 13 2019 00:21:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0RC6, Copyright (c), by Zend Technologies

Default port:

# /usr/local/php74/bin/php -v
/usr/local/php74/lib/php/20190902/ftp.so: Undefined symbol "SSL_library_init"
Comment 8 Pascal Christen 2019-11-15 09:46:39 UTC
Created attachment 209160 [details]
Log of the RC6 ftp build
Comment 9 Pascal Christen 2019-11-15 09:47:05 UTC
Created attachment 209161 [details]
Log of the patched RC6 ftp build