Re: [PHP-DEV] Coverity Scan

2011-08-09 Thread Joey Smith
On Sat, Aug 06, 2011 at 08:07:01PM -0700, Rasmus Lerdorf wrote:
 Coverity has run a new scan of trunk and there are a lot of valid
 issues. You have probably noticed that I have started to fix some of
 them, but there are 500+ to go, so I could use some help. The following
 people already have Coverity accounts:
 
 andi, antony, colder, derick, dmitry, helly, iliaa, jcogg, joey, kmori,
 mike, nickpj, nlopess, phoddie, rui, sas, scottmac, sean, sesser, slif,
 steph, tgoldstein, thiago, wez and zeev
 
 If you would like to help out and you don't have an account, please send
 me an email or catch me on irc and I will get you set up.
 
 Once you have an account, go to:
 
 http://scan.coverity.com/rung2.html
 
 And click on the Sign in link next to PHP
 
 If you start working on fixing one of these, please assign it to
 yourself first within the Coverity UI so others will know.
 
 -Rasmus


A lot of the 'STACK_USE' ones seem to be false positives; it's reporting
when the stack exceeds the maximum single use of 1024 bytes - that 1024
is a Coverity-configurable value which defaults to 1024.

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



Re: [PHP-DEV] Coverity Scan

2011-08-09 Thread Rasmus Lerdorf
On 08/08/2011 11:45 PM, Joey Smith wrote
 A lot of the 'STACK_USE' ones seem to be false positives; it's reporting
 when the stack exceeds the maximum single use of 1024 bytes - that 1024
 is a Coverity-configurable value which defaults to 1024.

Yup, we can simply mark those as intentional/ignore although it wouldn't
be a bad idea to have a quick look at each one to see if we really need
to chew up 1k of stack on each of those occasions. People using PHP in
embedded systems would appreciate that, I bet.

-Rasmus

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



Re: [PHP-DEV] [RFC] Choosing a distributed version control system for PHP (or not). Call for Participation.

2011-08-09 Thread Jordi Boggiano
On 08.08.2011 08:58, Ryan McCue wrote:
 Kiall Mac Innes wrote:
 Later on in the doc, you go into detail about submodules, and CRLF - LF
 support in both Git and Hg.
 
 To be fair, submodules don't work exactly the same. Unlike
 svn:externals, which are linked to a repository, submodules are linked
 to a repository *and a commit*. That means that if an external is
 updated, the submodule must be updated, and that change must be committed.

The main difference is that submodules are entire repositories, while in
svn you can take sub-trees as externals.

The difference you mention is not really one, because you can do the
same in svn using 'foo -r1000 svn://somerepo' and have it fixed to one
revision, just like git does. It's a much saner approach anyway to avoid
people having out-of-sync versions of the externals.

Cheers

-- 
Jordi Boggiano
@seldaek - http://nelm.io/jordi

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



Re: [PHP-DEV] Coverity Scan

2011-08-09 Thread Joey Smith
On Tue, Aug 09, 2011 at 12:19:53AM -0700, Rasmus Lerdorf wrote:
 On 08/08/2011 11:45 PM, Joey Smith wrote
  A lot of the 'STACK_USE' ones seem to be false positives; it's reporting
  when the stack exceeds the maximum single use of 1024 bytes - that 1024
  is a Coverity-configurable value which defaults to 1024.
 
 Yup, we can simply mark those as intentional/ignore although it wouldn't
 be a bad idea to have a quick look at each one to see if we really need
 to chew up 1k of stack on each of those occasions. People using PHP in
 embedded systems would appreciate that, I bet.
 
 -Rasmus

Quite a few of the ones I looked at were reporting it due to MAXPATHLEN,
which I imagine we probably want to leave untouched - I'll just mark those
as intentional/ignore.

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



Re: [PHP-DEV] [RFC] Choosing a distributed version control system for PHP (or not). Call for Participation.

2011-08-09 Thread Ryan McCue
Joey Smith wrote:
 In fact, if you're using git as your DVCS, there's even a bunch of
 porcelain [2] to make it easier to manage your trees.

