You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2010/01/25 15:10:22 UTC

DO NOT REPLY [Bug 48606] New: mod_proxy segmentation fault under high load

https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

           Summary: mod_proxy segmentation fault under high load
           Product: Apache httpd-2
           Version: 2.2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: mod_proxy
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: asm@uezku.kemsu.ru


In rare situations we face such core dump.

[Switching to thread 11 (process 12096)]#0  0x00380410 in __kernel_vsyscall ()
#0  0x00380410 in __kernel_vsyscall ()
#1  0x00163226 in kill () from /lib/libc.so.6
#2  0x005fcdee in sig_coredump (sig=11) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/mpm_common.c:1239
#3  <signal handler called>
#4  apr_allocator_free (allocator=0x0, node=0x9ae2a90) at
memory/unix/apr_pools.c:345
#5  0x007fcd83 in apr_bucket_free (mem=0x9ae2ab8) at
buckets/apr_buckets_alloc.c:191
#6  0x007fd4cf in heap_bucket_destroy (data=0x9b0b8f0) at
buckets/apr_buckets_heap.c:36
#7  0x007fe1d2 in apr_brigade_cleanup (data=0x9aed300) at
buckets/apr_brigade.c:44
#8  0x007fe92a in apr_brigade_destroy (b=0x9aed300) at buckets/apr_brigade.c:53
#9  0x005f2405 in ap_core_output_filter (f=0x9ba22d0, b=0x9aed300) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/core_filters.c:882
#10 0x005feb30 in ap_pass_brigade (next=0x9b0b820, bb=0x9ba7090) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/util_filter.c:526
#11 0x00602ebb in ap_process_request (r=0x9af7308) at
/usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_request.c:231
#12 0x005ffcff in ap_process_http_connection (c=0x9ba1e98) at
/usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_core.c:190
#13 0x005fb65d in ap_run_process_connection (c=0x9ba1e98) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:43
#14 0x005fb75c in ap_process_connection (c=0x9ba1e98, csd=0x9ba1ce8) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:178
#15 0x006088cf in worker_thread (thd=0x9ac1ed0, dummy=0x9ac68f8) at
/usr/src/debug/httpd-2.2.9.2/phorm/server/mpm/worker/worker.c:553
#16 0x00130606 in dummy_worker (opaque=0x9ac1ed0) at
threadproc/unix/thread.c:142
#17 0x00ecf5ab in start_thread () from /lib/libpthread.so.0
#18 0x0020bcfe in clone () from /lib/libc.so.6

I suppose, the problem is in "proxy_conn_scpool" pool which gets destroyed
prematurely like this:

#0  ap_proxy_release_connection (proxy_function=0x253507 "HTTP",
conn=0xa596200, s=0x9b25a18)
    at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/proxy_util.c:1721
#1  0x00250905 in ap_proxy_http_cleanup (scheme=0x0, r=<value optimized out>,
backend=0x1)
    at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1851
#2  0x00250bc4 in proxy_http_handler (r=0x9e21e58, worker=0x9b2cb88,
conf=0x9aa53a8, url=0xa2ea530 "/", proxyname=0x0, proxyport=0)
    at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1980
#3  0x00258be6 in proxy_http_handler_wrapper (r=0x9e21e58, worker=0x9b2cb88,
proxy_conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/",
    proxyname=0x0, proxyport=0) at mod_proxysense.cpp:586
#4  0x05765880 in proxy_run_scheme_handler (r=0x9e21e58, worker=0x9b2cb88,
conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/", proxyhost=0x0,
    proxyport=0) at
/usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:2511
#5  0x05769f83 in proxy_handler (r=0x9e21e58) at
/usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:1016

It is destroyed with apr_pool_clear(p) (p is "proxy_conn_pool"). In the
meantime, the brigade was set aside (in ap_core_output_filter()) with backend
response. And response body bucket is on "proxy_conn_scpool". When filters are
flushed in check_pipeline_flush(r) we accessing freed memory from this bucket.

