Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
The patch should be fine. Etienne Kneuss wrote: > Hello, > > if I get no objections by the end of the week I'll simply commit that > patch + test, so 5.3 can move forward. > > Regards, > > On Sun, May 24, 2009 at 1:53 PM, Etienne Kneuss wrote: >> Hello, >> >> this patch introduced a bug in 5_3/HEAD, the timeout is no longer >> checked in the shutdown function: >> >> set_time_limit(1); >> register_shutdown_function("plop"); >> function plop() { >>while(1); >> } >> plop(); >> >> doesn't terminate >> >> >> http://patches.colder.ch/php-src/shutdown_timeout-5_3.patch?markup >> >> fixes it but I'm not sure it's the right way to do it. Can you please >> take a look? >> >> Thanks. >> >> On Tue, Mar 18, 2008 at 11:42 PM, Rasmus Lerdorf wrote: >>> rasmus Tue Mar 18 21:42:51 2008 UTC >>> >>> Modified files: (Branch: PHP_5_3) >>>/ZendEngine2zend_execute.h zend_execute_API.c >>>/php-src/main SAPI.c SAPI.h main.c php_globals.h >>>/php-src/sapi/apachemod_php5.c >>> Log: >>> exit_on_timeout patch >>> >>> After the sigsetjmp change, this is patch #2 in an effort to get some >>> sanity restored to signal handling in PHP. >>> >>> This patch does two things. First, it makes it possible to reset the >>> timeout without resetting the signal handlers. This is important for >>> cases where an extension may have deferred signals in its MINIT in order >>> to implement critical sections. It also lays the groundwork for cleaning >>> up our signal handling and perhaps eventually implementing our own >>> signal deferring mechanism so we can have true critical sections. >>> >>> The second thing this does is to make it possible to terminate the current >>> child process (only for Apache1 at the moment) on a timeout. There are >>> a number of extensions that are unhappy about being longjmp'ed out of >>> and when this happens on a timeout they are left in an inconsistent state. >>> By turning on exit_on_timeout you can now force the process to terminate >>> on a timeout which will clean up any hanging locks and/or memory left >>> hanging after the longjmp. >>> >>> >>> -- >>> PHP CVS Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >> >> >> -- >> Etienne Kneuss >> http://www.colder.ch >> >> Men never do evil so completely and cheerfully as >> when they do it from a religious conviction. >> -- Pascal >> > > > -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
Hello, if I get no objections by the end of the week I'll simply commit that patch + test, so 5.3 can move forward. Regards, On Sun, May 24, 2009 at 1:53 PM, Etienne Kneuss wrote: > Hello, > > this patch introduced a bug in 5_3/HEAD, the timeout is no longer > checked in the shutdown function: > > set_time_limit(1); > register_shutdown_function("plop"); > function plop() { >while(1); > } > plop(); > > doesn't terminate > > > http://patches.colder.ch/php-src/shutdown_timeout-5_3.patch?markup > > fixes it but I'm not sure it's the right way to do it. Can you please > take a look? > > Thanks. > > On Tue, Mar 18, 2008 at 11:42 PM, Rasmus Lerdorf wrote: >> rasmus Tue Mar 18 21:42:51 2008 UTC >> >> Modified files: (Branch: PHP_5_3) >>/ZendEngine2zend_execute.h zend_execute_API.c >>/php-src/main SAPI.c SAPI.h main.c php_globals.h >>/php-src/sapi/apachemod_php5.c >> Log: >> exit_on_timeout patch >> >> After the sigsetjmp change, this is patch #2 in an effort to get some >> sanity restored to signal handling in PHP. >> >> This patch does two things. First, it makes it possible to reset the >> timeout without resetting the signal handlers. This is important for >> cases where an extension may have deferred signals in its MINIT in order >> to implement critical sections. It also lays the groundwork for cleaning >> up our signal handling and perhaps eventually implementing our own >> signal deferring mechanism so we can have true critical sections. >> >> The second thing this does is to make it possible to terminate the current >> child process (only for Apache1 at the moment) on a timeout. There are >> a number of extensions that are unhappy about being longjmp'ed out of >> and when this happens on a timeout they are left in an inconsistent state. >> By turning on exit_on_timeout you can now force the process to terminate >> on a timeout which will clean up any hanging locks and/or memory left >> hanging after the longjmp. >> >> >> -- >> PHP CVS Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > > -- > Etienne Kneuss > http://www.colder.ch > > Men never do evil so completely and cheerfully as > when they do it from a religious conviction. > -- Pascal > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
Hello, this patch introduced a bug in 5_3/HEAD, the timeout is no longer checked in the shutdown function: set_time_limit(1); register_shutdown_function("plop"); function plop() { while(1); } plop(); doesn't terminate http://patches.colder.ch/php-src/shutdown_timeout-5_3.patch?markup fixes it but I'm not sure it's the right way to do it. Can you please take a look? Thanks. On Tue, Mar 18, 2008 at 11:42 PM, Rasmus Lerdorf wrote: > rasmus Tue Mar 18 21:42:51 2008 UTC > > Modified files: (Branch: PHP_5_3) > /ZendEngine2 zend_execute.h zend_execute_API.c > /php-src/main SAPI.c SAPI.h main.c php_globals.h > /php-src/sapi/apache mod_php5.c > Log: > exit_on_timeout patch > > After the sigsetjmp change, this is patch #2 in an effort to get some > sanity restored to signal handling in PHP. > > This patch does two things. First, it makes it possible to reset the > timeout without resetting the signal handlers. This is important for > cases where an extension may have deferred signals in its MINIT in order > to implement critical sections. It also lays the groundwork for cleaning > up our signal handling and perhaps eventually implementing our own > signal deferring mechanism so we can have true critical sections. > > The second thing this does is to make it possible to terminate the current > child process (only for Apache1 at the moment) on a timeout. There are > a number of extensions that are unhappy about being longjmp'ed out of > and when this happens on a timeout they are left in an inconsistent state. > By turning on exit_on_timeout you can now force the process to terminate > on a timeout which will clean up any hanging locks and/or memory left > hanging after the longjmp. > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
Aye aye, Sir. :) --Jani Rasmus Lerdorf kirjoitti: Hold your horses. The HEAD commit will come once I work out the final version of this stuff. Jani Taskinen wrote: Is it intentional that you don't commit to HEAD at all? Last 3 commits you made were only committed to PHP_5_3 branch.. --Jani Rasmus Lerdorf kirjoitti: rasmusTue Mar 18 21:42:51 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2zend_execute.h zend_execute_API.c /php-src/mainSAPI.c SAPI.h main.c php_globals.h /php-src/sapi/apachemod_php5.c Log: exit_on_timeout patch After the sigsetjmp change, this is patch #2 in an effort to get some sanity restored to signal handling in PHP. This patch does two things. First, it makes it possible to reset the timeout without resetting the signal handlers. This is important for cases where an extension may have deferred signals in its MINIT in order to implement critical sections. It also lays the groundwork for cleaning up our signal handling and perhaps eventually implementing our own signal deferring mechanism so we can have true critical sections. The second thing this does is to make it possible to terminate the current child process (only for Apache1 at the moment) on a timeout. There are a number of extensions that are unhappy about being longjmp'ed out of and when this happens on a timeout they are left in an inconsistent state. By turning on exit_on_timeout you can now force the process to terminate on a timeout which will clean up any hanging locks and/or memory left hanging after the longjmp. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
Hold your horses. The HEAD commit will come once I work out the final version of this stuff. Jani Taskinen wrote: Is it intentional that you don't commit to HEAD at all? Last 3 commits you made were only committed to PHP_5_3 branch.. --Jani Rasmus Lerdorf kirjoitti: rasmusTue Mar 18 21:42:51 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2zend_execute.h zend_execute_API.c /php-src/mainSAPI.c SAPI.h main.c php_globals.h /php-src/sapi/apachemod_php5.c Log: exit_on_timeout patch After the sigsetjmp change, this is patch #2 in an effort to get some sanity restored to signal handling in PHP. This patch does two things. First, it makes it possible to reset the timeout without resetting the signal handlers. This is important for cases where an extension may have deferred signals in its MINIT in order to implement critical sections. It also lays the groundwork for cleaning up our signal handling and perhaps eventually implementing our own signal deferring mechanism so we can have true critical sections. The second thing this does is to make it possible to terminate the current child process (only for Apache1 at the moment) on a timeout. There are a number of extensions that are unhappy about being longjmp'ed out of and when this happens on a timeout they are left in an inconsistent state. By turning on exit_on_timeout you can now force the process to terminate on a timeout which will clean up any hanging locks and/or memory left hanging after the longjmp. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
Is it intentional that you don't commit to HEAD at all? Last 3 commits you made were only committed to PHP_5_3 branch.. --Jani Rasmus Lerdorf kirjoitti: rasmus Tue Mar 18 21:42:51 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2 zend_execute.h zend_execute_API.c /php-src/main SAPI.c SAPI.h main.c php_globals.h /php-src/sapi/apache mod_php5.c Log: exit_on_timeout patch After the sigsetjmp change, this is patch #2 in an effort to get some sanity restored to signal handling in PHP. This patch does two things. First, it makes it possible to reset the timeout without resetting the signal handlers. This is important for cases where an extension may have deferred signals in its MINIT in order to implement critical sections. It also lays the groundwork for cleaning up our signal handling and perhaps eventually implementing our own signal deferring mechanism so we can have true critical sections. The second thing this does is to make it possible to terminate the current child process (only for Apache1 at the moment) on a timeout. There are a number of extensions that are unhappy about being longjmp'ed out of and when this happens on a timeout they are left in an inconsistent state. By turning on exit_on_timeout you can now force the process to terminate on a timeout which will clean up any hanging locks and/or memory left hanging after the longjmp. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /main SAPI.c SAPI.h main.c php_globals.h /sapi/apache mod_php5.c ZendEngine2 zend_execute.h zend_execute_API.c
rasmus Tue Mar 18 21:42:51 2008 UTC Modified files: (Branch: PHP_5_3) /ZendEngine2zend_execute.h zend_execute_API.c /php-src/main SAPI.c SAPI.h main.c php_globals.h /php-src/sapi/apachemod_php5.c Log: exit_on_timeout patch After the sigsetjmp change, this is patch #2 in an effort to get some sanity restored to signal handling in PHP. This patch does two things. First, it makes it possible to reset the timeout without resetting the signal handlers. This is important for cases where an extension may have deferred signals in its MINIT in order to implement critical sections. It also lays the groundwork for cleaning up our signal handling and perhaps eventually implementing our own signal deferring mechanism so we can have true critical sections. The second thing this does is to make it possible to terminate the current child process (only for Apache1 at the moment) on a timeout. There are a number of extensions that are unhappy about being longjmp'ed out of and when this happens on a timeout they are left in an inconsistent state. By turning on exit_on_timeout you can now force the process to terminate on a timeout which will clean up any hanging locks and/or memory left hanging after the longjmp. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.h?r1=1.84.2.4.2.8.2.7&r2=1.84.2.4.2.8.2.8&diff_format=u Index: ZendEngine2/zend_execute.h diff -u ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.7 ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.8 --- ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.7 Tue Mar 18 14:10:43 2008 +++ ZendEngine2/zend_execute.h Tue Mar 18 21:42:49 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.h,v 1.84.2.4.2.8.2.7 2008/03/18 14:10:43 felipe Exp $ */ +/* $Id: zend_execute.h,v 1.84.2.4.2.8.2.8 2008/03/18 21:42:49 rasmus Exp $ */ #ifndef ZEND_EXECUTE_H #define ZEND_EXECUTE_H @@ -300,7 +300,7 @@ ZEND_API uint zend_get_executed_lineno(TSRMLS_D); ZEND_API zend_bool zend_is_executing(TSRMLS_D); -ZEND_API void zend_set_timeout(long seconds); +ZEND_API void zend_set_timeout(long seconds, int reset_signals); ZEND_API void zend_unset_timeout(TSRMLS_D); ZEND_API void zend_timeout(int dummy); ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.30&r2=1.331.2.20.2.24.2.31&diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.30 ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.31 --- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.30 Tue Mar 18 14:10:43 2008 +++ ZendEngine2/zend_execute_API.c Tue Mar 18 21:42:50 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.30 2008/03/18 14:10:43 felipe Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.31 2008/03/18 21:42:50 rasmus Exp $ */ #include #include @@ -1527,7 +1527,7 @@ #define SIGPROF 27 #endif -void zend_set_timeout(long seconds) /* {{{ */ +void zend_set_timeout(long seconds, int reset_signals) /* {{{ */ { TSRMLS_FETCH(); @@ -1554,16 +1554,22 @@ # ifdef __CYGWIN__ setitimer(ITIMER_REAL, &t_r, NULL); - signal(SIGALRM, zend_timeout); - sigemptyset(&sigset); - sigaddset(&sigset, SIGALRM); + if(reset_signals) { + signal(SIGALRM, zend_timeout); + sigemptyset(&sigset); + sigaddset(&sigset, SIGALRM); + } # else setitimer(ITIMER_PROF, &t_r, NULL); - signal(SIGPROF, zend_timeout); - sigemptyset(&sigset); - sigaddset(&sigset, SIGPROF); + if(reset_signals) { + signal(SIGPROF, zend_timeout); + sigemptyset(&sigset); + sigaddset(&sigset, SIGPROF); + } # endif - sigprocmask(SIG_UNBLOCK, &sigset, NULL); + if(reset_signals) { + sigprocmask(SIG_UNBLOCK, &sigset, NULL); + } } # endif #endif http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.202.2.7.2.15.2.3&r2=1.202.2.7.2.15.2.4&diff_format=u Index: php-src/main/SAPI.c diff -u php-src/main/SAPI.c:1.202.2.7.2.15.2.3 php-src/main/SAPI.c:1.202.2.7.2.15.2.4 --- php-src/main/SAPI.c:1.202.2.7.2.15.2.3 Mon Jan 28 16:09:08 2008 +++ php-src/main/SAPI.c Tue Mar 18 21:42:50 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: SAPI.c,v 1.202.2.7.2.15.2.3 2008/01/28 16:09:08 scottmac Exp $ */ +/* $Id: SAPI.c,v 1.202.2.7.2.15.2.4 2008/03/18 21: