Re: bug report...
| From: | Rasmus Lerdorf | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: bug report... | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-8685@lists.php.net to get a copy of this message | ||
> There's this new _IO_new_fclose() again.
> What platform is this?
My guess is that it is a Linux box with a broken glibc-2.1.1 library (ie.
RH6). Stig and I chased this one down a while ago. Well, I did the
chasing, Stig did the fixing.. ;)
As far as I recall, it is a weird one. It only happens when PHP is loaded
as a DSO. What happens is that when you pass a pointer to a libc function
(as we do when we register fclose() as the destructor for open files) and
then try to call this function from that pointer, something in libc
trashes the stack. Our workaround was to change this:
GLOBAL(le_fp) = register_list_destructors(fclose,NULL);
to this:
static void php3i_destructor_fclose(FILE *fp) {
(void)fclose(fp);
}
GLOBAL(le_fp) = register_list_destructors(php3i_destructor_fclose,NULL);
Looks weird, I know, but it actually fixed it.
I don't see it in the ChangeLog, but we did this in early June so it went
into either 3.0.9 or 3.0.10. My guess is that this guy is using an
earlier version.
-Rasmus