The bug may be also applicable to trunk version.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

Aleksey Midenkov <as...@uezku.kemsu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #7 from Aleksey Midenkov <as...@uezku.kemsu.ru> 2010-01-29 02:00:57 UTC ---
Then closing

*** This bug has been marked as a duplicate of bug 45792 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #2 from Ruediger Pluem <rp...@apache.org> 2010-01-25 08:52:47 CET ---
(In reply to comment #1)
> Also, take into account, that operation
> 
>             *conn = worker->cp->conn;
>             worker->cp->conn = NULL;
> 
> is not atomic and not thread safe. We potentially can get same conn for two
> threads. This also happens in trunk version.

It doesn't need to because this code is only executed in non threaded
environments.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #3 from Ruediger Pluem <rp...@apache.org> 2010-01-25 08:59:19 CET ---
(In reply to comment #0)
> In rare situations we face such core dump.
> 
> [Switching to thread 11 (process 12096)]#0  0x00380410 in __kernel_vsyscall ()
> #0  0x00380410 in __kernel_vsyscall ()
> #1  0x00163226 in kill () from /lib/libc.so.6
> #2  0x005fcdee in sig_coredump (sig=11) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/mpm_common.c:1239
> #3  <signal handler called>
> #4  apr_allocator_free (allocator=0x0, node=0x9ae2a90) at
> memory/unix/apr_pools.c:345
> #5  0x007fcd83 in apr_bucket_free (mem=0x9ae2ab8) at
> buckets/apr_buckets_alloc.c:191
> #6  0x007fd4cf in heap_bucket_destroy (data=0x9b0b8f0) at
> buckets/apr_buckets_heap.c:36
> #7  0x007fe1d2 in apr_brigade_cleanup (data=0x9aed300) at
> buckets/apr_brigade.c:44
> #8  0x007fe92a in apr_brigade_destroy (b=0x9aed300) at buckets/apr_brigade.c:53
> #9  0x005f2405 in ap_core_output_filter (f=0x9ba22d0, b=0x9aed300) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/core_filters.c:882
> #10 0x005feb30 in ap_pass_brigade (next=0x9b0b820, bb=0x9ba7090) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/util_filter.c:526
> #11 0x00602ebb in ap_process_request (r=0x9af7308) at
> /usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_request.c:231
> #12 0x005ffcff in ap_process_http_connection (c=0x9ba1e98) at
> /usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_core.c:190
> #13 0x005fb65d in ap_run_process_connection (c=0x9ba1e98) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:43
> #14 0x005fb75c in ap_process_connection (c=0x9ba1e98, csd=0x9ba1ce8) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:178
> #15 0x006088cf in worker_thread (thd=0x9ac1ed0, dummy=0x9ac68f8) at
> /usr/src/debug/httpd-2.2.9.2/phorm/server/mpm/worker/worker.c:553
> #16 0x00130606 in dummy_worker (opaque=0x9ac1ed0) at
> threadproc/unix/thread.c:142
> #17 0x00ecf5ab in start_thread () from /lib/libpthread.so.0
> #18 0x0020bcfe in clone () from /lib/libc.so.6
> 
> I suppose, the problem is in "proxy_conn_scpool" pool which gets destroyed
> prematurely like this:
> 
> #0  ap_proxy_release_connection (proxy_function=0x253507 "HTTP",
> conn=0xa596200, s=0x9b25a18)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/proxy_util.c:1721
> #1  0x00250905 in ap_proxy_http_cleanup (scheme=0x0, r=<value optimized out>,
> backend=0x1)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1851
> #2  0x00250bc4 in proxy_http_handler (r=0x9e21e58, worker=0x9b2cb88,
> conf=0x9aa53a8, url=0xa2ea530 "/", proxyname=0x0, proxyport=0)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1980
> #3  0x00258be6 in proxy_http_handler_wrapper (r=0x9e21e58, worker=0x9b2cb88,
> proxy_conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/",
>     proxyname=0x0, proxyport=0) at mod_proxysense.cpp:586
> #4  0x05765880 in proxy_run_scheme_handler (r=0x9e21e58, worker=0x9b2cb88,
> conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/", proxyhost=0x0,
>     proxyport=0) at
> /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:2511
> #5  0x05769f83 in proxy_handler (r=0x9e21e58) at
> /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:1016
> 
> It is destroyed with apr_pool_clear(p) (p is "proxy_conn_pool"). In the
> meantime, the brigade was set aside (in ap_core_output_filter()) with backend

