Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] fully enabling dl() for FPM SAPI [RSS Feed]

#1 Jan. 17, 2011 18:20:36

Johannes S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] fully enabling dl() for FPM SAPI


On Fri, 2011-01-14 at 17:15 +0300, Antony Dovgal wrote:
> Hi all!
>
> Are there any objections if I disable E_DEPRECATED notice in dl() for FPM
> SAPI?
> The notice is already disabled for CGI/FastCGI, CLI and Embed SAPIs.
> I believe there's no reason for this notice in case of FPM, too.
>
> Patch:http://dev.daylessday.org/diff/fpm_dl_notice.diffI think it can be quite dangerous if you have extensions living shorter
than the PHP process. Not only might dlclose() cause some leaks but
there are a few extensions playing with function pointers or opcode
handlers which aren't properly reset so a following request might try to
jump to invalid memory.

Additionally there's no restriction on this once safe_mode is gone, so
anybody could load any C extension - while that can be fixed by
advertising disable_function=dl


johannes


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#2 Jan. 18, 2011 08:02:17

Antony D.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] fully enabling dl() for FPM SAPI


On 01/17/2011 09:19 PM, Johannes Schlüter wrote:
> I think it can be quite dangerous if you have extensions living shorter
> than the PHP process. Not only might dlclose() cause some leaks but
> there are a few extensions playing with function pointers or opcode
> handlers which aren't properly reset so a following request might try to
> jump to invalid memory.

dlclose()? I can assure you I'm not going to call dlclose() on each request
shutdown.
****
Yes, that means once an extension is loaded it'll stay till the death of this
particular child process).
But it does work here for the last 5 or 6 years this way and this is indeed
what I want.
****

TBH I'm not even sure dlclose() is called at all since I wasn't able to track
this call down through all the handlers, destructors and so on in 5 min I spent
on this..

> Additionally there's no restriction on this once safe_mode is gone, so
> anybody could load any C extension - while that can be fixed by
> advertising disable_function=dl

That's right, disabling it is not a problem.

--
Wbr,
Antony Dovgal
---http://pinba.org- realtime statistics for PHP

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#3 Jan. 18, 2011 09:49:20

Johannes S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] fully enabling dl() for FPM SAPI


On Tue, 2011-01-18 at 11:00 +0300, Antony Dovgal wrote:
> On 01/17/2011 09:19 PM, Johannes Schlüter wrote:
> > I think it can be quite dangerous if you have extensions living shorter
> > than the PHP process. Not only might dlclose() cause some leaks but
> > there are a few extensions playing with function pointers or opcode
> > handlers which aren't properly reset so a following request might try to
> > jump to invalid memory.
>
> dlclose()? I can assure you I'm not going to call dlclose() on each request
> shutdown.
> ****
> Yes, that means once an extension is loaded it'll stay till the death of this
> particular child process).
> But it does work here for the last 5 or 6 years this way and this is indeed
> what I want.
> ****
>
> TBH I'm not even sure dlclose() is called at all since I wasn't able to track
> this call down through all the handlers, destructors and so on in 5 min I
> spent on this..


module_destructor() calls it and expected it to be hit on rshutdown,
else has really weird behavior - for some processes an extension would
be loaded, for others not which results in non-deterministic behavior
for the outside.http://lxr.php.net/opengrok/xref/PHP_5_3/Zend/zend_API.c#2120johannes


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

#4 Jan. 18, 2011 10:08:26

Derick R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] fully enabling dl() for FPM SAPI


On Fri, 14 Jan 2011, Antony Dovgal wrote:

> Are there any objections if I disable E_DEPRECATED notice in dl() for FPM
> SAPI?
> The notice is already disabled for CGI/FastCGI, CLI and Embed SAPIs.
> I believe there's no reason for this notice in case of FPM, too.

IMO, it should be disabled in fastcgi too. Ages ago we came to the
conclusion it was dangerous/annoying/broken to have dl() work with
processes that run multiple-requests.

cheers,
Derick

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] fully enabling dl() for FPM SAPI [RSS Feed]

Board footer

Moderator control

Enjoy the 21st of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support