PCRE error handling patch

php.internals

Andrei Zmievski

20 years ago
I made a patch (against HEAD currently only) that makes it possible to set runtime limits on backtracking and recursion. It also implements preg_last_error() that lets users check whether there was an execution error (such as limit exceeded or bad UTF-8 or whatever). Ilia, do you think it might make it into 5.1.3? http://www.php.net/~andrei/pcre.diff -Andrei

Jani Taskinen

20 years ago
Sounds to me like a bug fix..all those recursion bugs in the db.. :) --Jani On Tue, 11 Apr 2006, Andrei Zmievski wrote:

Nuno Lopes

20 years ago
I would say that 100.000 recursions is too much. When I made my patch it was segfaulting with such value. 50.000 is a much safer choice (at least on my gentoo box, 8 MB of stack). Nuno ----- Original Message -----

Andrei Zmievski

20 years ago
It's hard to pick a default that will work for everyone. I can probably see setting recursion limit somewhat lower than backtracking one, though. Maybe 100,000/50,000 or something like that. -Andrei On Apr 11, 2006, at 11:51 AM, Nuno Lopes wrote:

Ilia A.

20 years ago
No, lets wait with it till the next PHP 5 release. Ilia On 11-Apr-06, at 12:25 PM, Andrei Zmievski wrote:

Andrei Zmievski

20 years ago
5.1.4? -Andrei On Apr 12, 2006, at 6:05 AM, Ilia Alshanetsky wrote:

Lukas Smith

20 years ago
Andrei Zmievski wrote:
> 5.1.4?
I have the following items as future todos: 1. new functions: ext/date: date_sun_info (derick) 2. Switch for disabling/enabling materialized cursors in mysqli (georg) 3. fix __toString() (marcus) 4. add support for files >2GB (wez) 5. Add input filter extension via a symlink from pecl into core as experimental (derick) 6. Add json extension via a symlink from pecl into core as experimental 7. add PDO::defaultFetchMode attribute (pierre) 8. PCRE: make it possible to set runtime limits on backtracking and recursion and add preg_last_error() Especially for Nr. 3 I guess we would have to move to 5.2. That is why I would favor 5.2 over 5.1.4 and reserve 5.1.4 to a quick security fix release if one becomes necessary. regards, Lukas

Jani Taskinen

20 years ago
On Wed, 12 Apr 2006, Lukas Smith wrote:
> Andrei Zmievski wrote: >> 5.1.4? > > I have the following items as future todos: > > 1. new functions: ext/date: date_sun_info (derick) > 2. Switch for disabling/enabling materialized cursors in mysqli (georg) > 3. fix __toString() (marcus)
Wasn't that fixed already? Or was that just in HEAD?
> 4. add support for files >2GB (wez) > 5. Add input filter extension via a symlink from pecl into core as > experimental (derick) > 6. Add json extension via a symlink from pecl into core as experimental > 7. add PDO::defaultFetchMode attribute (pierre) > 8. PCRE: make it possible to set runtime limits on backtracking and > recursion and add preg_last_error() > > Especially for Nr. 3 I guess we would have to move to 5.2. > That is why I would favor 5.2 over 5.1.4 and reserve 5.1.4 to a quick security > fix release if one becomes necessary.
I could not agree more. +1 for 5.2. We can't wait for 6.0 forever to get some new features in. It's still at least year from now til it's release I bet. --Jani

Andrei Zmievski

20 years ago
The problem is that with 5.2 you'll get all kinds of old threads resurrected, because people think that it's time to add some new features.. Like namespaces. -Andrei On Apr 12, 2006, at 9:48 AM, Jani Taskinen wrote:

Jani Taskinen

20 years ago
I have this thing called "delete" in my MUA which I can use to get rid of unwanted noise. :) --Jani On Wed, 12 Apr 2006, Andrei Zmievski wrote:
> The problem is that with 5.2 you'll get all kinds of old threads resurrected, > because people think that it's time to add some new features.. Like > namespaces. > > -Andrei > > On Apr 12, 2006, at 9:48 AM, Jani Taskinen wrote: > >> I could not agree more. +1 for 5.2. We can't wait for 6.0 forever to get >> some new features in. It's still at least year from now til it's release >> I bet. > >
-- Give me your money at @ <http://pecl.php.net/wishlist.php/sniper> Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P!

Marcus Börger

20 years ago
Hello Andrei, no namespaces in 5.2 (.) that is for head. Wednesday, April 12, 2006, 8:01:41 PM, you wrote:
> The problem is that with 5.2 you'll get all kinds of old threads > resurrected, because people think that it's time to add some new > features.. Like namespaces.
> -Andrei
> On Apr 12, 2006, at 9:48 AM, Jani Taskinen wrote:
>> I could not agree more. +1 for 5.2. We can't wait for 6.0 forever >> to get >> some new features in. It's still at least year from now til it's >> release >> I bet.
Best regards, Marcus

Marcus Börger

20 years ago
Hello Lukas, Wednesday, April 12, 2006, 6:17:13 PM, you wrote:
> Andrei Zmievski wrote: >> 5.1.4?
> I have the following items as future todos:
> 1. new functions: ext/date: date_sun_info (derick) > 2. Switch for disabling/enabling materialized cursors in mysqli (georg) > 3. fix __toString() (marcus)
fixed in head, will be in 5.2
> 4. add support for files >2GB (wez) > 5. Add input filter extension via a symlink from pecl into core as > experimental (derick) > 6. Add json extension via a symlink from pecl into core as experimental > 7. add PDO::defaultFetchMode attribute (pierre)
s/pierre/marcus/; fixed in head will be in 5.2
> 8. PCRE: make it possible to set runtime limits on backtracking and > recursion and add preg_last_error()
Most of the other stuff is either bigger feature additions or requires api changes so i'd say all of them in 5.2. regards marcus