Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71504 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10276 invoked from network); 24 Jan 2014 14:02:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jan 2014 14:02:16 -0000 Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.177 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.128.177 mail-ve0-f177.google.com Received: from [209.85.128.177] ([209.85.128.177:46495] helo=mail-ve0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/90-39789-66272E25 for ; Fri, 24 Jan 2014 09:02:14 -0500 Received: by mail-ve0-f177.google.com with SMTP id jz11so1948587veb.22 for ; Fri, 24 Jan 2014 06:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=DGhIebqjJlNDJ0GMiV/w1ITWfs5qnQrGJcNFdQaxg9w=; b=XHCAxRcnv/vHL380BNfRroE+90Gw10Yzl9K6pzZ27y27YyHfMxnScPFVlqAc5Gi2eh NriCi0y6iZ/+G3IOXY3KSY2iBrUVYbwoAWt1dkOcz2X5/YTvap32HolWSrxNST52R4LY j+k5qpAeLFzFi5Gc6pKFlQIsi1NciitQqvif7w2996EbsTkKhA7ALufalPz7g7rZFxu7 FEMdgSorbJdXktQLKW0HbCpW73dMJlsDMR0YIhNQO3bNp0bvoB/4lVdoXHPwjylmmKmx wjD8W2ZATIto7M5ACjpEPAFQFuM4o6iXY7LjLfxjuSjhPz/Hrs+0IFUPLrVQ7iKFai6Q TUbA== X-Received: by 10.58.161.46 with SMTP id xp14mr224544veb.37.1390572131507; Fri, 24 Jan 2014 06:02:11 -0800 (PST) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.158.206 with HTTP; Fri, 24 Jan 2014 06:01:31 -0800 (PST) In-Reply-To: <1390568541.2941.27.camel@guybrush> References: <1390568541.2941.27.camel@guybrush> Date: Fri, 24 Jan 2014 15:01:31 +0100 X-Google-Sender-Auth: BTN8mPV65BnoTcwLUcWzhmtaAnk Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Sara Golemon , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Module API Introspection From: jpauli@php.net (Julien Pauli) On Fri, Jan 24, 2014 at 2:02 PM, Johannes Schl=FCter wrote: > On Fri, 2014-01-24 at 11:31 +0100, Sara Golemon wrote: >> http://wiki.php.net/rfc/moduleapi-inspection >> > > the idea is neat, i however wonder how often this will not work due to > missing symbols. At least on systems which support that we dlopen() > using the DL_LOAD flag to lazy load which will often prevent that > error. Nice catch. However, sure, there will be failing cases like there are when loading extensions. We just can't get rid off them, and have to leave with them, like our extension system works today. Sara's patch anyway use the same macros used in the extension system (DL_LOAD, particulary, which uses RTLD_LAZY). > > Cases where this can fail, form top of my head, are at least > > * extensions trying to hack get_module() (if you are crazy you can > create your own get_module() which detects the PHP version and > does compatibility magic, one binary for all, yes that exists > and works) Quiet uncommon isn't it ? The same can be said with actual extension system, this can even lead to security holes, but we just cant do anything about this. > * accessing PHP symbols from the init section (i.e. from default > constructors being called for global variables in C++ > extensions) Same : that is an edge case, pretty uncommon as well, 99.9% of extension developpers dont do that. > * I think (didn't check) there will be issues due to tsrm symols > when an extension provides INI options and TSRM/non-TSRM doesn't > match I don't get it. We access very few fields of zend_module_entry, and they are all placed before the _zend_ini_entry one. So if there is a problem of alignment mismatch, we won't be affected AFAIK. > * Afaik Windows' LoadLibrary doesn't do lazy loading but will > confront the user with a dialog box when symbols can't be found > * ... I'm sure there are more Same : the same happens on WIndows when you try to load an extension. So , we already manage this behavior and cant do anything about it. Julien