[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#43786: [Various] libc/1235: DB2 leaks mmaps (fwd)



Package: libc6

Could you make sure that the next glibc upload you do includes this patch?
It should go into CVS soon, but it is quite important for the public alpha
and arm machines which use nss-db

Thanks,
Jason

---------- Forwarded message ----------
Date: Mon, 30 Aug 1999 11:25:55 -0700 (PDT)
From: "H.J. Lu" <hjl@varesearch.com>
To: jgg@faure.debian.org
Cc: jgg@ualberta.ca, GNU C Library <libc-hacker@sourceware.cygnus.com>
Subject: 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.


Reply to: