Re: Why do disabled functions / classes generate a WARNING.

From: Date: Fri, 03 Aug 2012 14:27:48 +0000
Subject: Re: Why do disabled functions / classes generate a WARNING.
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-62006@lists.php.net to get a copy of this message
On Fri, Aug 3, 2012 at 3:08 PM, Leigh <leight@gmail.com> wrote: > Hi all, > > Can anyone explain to me the reason that when a function or class is > disabled via the ini setting, an attempt to access the disabled item > generates a non-fatal error? > > I'm looking at a segfault in the SPL caused by the blind creation of a > class, which seems to only fail when the class is disabled. I'm > wondering in how many other places this could occur. > > The obvious solution is to be more careful and check return values, > but a FATAL would also have prevented execution continuing. > > Thanks, > > Leigh. Hi: this is a very badly bug. but I think it's not a spl issues, we should change the behavior of zend_disable_class, since for now, it will delete the class entry, which will make the class entry pointer (preserved by extension) become a wild pointer.. dereference it is a undefined behavior, in this sense, segfault is lucky. thanks > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Laruence Xinchen Hui http://www.laruence.com/

« previous php.internals (#62006) next »