The big problem with this bug is that when the error happens the first time (3 threads using get_browser()), the thread which produces the error does not reset the recursion counter (because of the error) and after finishing all threads it is left at 1. When then 2 more threads use get_browser() at the same time the second one gets the error and at the end the counter is left at 2. And then all further calls fail...
In my special case today when the error occured it was:
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 1985 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 1985 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 1985 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 150 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 150 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
168.221.143.68 www.pangaea.de - [03/Dec/2003:17:10:09 +0100] "GET / HTTP/1.1" 200 150 "http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=pangaea" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
6 threads accessed the get_browser() at the same time - 3 of them failed (content-length=150... and visible in error log), counter left at 3 -> from this time on get_browser failed to work.
I think I should apply the patch to 4.3 and 5 (same problem there) and close the bug.
Uwe
At 19:20 03.12.2003, Jay Smith wrote:
Uwe Schindler wrote:
> One solution (attached is the patch, if nobody has someone against it I > will apply it): > I switch off the recursion protection for the browscap hash in > zend_hash_init_ex because this hash has no recursive things in it and is > not modified after it is created. > > Uwe >
That will probably do it. I'm going to try and reproduce this with and without the patch today on our Solaris box and I'll see what I get. I've been swamped recently and haven't been able to give this a good look. (The browscap extension really needs to be gutted, but at least it works, for the most part...)
Going to go give this a try now...
J
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
----- Uwe Schindler [EMAIL PROTECTED] - http://www.php.net NSAPI SAPI developer Erlangen, Germany