Re: [PHP-DEV] how to find a memory corruption in php ?

2011-04-01 Thread Pascal COURTOIS
Le 01/04/2011 15:20, Pierre Joye a écrit :
> hi,
> 
> In php 5.3+ the memory limit default is 256MB, not 128MB. 5.3 does not
> necessary use more memory but actually uses and reports its usage more
> efficiently. I would suggest to use this default value and try again.

  the exact same bug occurs whatever the limit set. Anyway, when it works
it's ok with 6MB so it's not a matter of quantity obviously.

> About detecting leaks and memory corruptions, valgrind is a good tool
> to begin with.

  It take a look at it.

  Thanks

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



Re: [PHP-DEV] how to find a memory corruption in php ?

2011-04-01 Thread Pierre Joye
hi,

In php 5.3+ the memory limit default is 256MB, not 128MB. 5.3 does not
necessary use more memory but actually uses and reports its usage more
efficiently. I would suggest to use this default value and try again.

About detecting leaks and memory corruptions, valgrind is a good tool
to begin with.

Cheers,

On Fri, Apr 1, 2011 at 1:27 PM, Pascal COURTOIS  wrote:
> Hi all,
>
> I get an error with my program:
> Fatal error: Allowed memory size of 134217728 bytes exhausted at 
> /home/courtois/php-5.3.6/Zend/zend_execute.h:163 (tried to allocate 261900 
> bytes) in /var/www/dev4.sociatomdev.com/chroot/htdocs/templeet/fetch.php on 
> line 580
>
>
> - The same error occurs with any of php 5.3 versions tested. With 5.2 it's ok.
> - I know the error message is wrong. The program does not consume much memory.
> - If i change some lines in my php code like adding trace messages it 
> sometimes work sometimes no (but constant result for same php code)
>
>
> I will not submit the bug since it's hard to reproduce unless being in the 
> exact same configuration as me.
>
> I used to be an experienced C programmer (>30 lines written) but almost 
> nothing for the last 15 years.
>
> My questions:
> - is there any document somewhere to read before hunting a bug in php ?
> - are there any build/compile options other than --enable-debug ?
> - how should I proceed to debug when php is called via fastcgi ?
>
> My configuration: debian squeeze i386 32bits
>
> Thanks,
>
> Pascal
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

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



[PHP-DEV] how to find a memory corruption in php ?

2011-04-01 Thread Pascal COURTOIS
Hi all,

I get an error with my program:
Fatal error: Allowed memory size of 134217728 bytes exhausted at 
/home/courtois/php-5.3.6/Zend/zend_execute.h:163 (tried to allocate 261900 
bytes) in /var/www/dev4.sociatomdev.com/chroot/htdocs/templeet/fetch.php on 
line 580


- The same error occurs with any of php 5.3 versions tested. With 5.2 it's ok.
- I know the error message is wrong. The program does not consume much memory.
- If i change some lines in my php code like adding trace messages it sometimes 
work sometimes no (but constant result for same php code)


I will not submit the bug since it's hard to reproduce unless being in the 
exact same configuration as me.

I used to be an experienced C programmer (>30 lines written) but almost 
nothing for the last 15 years.

My questions:
- is there any document somewhere to read before hunting a bug in php ?
- are there any build/compile options other than --enable-debug ?
- how should I proceed to debug when php is called via fastcgi ?

My configuration: debian squeeze i386 32bits

Thanks,

Pascal

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



Re: [PHP-DEV] SVN Account Request: rlms

2011-04-01 Thread Daniel Brown
On Fri, Apr 1, 2011 at 05:11, Richard Quadling  wrote:
>
> Considering the hack of Hannes' credentials a while ago, can we trust
> that the above message is REALLY from Hannes?
>
> Hmm.
>
> Just spreading some fud in this world of calm.

He was discussing the same thing in IRC yesterday, so even if it
wasn't him here, there's no worry.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-04-01 Thread Ben Schmidt

> string substr( string $string, int $start [, int $second [, int $flag =
> SUBSTR_LENGTH ]])

I think this just makes code ugly.

I think a new function with something like 'slice' in it is pretty unambiguous and 
unconfusing.


