Hi,
I have been doing some code-reading. Why is the RSHUTDOWN function for
syslog ext called only when run under win32?
Shouldn't the cleanup happen on linux as well?
Another question is for the use of zend_strndup instead of one of the
non-persistent memory allocation functions (i.e. estrndup() ) ?
There is no use for this variable after the request dies (as far as I
understand).
However, so far, I can't seem to understand who/what corrupts my memory.
What do you think about extending the RINIT function instead of:
PHP_RINIT_FUNCTION(syslog)
{
if (INI_INT("define_syslog_variables")) {
start_syslog(TSRMLS_C);
} else {
BG(syslog_started)=0;
}
return SUCCESS;
}
To be:
PHP_RINIT_FUNCTION(syslog)
{
if (INI_INT("define_syslog_variables")) {
start_syslog(TSRMLS_C);
} else {
BG(syslog_started)=0;
BG(syslog_device)=NULL; /* This is the addition */
}
return SUCCESS;
}
Thanks in advance, Nir.
-----Original Message-----
From: Rachmel, Nir (Nir) [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 02, 2007 11:31 AM
To: Antony Dovgal
Cc: [email protected]
Subject: RE: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard
extension
Hi,
I tried your advice, and put a breakpoint at the shutdown function.
However it never reaches it! (not normally, and not before the SEGV is
sent).
In case I didn't write it in the previous threads, I am running the PHP
scripts from my web-server (appWeb, which is apache like for embedded
systems). PHP is compiled as a static module into it, so maybe the
shutdown procedure is never called since the PHP is "never shut down"?
I would appreciate any advice / ideas you might have,
Thanks in advance, Nir.
-----Original Message-----
From: Antony Dovgal [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 27, 2007 8:40 AM
To: Rachmel, Nir (Nir)
Cc: [email protected]
Subject: Re: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard
extension
On 25.11.2007 19:55, Rachmel, Nir (Nir) wrote:
> If it helps, I am attaching the relevant tsrm_ls (according to the
> globals_id in the relevant frame):
> syslog_started = 1,
> syslog_device = 0x5a5a5a5a <Address 0x5a5a5a5a out of bounds>,
So it's somehow got freed.
Try setting breakpoint to zm_shutdown_syslog() function to see if it was
called before.
It should be called on shutdown only, but that's the only case when
BG(syslog_device) is freed and not NULLed.
--
Wbr,
Antony Dovgal
--
PHP Internals - PHP Runtime Development Mailing List To unsubscribe,
visit: http://www.php.net/unsub.php
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php