Re: svn commit: r1638879 - /httpd/httpd/trunk/server/mpm/event/event.c

2014-11-16 Thread Yann Ylavic
Hi,

Maybe it would make sense to clear the recycled pool in
ap_push_pool(), that would simplify caller's life (currently we always
do it before the call).

How about the attached patch?

Regards,
Yann.

On Sun, Nov 16, 2014 at 6:55 AM, Marion  Christophe JAILLET
christophe.jail...@wanadoo.fr wrote:
 Done in r1639960.

 CJ

 Le 15/11/2014 08:32, Marion  Christophe JAILLET a écrit :

 Hi,

 the same pattern exists in eventopt.

 CJ


 Le 12/11/2014 18:32, cove...@apache.org a écrit :

 Author: covener
 Date: Wed Nov 12 17:32:24 2014
 New Revision: 1638879

 URL: http://svn.apache.org/r1638879
 Log:
 avoid dereferencing a recently apr_pool_clear()'ed event_conn_state_t *cs
 in several paths where ptrans is being recycled at the end of a request.


 Modified:
  httpd/httpd/trunk/server/mpm/event/event.c

 Modified: httpd/httpd/trunk/server/mpm/event/event.c
 URL:
 http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1638879r1=1638878r2=1638879view=diff

 ==
 --- httpd/httpd/trunk/server/mpm/event/event.c (original)
 +++ httpd/httpd/trunk/server/mpm/event/event.c Wed Nov 12 17:32:24 2014
 @@ -852,6 +852,7 @@ static int start_lingering_close_common(
   rv = apr_pollset_add(event_pollset, cs-pfd);
   apr_thread_mutex_unlock(timeout_mutex);
   if (rv != APR_SUCCESS  !APR_STATUS_IS_EEXIST(rv)) {
 +apr_pool_t *p = cs-p;
   ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
start_lingering_close: apr_pollset_add failure);
   apr_thread_mutex_lock(timeout_mutex);
 @@ -859,7 +860,7 @@ static int start_lingering_close_common(
   apr_thread_mutex_unlock(timeout_mutex);
   apr_socket_close(cs-pfd.desc.s);
   apr_pool_clear(cs-p);
 -ap_push_pool(worker_queue_info, cs-p);
 +ap_push_pool(worker_queue_info, p);
   return 0;
   }
   return 1;

 [...]




httpd-trunk-ap_push_pool-clear.patch
Description: application/download


Re: svn commit: r1638879 - /httpd/httpd/trunk/server/mpm/event/event.c

2014-11-16 Thread Eric Covener
On Sun, Nov 16, 2014 at 7:27 AM, Yann Ylavic ylavic@gmail.com wrote:
 Hi,

 Maybe it would make sense to clear the recycled pool in
 ap_push_pool(), that would simplify caller's life (currently we always
 do it before the call).

+1


Re: svn commit: r1638879 - /httpd/httpd/trunk/server/mpm/event/event.c

2014-11-16 Thread Yann Ylavic
On Sun, Nov 16, 2014 at 3:54 PM, Eric Covener cove...@gmail.com wrote:
 On Sun, Nov 16, 2014 at 7:27 AM, Yann Ylavic ylavic@gmail.com wrote:
 Maybe it would make sense to clear the recycled pool in
 ap_push_pool(), that would simplify caller's life (currently we always
 do it before the call).

 +1

Done in r1640031 (as follow up).


Re: svn commit: r1638879 - /httpd/httpd/trunk/server/mpm/event/event.c

2014-11-15 Thread Marion Christophe JAILLET

Done in r1639960.

CJ

Le 15/11/2014 08:32, Marion  Christophe JAILLET a écrit :

Hi,

the same pattern exists in eventopt.

CJ


Le 12/11/2014 18:32, cove...@apache.org a écrit :

Author: covener
Date: Wed Nov 12 17:32:24 2014
New Revision: 1638879

URL: http://svn.apache.org/r1638879
Log:
avoid dereferencing a recently apr_pool_clear()'ed event_conn_state_t 
*cs

in several paths where ptrans is being recycled at the end of a request.


Modified:
 httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: 
http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1638879r1=1638878r2=1638879view=diff
== 


--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Wed Nov 12 17:32:24 2014
@@ -852,6 +852,7 @@ static int start_lingering_close_common(
  rv = apr_pollset_add(event_pollset, cs-pfd);
  apr_thread_mutex_unlock(timeout_mutex);
  if (rv != APR_SUCCESS  !APR_STATUS_IS_EEXIST(rv)) {
+apr_pool_t *p = cs-p;
  ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
   start_lingering_close: apr_pollset_add 
failure);

  apr_thread_mutex_lock(timeout_mutex);
@@ -859,7 +860,7 @@ static int start_lingering_close_common(
  apr_thread_mutex_unlock(timeout_mutex);
  apr_socket_close(cs-pfd.desc.s);
  apr_pool_clear(cs-p);
-ap_push_pool(worker_queue_info, cs-p);
+ap_push_pool(worker_queue_info, p);
  return 0;
  }
  return 1;

[...]





Re: svn commit: r1638879 - /httpd/httpd/trunk/server/mpm/event/event.c

2014-11-14 Thread Marion Christophe JAILLET

Hi,

the same pattern exists in eventopt.

CJ


Le 12/11/2014 18:32, cove...@apache.org a écrit :

Author: covener
Date: Wed Nov 12 17:32:24 2014
New Revision: 1638879

URL: http://svn.apache.org/r1638879
Log:
avoid dereferencing a recently apr_pool_clear()'ed event_conn_state_t *cs
in several paths where ptrans is being recycled at the end of a request.


Modified:
 httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: 
http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1638879r1=1638878r2=1638879view=diff
==
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Wed Nov 12 17:32:24 2014
@@ -852,6 +852,7 @@ static int start_lingering_close_common(
  rv = apr_pollset_add(event_pollset, cs-pfd);
  apr_thread_mutex_unlock(timeout_mutex);
  if (rv != APR_SUCCESS  !APR_STATUS_IS_EEXIST(rv)) {
+apr_pool_t *p = cs-p;
  ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,
   start_lingering_close: apr_pollset_add failure);
  apr_thread_mutex_lock(timeout_mutex);
@@ -859,7 +860,7 @@ static int start_lingering_close_common(
  apr_thread_mutex_unlock(timeout_mutex);
  apr_socket_close(cs-pfd.desc.s);
  apr_pool_clear(cs-p);
-ap_push_pool(worker_queue_info, cs-p);
+ap_push_pool(worker_queue_info, p);
  return 0;
  }
  return 1;

[...]