Side note: For anyone not familiar with Git terminology: plumbing is
all the commands that alter the repository, while porcelain are tools
built on top of that (such as the commit, push, pull, merge
commands that people would be familiar with).
-- 
Ryan McCue
http://ryanmccue.info/

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



Re: [PHP-DEV] [VOTE] Weak References

2011-08-09 Thread Arvids Godjuks
I have mixed feelings about this proposal - from one point it's quite
neat - ability to mark circular references for the memory manager so
it can free them sounds very delicious, especially for some cases. I
had run into my own bunch of problems with memory in PHP in the past
and right now I'm running a daemon written in PHP in production on
5.3.6. Careful construction and knowledge that circular references
actually do harm I did add safeguards that actually clean up the
objects in recursive manner (and objects have internal flags that
cleanup has been initiated - that way I make sure I cleanup the same
object only once). That sort of planing at the design stage makes it
far more friendly with memory, so it doesn't mean that PHP should have
soft references.

My opinion is that if this can be done without using significant
resources and will not have major issues while implementing - it can
be added, otherwise just skip it - better off fixing bugs and
optimizing :)

2011/8/6 Lars Schultz lars.schu...@toolpark.com:
 Am 06.08.2011 02:14, schrieb Hannes Landeholm:

 Yeah I think there's a lot of misunderstandings going on with weak/soft
 references and how the garbage collector works. Weak/soft references is
 not
 some kind of solution to the cyclic reference problem. The GC takes care
 of
 that already. You can use whatever OOP patterns with whatever reference
 graphs you like Lars, the GC will free the entire structure as soon as the
 cyclic collector runs after you are not referencing it anymore. You might
 have become a bit confused with my last post where I explained how one
 could
 theoretically hack together a soft reference implementation by using weak
 references and some properties of cyclic collection. Also property access
 performance is off-topic.

 I did not misunderstand how weak/soft-references or php's new GC works.

 Having a GC collect circular references is neat, but if I remember
 correctly, collecting them (which is why there are other, faster methods but
 which require more memory) is neither simple nor fast (whatever that means)
 so...if I can assist the GC by clearly stating that my child-objects may be
 collected as soon as they and their parent are not referenced from userland
 anymore thus not requiring the GC and thus freeing memory as soon as
 possible,...seems like an optimization worth thinking of. Especially if I
 tend to have vast structures with hundreds of objects.

 In 5.2 (we can't move our project to 5.3 yet because of a BC issue) i had to
 manually clear those cycles before dropping the last userland reference to
 the tree of objects because otherwise I'd run into memory problems when
 processing alot of those trees.


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



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



Re: [PHP-DEV] [VOTE] Weak References

2011-08-09 Thread Lars Schultz

Am 09.08.2011 14:22, schrieb Arvids Godjuks:

I have mixed feelings about this proposal - from one point it's quite
neat - ability to mark circular references for the memory manager so
it can free them sounds very delicious, especially for some cases. I
had run into my own bunch of problems with memory in PHP in the past
and right now I'm running a daemon written in PHP in production on
5.3.6. Careful construction and knowledge that circular references
actually do harm I did add safeguards that actually clean up the
objects in recursive manner (and objects have internal flags that
cleanup has been initiated - that way I make sure I cleanup the same
object only once). That sort of planing at the design stage makes it
far more friendly with memory, so it doesn't mean that PHP should have
soft references.


Exactly what I did;)


My opinion is that if this can be done without using significant
resources and will not have major issues while implementing - it can
be added, otherwise just skip it - better off fixing bugs and
optimizing :)


Of course. I am not saying that its a must have...just wanted to defend 
it from being marked as useless.



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



Re: [PHP-DEV] Reflection, Traits, Aliasing

2011-08-09 Thread Joey Smith
On Mon, Aug 08, 2011 at 03:52:37PM +0100, Keloran wrote:
 There seems to be a bug in traits that if you use any of the GLOBAL vars it
 segfaults

snip

I'm not sure it's clear from Keloran's code example here, so I thought I'd point
out that the problem only seems to happen if you include the trait definition
from an external file.

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