(I also like the current substr() semantics. Actually, I think 'slice' is the new 
kid on the block, and has only really come up in the last 10 years or so as web 
tech and scripting languages have grown. Before that, in C and BASIC and so on, 
semantics like substr() has were more common--at least for positive numbers. But 
that's neither here nor there.)


Ben.



On 1/04/11 6:01 PM, Alban LEROUX wrote:

Hi all,

I just come back on the first reflexion about adding a str_slice() function. As 
it
says before, using one method or the orther can really sucks in some cases, 
depending
what you are coding about.
So actually you mention there is two possibility :

- Keep all in the actual state. substr is allready quite cool but can suck in 
some
case.
- Add a new function and a create a possible confusion about the two method name
(like javascript), etc... bad idea.

In fact I see a third possibility, change the substr() function to handle the 
both
case. Here a simple proto :

string substr( string $string, int $start [, int $second [, int $flag =
SUBSTR_LENGTH ]])

with flags :
- SUBSTR_LENGTH (the default flags value corresponding to the actual behavior)
- SUBSTR_OFFSET (the new possibility to use an offset in third argument)

This keep the compatility with the actual substr() function, and enchance it, so
why not ?


On 2011-03-31 19:58:42 +0200, Martin Scotta said:


--20cf307d046c3ddbde049fcb0b8f

Content-Type: text/plain; charset=ISO-8859-1



I think it's time to stop thinking in terms of "functions" and move forward

to "abstractions"



$s1 = 'string';

$s1->contains($s2);



$s1->indexOf($s2) === strpos($s1, $s2);



Why can't the strings be exposed as pseudo-objects ? users can choose to use

them as a regular strings or by calling methods on it.



Martin Scotta





On Thu, Mar 31, 2011 at 12:52 PM, Rasmus Lerdorf  wrote:



> On 03/31/2011 08:45 AM, Philip Olson wrote:

>

> > - Intuitive name

>

> Argh! Everyone should be forced to learn a bit of C. Like many PHP

> functions, the name and argument order is right out of libc. If you type

> "man strstr" at your (non-Windows) prompt you get a nice little

> description of what it does.

>

> -Rasmus

>



--20cf307d046c3ddbde049fcb0b8f--






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



Re: [PHP-DEV] SVN Account Request: rlms

2011-04-01 Thread Ferenc Kovacs
On Fri, Apr 1, 2011 at 11:11 AM, Richard Quadling wrote:

> 2011/4/1 Hannes Magnusson :
> > 2011/3/31 Pål-Kristian Hamre  >:
> >> We need access to this repository to commit changes to the
> infrastructure: https://svn.php.net/repository/systems/
> >>
> >
> > Verified. He is working on bringing the wikibox back to live, and will
> > be committing configs and stuffz for the box to systems/
> >
> > -Hannes
>
> Considering the hack of Hannes' credentials a while ago, can we trust
> that the above message is REALLY from Hannes?
>
> Hmm.
>
> Just spreading some fud in this world of calm.
>
>
and spoofing email From is easy as pie

Tyrael


Re: [PHP-DEV] SVN Account Request: rlms

2011-04-01 Thread Richard Quadling
2011/4/1 Hannes Magnusson :
> 2011/3/31 Pål-Kristian Hamre :
>> We need access to this repository to commit changes to the infrastructure: 
>> https://svn.php.net/repository/systems/
>>
>
> Verified. He is working on bringing the wikibox back to live, and will
> be committing configs and stuffz for the box to systems/
>
> -Hannes

Considering the hack of Hannes' credentials a while ago, can we trust
that the above message is REALLY from Hannes?

Hmm.

Just spreading some fud in this world of calm.

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-04-01 Thread Richard Quadling
On 31 March 2011 17:50, Philip Olson  wrote:
>
> On Mar 31, 2011, at 9:55 AM, Sebastian Bergmann wrote:
>
>> Am 31.03.2011 17:52, schrieb Rasmus Lerdorf:
>>> Argh! Everyone should be forced to learn a bit of C. Like many PHP
>>> functions, the name and argument order is right out of libc. If you type
>>> "man strstr" at your (non-Windows) prompt you get a nice little
>>> description of what it does.
>>
>> And if you install pman you just do "pman strstr" and get PHP-specific
>> documentation.
>
> Although I disagree that adding a C prerequisite to PHP ends this discussion, 
> using pman is a related topic which can be installed like so:
>
>  pear install doc.php.net/pman
>
> Then, simply 'pman in_array' or similar will open local php man pages in 
> shell. However, the pman files have not been updated for awhile so we'll look 
> into this. Oh, guess we should create a 'pman pman' too.
>
> Regards,
> Philip

Am I right in thinking pman and man is not for windows ... hmmm.
Sounds like half a job to me!

-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

P.S. It's TFI Friday and April 1st. Oh the joy!

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



Re: [PHP-DEV] SVN Account Request: rlms

2011-04-01 Thread Hannes Magnusson
2011/3/31 Pål-Kristian Hamre :
> We need access to this repository to commit changes to the infrastructure: 
> https://svn.php.net/repository/systems/
>

Verified. He is working on bringing the wikibox back to live, and will
be committing configs and stuffz for the box to systems/

-Hannes

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



Re: [PHP-DEV] Adding a more logical string slicing function to PHP

2011-04-01 Thread Alban LEROUX

Hi all,

I just come back on the first reflexion about adding a str_slice() 
function. As it
says before, using one method or the orther can really sucks in some 
cases, depending

what you are coding about.
So actually you mention there is two possibility :

- Keep all in the actual state. substr is allready quite cool but can 
suck in some

 case.
- Add a new function and a create a possible confusion about the two 
method name

 (like javascript), etc... bad idea.

In fact I see a third possibility, change the substr() function to 
handle the both

case. Here a simple proto :

string substr( string $string, int $start [, int $second [, int $flag = 
SUBSTR_LENGTH ]])


with flags :
- SUBSTR_LENGTH (the default flags value corresponding to the actual behavior)
- SUBSTR_OFFSET (the new possibility to use an offset in third argument)

This keep the compatility with the actual substr() function, and 
enchance it, so

why not ?


On 2011-03-31 19:58:42 +0200, Martin Scotta said:


--20cf307d046c3ddbde049fcb0b8f

Content-Type: text/plain; charset=ISO-8859-1



I think it's time to stop thinking in terms of "functions" and move forward

to "abstractions"



$s1 = 'string';

$s1->contains($s2);



$s1->indexOf($s2) === strpos($s1, $s2);



Why can't the strings be exposed as pseudo-objects ? users can choose to use

them as a regular strings or by calling methods on it.



 Martin Scotta





On Thu, Mar 31, 2011 at 12:52 PM, Rasmus Lerdorf  wrote:



> On 03/31/2011 08:45 AM, Philip Olson wrote:

>

> > - Intuitive name

>

> Argh! Everyone should be forced to learn a bit of C. Like many PHP

> functions, the name and argument order is right out of libc. If you type

> "man strstr" at your (non-Windows) prompt you get a nice little

> description of what it does.

>

> -Rasmus

>



--20cf307d046c3ddbde049fcb0b8f--




--
Alban Leroux
s...@paradoxal.org
Web developper


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