Hi.

I'm again sending this small patch that fixes bug #17414.

As I said earlier the actual bug is within glibc LinuxThreads
implementation. NPTL implementation does not have this bug.
The problem is that pthread_key_delete does not properly clear the TLS
variable if the thread manager isn't started (it is started when ever
first thread is started). Since Apache2 prefork-mpm does not start threads
this bug shows up always. The work around is to manually clear the TLS
entry. Otherwise the TSRM will get old TLS values after Apache2 restart
leading to segfault.

Since most of the current Linux systems are using glibc with this bug it
would be really, really, really great if this patch would commited to PHP.
Since it is unlikely that all the people will update their glibc (which by
the way isn't patched yet).

So PLEASE, please, please apply this patch. Or atleast explain me why not.
This is so simple patch that it shouldn't be hard to see that it doesn't
break anything.

Cheers,
  Timo

--
Timo Teräs
[EMAIL PROTECTED]
diff -ru php-4.3.3RC1/TSRM/TSRM.c php-4.3.3RC1-tt/TSRM/TSRM.c
--- php-4.3.3RC1/TSRM/TSRM.c    2003-07-21 13:48:15.000000000 +0300
+++ php-4.3.3RC1-tt/TSRM/TSRM.c 2003-07-21 13:41:56.000000000 +0300
@@ -181,6 +181,7 @@
 #if defined(GNUPTH)
        pth_kill();
 #elif defined(PTHREADS)
+       pthread_setspecific(tls_key, 0);
        pthread_key_delete(tls_key);
 #elif defined(TSRM_WIN32)
        TlsFree(tls_key);


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

Reply via email to