Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98392 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33071 invoked from network); 3 Mar 2017 08:49:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2017 08:49:22 -0000 Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.179 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.128.179 mail-wr0-f179.google.com Received: from [209.85.128.179] ([209.85.128.179:36420] helo=mail-wr0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7C/CC-20342-01E29B85 for ; Fri, 03 Mar 2017 03:49:20 -0500 Received: by mail-wr0-f179.google.com with SMTP id u108so68928630wrb.3 for ; Fri, 03 Mar 2017 00:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=EY9ZQo2I2ul9MJYmGXmjzEUR03Z84sc6sNwVYkvP33A=; b=Hcl/lIZjEWeS+ElYc4c3t9AlweODa+TaKYGAzmH3qTWMfinu0jFenjFp8NJM2TlbDq O4r8JeivcKyFBSwHabI0y/j1qJAQPq9kMTot4woy855QRwswlzNn3H2f8aCi3IdOdjXd AAm/dKt0u7Lr7acGajqxR/XVB2ZShQjFfI8enimYCJT+ZA3o6c+1KQJBgnA1oovHnykb LquEmu0u3bwlM/uXpiLTK9Xqi7f30NQRmmty1ZX4s/HTbV2QMmjurV2CApdLVvKF2sx9 lyHvKDloQpKeOnMHYDWIJYSmwzP7VE9aR/hICd9dfl+5j+KMOBk8PQo8rTjWMd7h7vuR HeAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to; bh=EY9ZQo2I2ul9MJYmGXmjzEUR03Z84sc6sNwVYkvP33A=; b=Vi26Vo1rZP+5zCkiF0w+wfx9ZfYEGPX/K3BDFDOdx9BQuYPHCNxn9M+BmIg2uYgOvt H8CGGrJ/Qd05kCT6+j+SF1RZhwInmw+hKPesK+LkiTC5SQKZnMY3hOzchEVbVKrT8F7h CmEF0mjO7zPdDLKIxnpdZ2tPxT6NcugIdG3lWz4ScdK3VEuGa8emXTWjtiSCIkSr9Kxa +Y3lyvHul6o/A4q/Q78BpIPM9xnEZmkb+JAkb3FPEP35NviiBA+DlNdTSmhMVL5lxfxa 5LrcLyl08j2FfsSWlQ0PQrogtJ42YBw7RVOdY9j9s8p77mzw7J6Pb2ZYk390a4UQZhYc 8vHg== X-Gm-Message-State: AMke39nXE9N7SPHEzBCfoUOgNoCtHciaYc4TJOgos220Zv6cxCzorNXBXZPaETEAg/1qlg== X-Received: by 10.223.160.43 with SMTP id k40mr1599041wrk.24.1488530956684; Fri, 03 Mar 2017 00:49:16 -0800 (PST) Received: from [192.168.2.207] (89-104-28-113.customer.bnet.at. [89.104.28.113]) by smtp.googlemail.com with ESMTPSA id w207sm2163461wmw.1.2017.03.03.00.49.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 00:49:15 -0800 (PST) Sender: Michael Wallner To: Sara Golemon , PHP internals References: Message-ID: Date: Fri, 3 Mar 2017 09:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ojDLDrFWa60t5ge0LIssIRjxUnuhtFaLU" Subject: Re: [PHP-DEV] [Request for Comment] Loading dynamic libraries with cross dependencies. From: mike@php.net (Michael Wallner) --ojDLDrFWa60t5ge0LIssIRjxUnuhtFaLU Content-Type: multipart/mixed; boundary="LT4IPCTrngkm1cclanChwhGtX8m4HPXaC"; protected-headers="v1" From: Michael Wallner To: Sara Golemon , PHP internals Message-ID: Subject: Re: [PHP-DEV] [Request for Comment] Loading dynamic libraries with cross dependencies. References: In-Reply-To: --LT4IPCTrngkm1cclanChwhGtX8m4HPXaC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 28/02/17 20:13, Sara Golemon wrote: > The average PHP extension is dependent only on the PHP runtime it was > built for and probably one or more 3rd party libraries. However, a > special class of extensions (such as PDO drivers and much of the XML > family) have dependencies on other PHP extensions which may (or may > not) be preset at the time they are loaded in via ini settings and/or > dl(). >=20 > This situation was partially addressed by Wez back in PHP 5.2 with the > addition of zend_module_dep in the module entry header. Combined with > RTLD_LAZY during DL_LOAD() (a portability macro for dlopen()), this > allows modules to be inspected for dependencies and conflicts prior to > being registered with the runtime. I, for a long time, thought that the module deps facility was broken, until I discovered, that it was just not working for me, because I used a function pointer: https://github.com/m6w6/ext-http/commit/7493ad081ec06081cb8ca0f804d98a263= f93ffbc >=20 > Unfortunately RTLD_LAZY has some limitations. From `man dlopen`: > """Lazy binding is performed only for function references; references > to variables are always immediately bound when the shared object is > loaded.""" Given PHP's heavy use of XG() macros to access "globals", > the odds of a missing symbol during module load is therefore fairly > high resulting in an inability to inspect zend_module_dep structures > and provide a meaningful error message to end users. In my book, using XG() should be avoided and must not be used outside of the owning module. If really needed, there should be an appropriate public API. IMO. --=20 Regards, Mike --LT4IPCTrngkm1cclanChwhGtX8m4HPXaC-- --ojDLDrFWa60t5ge0LIssIRjxUnuhtFaLU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEHsPHHd1jWDGjN9aESA4+FLCkx8cFAli5LgoACgkQSA4+FLCk x8d7fggAy3CdrYV9hHKA/iWk61jLo7dbb9QqSfh2M0+H7oFIrQJ6f8D6O2A5Yltj QIYAFQWrKowQNXC5picGy5pcS7vgIP60kVmeqyGh/lLlMXLuvHisZjb0wNLJT+34 c4N38LzWa80LQ/P4xaAANXlWX/6H31lhOJ8QNFxtSYY615VlDByY82Ul1ENoyoM9 5UckPaCvWnjeXwzfVLn3TbsNnNUMHU2tYkgvMaw9/14I1VDcHkMOCwcv+33wBOfj bbq0TZ95RDd3mcQm1n5xuQMd+879FEyFIF/gn+XTfXz4tfFHkACMG1DurfX5xts+ eJpcv6L23DUu5kO3cS8NTJ8E0XyWgw== =Fv9U -----END PGP SIGNATURE----- --ojDLDrFWa60t5ge0LIssIRjxUnuhtFaLU--