This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
[hjl@varesearch.com (H.J. Lu)] Re: [Various] libc/1235: DB2 leaks mmaps
- To: GNU libc testers <libc-alpha@sourceware.cygnus.com>
- Subject: [hjl@varesearch.com (H.J. Lu)] Re: [Various] libc/1235: DB2 leaks mmaps
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 01 Sep 1999 09:55:12 -0700
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
Can somebody please test the appended patch on Arm, PPC, and SPARC? A
test case can be found in the Gnats DB entry for bug 1235.
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
- To: jgg@faure.debian.org
- Subject: Re: [Various] libc/1235: DB2 leaks mmaps
- From: hjl@varesearch.com (H.J. Lu)
- Date: Mon, 30 Aug 1999 11:25:55 -0700 (PDT)
- Cc: jgg@ualberta.ca, libc-hacker@sourceware.cygnus.com (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.