This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Various] libc/1235: DB2 leaks mmaps


Could you please try this patch to see if it fixes your problem?

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
Mon Aug 30 11:19:56 1999  H.J. Lu  <hjl@gnu.org>

	* db2/common/db_region.c (__db_rdetach): Unmap the region
	if necessary.

Index: db2/common/db_region.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/db2/common/db_region.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 db_region.c
--- db2/common/db_region.c	1998/09/11 13:48:08	1.1.1.6
+++ db2/common/db_region.c	1999/08/30 18:21:17
@@ -507,8 +507,18 @@ __db_rdetach(infop)
 	 * If the region was removed when it was created, no further action
 	 * is required.
 	 */
-	if (F_ISSET(infop, REGION_REMOVED))
+	if (F_ISSET(infop, REGION_REMOVED)) {
+		if (F_ISSET(infop, REGION_PRIVATE)
+		    && !F_ISSET(infop, REGION_MALLOC))
+	 		/*
+			 * If it is private and not malloced, the
+			 * region is still mapped in. We need to
+			 * discard our mapping of the region.
+			 */
+			ret = __db_unmapregion(infop);
 		goto done;
+	}
+
 	/*
 	 * If the region was created in memory returned by malloc, the only
 	 * action required is freeing the memory.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]