public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: [Various] libc/1235: DB2 leaks mmaps
@ 1999-08-30 11:26 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 1999-08-30 11:26 UTC (permalink / raw)
  To: jgg; +Cc: jgg, GNU C Library

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-08-30 11:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-30 11:26 [Various] libc/1235: DB2 leaks mmaps H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).