php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78345 OpenSSL tests using workers fail due to missing openssl ext in worker process
Submitted: 2019-07-29 09:08 UTC Modified: 2019-07-29 09:56 UTC
From: rainer dot jung at kippdata dot de Assigned:
Status: Verified Package: Testing related
PHP Version: 7.4.0beta1 OS: Linux x86_64, Solaris 10 Sparc
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
16 - 1 = ?
Subscribe to this entry?

 
 [2019-07-29 09:08 UTC] rainer dot jung at kippdata dot de
Description:
------------
Several OpenSSL extension tests fork a new process executing various server tasks. This new process is created as another PHP process, but without any explicit ini or extension loading - at least on Linux/Unix. In our case the OpenSSl extension must be dynamically loaded and there is not implicit php.ini that PHP would automatically load. Thus the new server worker fails and as a result the tests fail.

This is true for the following tests (based on 7.0beta1, but mostly the same holds true for current 7.3 and 7.2):

- ext/openssl/tests/bug65729.phpt
- ext/openssl/tests/bug68265.phpt
- ext/openssl/tests/bug68879.phpt
- ext/openssl/tests/bug68920.phpt
- ext/openssl/tests/bug69215.phpt
- ext/openssl/tests/bug76705.phpt
- ext/openssl/tests/san_peer_matching.phpt
- ext/openssl/tests/sni_server.phpt
- ext/openssl/tests/sni_server_key_cert.phpt
- ext/openssl/tests/streams_crypto_method.phpt
- ext/openssl/tests/tls_min_v1.0_max_v1.1_wrapper.phpt
- ext/openssl/tests/tls_wrapper.phpt
- ext/openssl/tests/tls_wrapper_with_tls_v1.3.phpt
- ext/openssl/tests/tlsv1.0_wrapper.phpt
- ext/openssl/tests/tlsv1.1_wrapper.phpt
- ext/openssl/tests/tlsv1.2_wrapper.phpt
- ext/openssl/tests/tlsv1.3_wrapper.phpt

I don't have a good patch for it. As soon as I add a default php.ini which loads the openssl extension, everything is fine. I also verified that the failure is due to the missing openssl extension in the worker by running tests under strace and watching the server warnings that are swallowed by the child. As a workaround I used the following patch, but it should be conditional on whether openssl is a static or shared extension. I don't know, how Windows behaves.

Index: ext/openssl/tests/ServerClientTestCase.inc
--- ext/openssl/tests/ServerClientTestCase.inc       2019-07-26 02:13:34.988151000 +0000
+++ ext/openssl/tests/ServerClientTestCase.inc       2019-07-28 23:01:28.525371000 +0000
@@ -72,7 +72,7 @@
             );
         } else {
             $cmd = sprintf(
-                '%s "%s" %s %s',
+                '%s -d extension=openssl "%s" %s %s',
                 PHP_BINARY,
                 __FILE__,
                 WORKER_ARGV_VALUE,



Patches

test_php_extra_args (last revision 2019-07-29 10:42 UTC by cmb@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-29 09:50 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-07-29 09:50 UTC] cmb@php.net
This issue has been basically resolved for Windows with commit
10a2cee[1].  Using TEST_PHP_EXTRA_ARGS might be more correct and
portable.

This ticket looks like a duplicate of bug #68230.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=10a2ceef3bfada85e7046231476d06f08d3de69c>
 [2019-07-29 09:56 UTC] rainer dot jung at kippdata dot de
Right, this is a duplicate of 68230.

I haven't checked, whether the oatch in 68230 fixes it for us, especially what happens if "-d extension=openssl" was given to the test run as a commandline param. Probably the correct fixes should be very similar of even the same for Windows and Linux/Unix.
 [2019-07-29 10:42 UTC] cmb@php.net
The following patch has been added/updated:

Patch Name: test_php_extra_args
Revision:   1564396961
URL:        https://bugs.php.net/patch-display.php?bug=78345&patch=test_php_extra_args&revision=1564396961
 [2019-07-29 13:28 UTC] rainer dot jung at kippdata dot de
Your patch works well here. I learned about the EXTENSIONS section which is interestingly not used by any of the bundled PHP extension tests. I tried the patch with that new section in the phpt and also with "-d extension=openssl" on the run-tests.php commandline. Both worked. Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 22:01:26 2024 UTC