The buckets that are set aside are not part of a brigade created
with the proxy_conn_pool. They have been transfered previously via
ap_proxy_buckets_lifetime_transform to a brigade created with the request pool.
Pool lifetime management and code in the proxy code is really tricky.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #4 from Ruediger Pluem <rp...@apache.org> 2010-01-25 09:01:07 CET ---
(In reply to comment #0)

> #0  ap_proxy_release_connection (proxy_function=0x253507 "HTTP",
> conn=0xa596200, s=0x9b25a18)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/proxy_util.c:1721
> #1  0x00250905 in ap_proxy_http_cleanup (scheme=0x0, r=<value optimized out>,
> backend=0x1)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1851
> #2  0x00250bc4 in proxy_http_handler (r=0x9e21e58, worker=0x9b2cb88,
> conf=0x9aa53a8, url=0xa2ea530 "/", proxyname=0x0, proxyport=0)
>     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1980
> #3  0x00258be6 in proxy_http_handler_wrapper (r=0x9e21e58, worker=0x9b2cb88,
> proxy_conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/",
>     proxyname=0x0, proxyport=0) at mod_proxysense.cpp:586

You are running a 3rd party module. Does this crash also happen without it?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #6 from Ruediger Pluem <rp...@apache.org> 2010-01-26 02:51:42 CET ---
(In reply to comment #5)

> > > 
> > > It is destroyed with apr_pool_clear(p) (p is "proxy_conn_pool"). In the
> > > meantime, the brigade was set aside (in ap_core_output_filter()) with backend
> > 
> > The buckets that are set aside are not part of a brigade created
> > with the proxy_conn_pool. They have been transfered previously via
> > ap_proxy_buckets_lifetime_transform to a brigade created with the request pool.
> > Pool lifetime management and code in the proxy code is really tricky.
> 
> Life management is in trunk version but I did not found it in 2.2.9. Could that
> be that 2.2.9 have this bug?

Could be PR45792. This is fixed since 2.2.11.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #1 from Aleksey Midenkov <as...@uezku.kemsu.ru> 2010-01-25 06:19:02 UTC ---
Also, take into account, that operation

            *conn = worker->cp->conn;
            worker->cp->conn = NULL;

is not atomic and not thread safe. We potentially can get same conn for two
threads. This also happens in trunk version.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

Aleksey Midenkov <as...@uezku.kemsu.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asm@uezku.kemsu.ru

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 48606] mod_proxy segmentation fault under high load

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48606

