[Pkg-apache-commits] r1222 - in /trunk/apr: changelog patches/00list patches/027_apr_socket_addr_get_lifetime.dpatch rules

sf at alioth.debian.org sf at alioth.debian.org
Tue Aug 17 21:06:59 UTC 2010


Author: sf
Date: Tue Aug 17 21:06:28 2010
New Revision: 1222

URL: http://svn.debian.org/wsvn/pkg-apache/?sc=1&rev=1222
Log:
* Fix pool life-time issue with apr_socket_addr_get(), resulting in a memory
  leak in Apache mod_proxy.
* Under Linux, if configure does not detect POSIX semaphores due to /dev/shm
  not being mounted, abort the build. Closes: #591286

Added:
    trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch   (with props)
Modified:
    trunk/apr/changelog
    trunk/apr/patches/00list
    trunk/apr/rules

Modified: trunk/apr/changelog
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apr/changelog?rev=1222&op=diff
==============================================================================
--- trunk/apr/changelog (original)
+++ trunk/apr/changelog Tue Aug 17 21:06:28 2010
@@ -1,6 +1,10 @@
 apr (1.4.2-4) UNRELEASED; urgency=low
 
   * Fix building with libtool 1.x. Closes: #575380
+  * Fix pool life-time issue with apr_socket_addr_get(), resulting in a memory
+    leak in Apache mod_proxy.
+  * Under Linux, if configure does not detect POSIX semaphores due to /dev/shm
+    not being mounted, abort the build. Closes: #591286
 
  -- Stefan Fritsch <sf at debian.org>  Sat, 22 May 2010 16:04:40 +0200
 

Modified: trunk/apr/patches/00list
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apr/patches/00list?rev=1222&op=diff
==============================================================================
--- trunk/apr/patches/00list (original)
+++ trunk/apr/patches/00list Tue Aug 17 21:06:28 2010
@@ -7,3 +7,4 @@
 023_fix_doxygen.dpatch
 025_GNU_SOURCE_earlier.dpatch
 026_omit_extra_libs.dpatch
+027_apr_socket_addr_get_lifetime.dpatch

Added: trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch?rev=1222&op=file
==============================================================================
--- trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch (added)
+++ trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch Tue Aug 17 21:06:28 2010
@@ -1,0 +1,32 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: * network_io/unix/sockets.c (apr_socket_connect): Copy the remote
+## DP: * address by value rather than by reference.  This ensures that the
+## DP: * sockaddr object returned by apr_socket_addr_get is allocated from
+## DP: * the same pool as the socket object itself, as apr_socket_accept
+## DP: * does; avoiding any potential lifetime mismatches.
+ at DPATCH@
+Modified: apr/apr/trunk/network_io/unix/sockets.c
+URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockets.c?rev=983618&r1=983617&r2=983618&view=diff
+==============================================================================
+--- trunk/network_io/unix/sockets.c (original)
++++ trunk/network_io/unix/sockets.c Mon Aug  9 12:51:29 2010
+@@ -387,10 +387,13 @@ apr_status_t apr_socket_connect(apr_sock
+         /* A real remote address was passed in.  If the unspecified
+          * address was used, the actual remote addr will have to be
+          * determined using getpeername() if required. */
+-        /* ### this should probably be a structure copy + fixup as per
+-         * _accept()'s handling of local_addr */
+-        sock->remote_addr = sa;
+         sock->remote_addr_unknown = 0;
++
++        /* Copy the address structure details in. */
++        sock->remote_addr->sa = sa->sa;
++        sock->remote_addr->salen = sa->salen;
++        /* Adjust ipaddr_ptr et al. */
++        apr_sockaddr_vars_set(sock->remote_addr, sa->family, sa->port);
+     }
+ 
+     if (sock->local_addr->port == 0) {
+

Propchange: trunk/apr/patches/027_apr_socket_addr_get_lifetime.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Modified: trunk/apr/rules
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apr/rules?rev=1222&op=diff
==============================================================================
--- trunk/apr/rules (original)
+++ trunk/apr/rules Tue Aug 17 21:06:28 2010
@@ -81,6 +81,20 @@
 	# multicast not supported on Hurd
 	sed -i '/HAVE_STRUCT_IPMREQ/ d' $(BUILDDIR)/include/arch/unix/apr_private.h
 endif
+ifeq (linux, $(DEB_BUILD_ARCH_OS))
+	if grep -q APR_HAS_POSIXSEM_SERIALIZE.*0 $(BUILDDIR)/include/apr.h ;\
+	then \
+		echo "WARNING: This is Linux but configure did not detect POSIX semaphores." ;\
+		if [ "$(stat -c '%d' /dev/shm)" = "$(stat -c '%d' /dev)" ] ;\
+		then \
+			echo "ERROR: POSIX semaphores not usable and /dev/shm not mounted." ;\
+			echo "ERROR: Aborting." ;\
+			echo "HINT: If you are using pbuilder or cowbuilder, add /dev/shm to BINDMOUNTS" ;\
+			echo "HINT: in pbuilderrc" ;\
+			exit 1 ;\
+		fi ;\
+	fi
+endif
 
 build: patch-stamp build-stamp
 




More information about the Pkg-apache-commits mailing list