From: Graham Leggett Date: Sun, 12 May 2013 10:38:46 +0000 (+0000) Subject: event MPM: Provide error handling for ThreadStackSize. PR 54311 X-Git-Tag: 2.4.5~290 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4905bbdf2991683dfef530de97125ff2b8ad9825;p=apache event MPM: Provide error handling for ThreadStackSize. PR 54311 trunk patch: http://svn.apache.org/r1433682 Submitted by: Tianyin Xu Reviewed by: minfrin, jailletc36, sf git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1481515 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c63b7f13f5..f48e338551 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.4.5 + *) event MPM: Provide error handling for ThreadStackSize. PR 54311 + [Tianyin Xu , Christophe Jaillet] + *) mod_dav: Do not segfault on PROPFIND with a zero length DBM. PR 52559 [Diego Santa Cruz ] diff --git a/STATUS b/STATUS index b4233a948a..5c1ba8e6bc 100644 --- a/STATUS +++ b/STATUS @@ -90,14 +90,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * event MPM: Provide error handling for ThreadStackSize. PR 54311 - trunk patch: http://svn.apache.org/r1433682 - 2.4.x patch: http://people.apache.org/~minfrin/httpd-event-ThreadStackSize-error.patch - +1: minfrin, jailletc36, sf - note jailletc36: see Graham's comment in: - http://mail-archives.apache.org/mod_mbox/httpd-dev/201301.mbox/%3C8FBE7DC2-E5E0-4CA7-AF28-D69E9137DCE1@sharp.fm%3E - sf has no idea for a better wording - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 1b42e69656..d8eaef4767 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2126,7 +2126,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02436) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads; diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 548fcaec60..4d7a92a718 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -1276,7 +1276,13 @@ static void child_main(int child_num_arg) apr_threadattr_detach_set(thread_attr, 0); if (ap_thread_stacksize != 0) { - apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + rv = apr_threadattr_stacksize_set(thread_attr, ap_thread_stacksize); + if (rv != APR_SUCCESS && rv != APR_ENOTIMPL) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, APLOGNO(02435) + "WARNING: ThreadStackSize of %" APR_SIZE_T_FMT " is " + "inappropriate, using default", + ap_thread_stacksize); + } } ts->threads = threads;