--- Comment #5 from Aleksey Midenkov <as...@uezku.kemsu.ru> 2010-01-26 01:23:31 UTC ---
(In reply to comment #3)
> (In reply to comment #0)
> > In rare situations we face such core dump.
> > 
> > [Switching to thread 11 (process 12096)]#0  0x00380410 in __kernel_vsyscall ()
> > #0  0x00380410 in __kernel_vsyscall ()
> > #1  0x00163226 in kill () from /lib/libc.so.6
> > #2  0x005fcdee in sig_coredump (sig=11) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/mpm_common.c:1239
> > #3  <signal handler called>
> > #4  apr_allocator_free (allocator=0x0, node=0x9ae2a90) at
> > memory/unix/apr_pools.c:345
> > #5  0x007fcd83 in apr_bucket_free (mem=0x9ae2ab8) at
> > buckets/apr_buckets_alloc.c:191
> > #6  0x007fd4cf in heap_bucket_destroy (data=0x9b0b8f0) at
> > buckets/apr_buckets_heap.c:36
> > #7  0x007fe1d2 in apr_brigade_cleanup (data=0x9aed300) at
> > buckets/apr_brigade.c:44
> > #8  0x007fe92a in apr_brigade_destroy (b=0x9aed300) at buckets/apr_brigade.c:53
> > #9  0x005f2405 in ap_core_output_filter (f=0x9ba22d0, b=0x9aed300) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/core_filters.c:882
> > #10 0x005feb30 in ap_pass_brigade (next=0x9b0b820, bb=0x9ba7090) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/util_filter.c:526
> > #11 0x00602ebb in ap_process_request (r=0x9af7308) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_request.c:231
> > #12 0x005ffcff in ap_process_http_connection (c=0x9ba1e98) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/modules/http/http_core.c:190
> > #13 0x005fb65d in ap_run_process_connection (c=0x9ba1e98) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:43
> > #14 0x005fb75c in ap_process_connection (c=0x9ba1e98, csd=0x9ba1ce8) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/connection.c:178
> > #15 0x006088cf in worker_thread (thd=0x9ac1ed0, dummy=0x9ac68f8) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/server/mpm/worker/worker.c:553
> > #16 0x00130606 in dummy_worker (opaque=0x9ac1ed0) at
> > threadproc/unix/thread.c:142
> > #17 0x00ecf5ab in start_thread () from /lib/libpthread.so.0
> > #18 0x0020bcfe in clone () from /lib/libc.so.6
> > 
> > I suppose, the problem is in "proxy_conn_scpool" pool which gets destroyed
> > prematurely like this:
> > 
> > #0  ap_proxy_release_connection (proxy_function=0x253507 "HTTP",
> > conn=0xa596200, s=0x9b25a18)
> >     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/proxy_util.c:1721
> > #1  0x00250905 in ap_proxy_http_cleanup (scheme=0x0, r=<value optimized out>,
> > backend=0x1)
> >     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1851
> > #2  0x00250bc4 in proxy_http_handler (r=0x9e21e58, worker=0x9b2cb88,
> > conf=0x9aa53a8, url=0xa2ea530 "/", proxyname=0x0, proxyport=0)
> >     at /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy_http.c:1980
> > #3  0x00258be6 in proxy_http_handler_wrapper (r=0x9e21e58, worker=0x9b2cb88,
> > proxy_conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/",
> >     proxyname=0x0, proxyport=0) at mod_proxysense.cpp:586
> > #4  0x05765880 in proxy_run_scheme_handler (r=0x9e21e58, worker=0x9b2cb88,
> > conf=0x9aa53a8, url=0x9e2328e "http://xxx.xxx.xxx.xxx:3128/", proxyhost=0x0,
> >     proxyport=0) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:2511
> > #5  0x05769f83 in proxy_handler (r=0x9e21e58) at
> > /usr/src/debug/httpd-2.2.9.2/phorm/modules/proxy/mod_proxy.c:1016
> > 
> > It is destroyed with apr_pool_clear(p) (p is "proxy_conn_pool"). In the
> > meantime, the brigade was set aside (in ap_core_output_filter()) with backend
> 
> The buckets that are set aside are not part of a brigade created
> with the proxy_conn_pool. They have been transfered previously via
> ap_proxy_buckets_lifetime_transform to a brigade created with the request pool.
> Pool lifetime management and code in the proxy code is really tricky.

Life management is in trunk version but I did not found it in 2.2.9. Could that
be that 2.2.9 have this bug?

> You are running a 3rd party module. Does this crash also happen without it?

This is very rare crash and we not succeeded to reproduce it.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org