From owner-freebsd-threads@FreeBSD.ORG Mon Apr 30 11:08:31 2007 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDBAA16A401 for ; Mon, 30 Apr 2007 11:08:31 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id BDAFA13C44B for ; Mon, 30 Apr 2007 11:08:31 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3UB8VdK007096 for ; Mon, 30 Apr 2007 11:08:31 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3UB8UwJ007092 for freebsd-threads@FreeBSD.org; Mon, 30 Apr 2007 11:08:30 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 30 Apr 2007 11:08:30 GMT Message-Id: <200704301108.l3UB8UwJ007092@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2007 11:08:31 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s threa/76690 threads fork hang in child for -lc_r 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/20016 threads pthreads: Cannot set scheduling timer/Cannot set virtu s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s bin/32295 threads pthread dont dequeue signals s threa/34536 threads accept() blocks other threads o kern/38549 threads the procces compiled whith pthread stopped in pthread_ s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/49087 threads Signals lost in programs linked with libc_r s kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/unset O_NONBLOC o threa/70975 threads unexpected and unreliable behaviour when using SYSV se o threa/72429 threads threads blocked in stdio (fgets, etc) are not cancella o threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST o threa/75273 threads FBSD 5.3 libpthread (KSE) bug o threa/75374 threads pthread_kill() ignores SA_SIGINFO flag s threa/76694 threads fork cause hang in dup()/close() function in child (-l o threa/79683 threads svctcp_create() fails if multiple threads call at the o threa/80435 threads panic on high loads o threa/83914 threads [libc] popen() doesn't work in static threaded program s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/85160 threads [libthr] [patch] libobjc + libpthread/libthr crash pro f threa/90278 threads libthr, ULE and -current produces >100% WCPU with apac o kern/91266 threads [threads] Trying sleep, but thread marked as sleeping s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc f threa/98256 threads gnome-system-monitor core dumps from pthread_testcance s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r o threa/101323 threads fork(2) in threaded programs broken. o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/110636 threads gdb(1): using gdb with multi thread application with l 29 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- s kern/19247 threads uthread_sigaction.c does not do anything wrt SA_NOCLDW s kern/22190 threads A threaded read(2) from a socketpair(2) fd can sometim s threa/30464 threads pthread mutex attributes -- pshared s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/69020 threads pthreads library leaks _gc_mutex o threa/79887 threads [patch] freopen() isn't thread-safe o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/81534 threads [libc_r] [patch] libc_r close() will fail on any fd ty o threa/110306 threads apache 2.0 segmentation violation when calling gethost 10 problems total. From owner-freebsd-threads@FreeBSD.ORG Tue May 1 12:50:10 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A04E16A400 for ; Tue, 1 May 2007 12:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 4B53813C48A for ; Tue, 1 May 2007 12:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l41CoAxr015948 for ; Tue, 1 May 2007 12:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l41CoAsW015947; Tue, 1 May 2007 12:50:10 GMT (envelope-from gnats) Resent-Date: Tue, 1 May 2007 12:50:10 GMT Resent-Message-Id: <200705011250.l41CoAsW015947@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Spencer Minear Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 71F4516A400 for ; Tue, 1 May 2007 12:47:18 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 58EC613C4AD for ; Tue, 1 May 2007 12:47:18 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l41ClHv0070250 for ; Tue, 1 May 2007 12:47:18 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l41CgGDN069444; Tue, 1 May 2007 12:42:16 GMT (envelope-from nobody) Message-Id: <200705011242.l41CgGDN069444@www.freebsd.org> Date: Tue, 1 May 2007 12:42:16 GMT From: Spencer Minear To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: threads/112297: Memory leak in ld-elf.so with each thread destruction X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 12:50:10 -0000 >Number: 112297 >Category: threads >Synopsis: Memory leak in ld-elf.so with each thread destruction >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 01 12:50:09 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Spencer Minear >Release: 6.0 >Organization: Secure Computing Corp >Environment: Found on our modified secure version of 6.0, but present on a straight 6.0 and later systems >Description: The allocate_tls function in libexec/rtld-elf/rtld.c allocates two memory areas with each call. The free_tls function in the same file only free's one of them wich each call. I.E. there is a memory leak with each thread distruction. The problem gets rather serious for applications like a mail filter based on libmilter. We found the problem with our modified 6.0 based system but it code has not changed even on current so I think it is present in all current released versions fo the code. A static link does not leak, which lead us to the solution in that the code for the same functions in libc (gen/tls.c) does not have the problem. The problem was observed when we used both libpthread and libthr, thus pointin us to the ld-elf code. >How-To-Repeat: Run a program that creates and destorys threads at a high rate. The following simple test program does the job quite nicely. #include #include #include #include #include #include #include #include #include #define INFO_FILE "thread_test_file" #define CREATE_THREAD(ret, func, arg) \ { \ pthread_t tid; \ if ((ret = pthread_create(&tid, NULL, func, (void*)(arg))) == 0) \ ret = pthread_detach(tid); \ } static void* mem_thread(void *arg) { int fd; FILE *fp; pthread_t tid; tid = pthread_self(); if ((fd = open(INFO_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) { fprintf(stderr, "Error opening %s: %s\n", INFO_FILE, strerror(errno)); return(NULL); } printf("File %s created\n", INFO_FILE); if ((fp = fdopen(fd, "w")) == NULL) { printf("Can't fdopen fd %d, %s\n", fd, strerror(errno)); close(fd); return(NULL); } fprintf(fp, "TEST of writing to file"); fflush(fp); fclose(fp); close(fd); return(NULL); } int main(int argc, char **argv, char **envp) { int ret; struct timespec rqtp; int i = 0; printf("Starting\n"); while (1) { CREATE_THREAD(ret, &mem_thread, NULL); if (ret) { perror("Creating thread1"); return -1; } rqtp.tv_sec = 0; rqtp.tv_nsec = 1000 * (i % 25); nanosleep(&rqtp, NULL); i++; } return 0; } >Fix: Copy the logic in the libc/gen/tls.c code and add a call to free the dtv pointer in free_tls within rtld.c. The Diff within in our code base CVS tree is as follows. This seems to fix the problem. I trust you will let us know if we are overlooking something and this fix is not safe. --- rtld.c 3 Jan 2006 20:44:27 -0000 1.4 +++ rtld.c 1 May 2007 12:37:45 -0000 @@ -2733,6 +2733,7 @@ } free((void*) tlsstart); + free(dtv); } #endif >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Tue May 1 13:10:05 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6E1E16A400 for ; Tue, 1 May 2007 13:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 99CB613C44C for ; Tue, 1 May 2007 13:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l41DA5IK016829 for ; Tue, 1 May 2007 13:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l41DA5k0016828; Tue, 1 May 2007 13:10:05 GMT (envelope-from gnats) Resent-Date: Tue, 1 May 2007 13:10:05 GMT Resent-Message-Id: <200705011310.l41DA5k0016828@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Spencer Minear Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 647D816A402 for ; Tue, 1 May 2007 13:06:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADFA13C46A for ; Tue, 1 May 2007 13:06:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l41D633G079650 for ; Tue, 1 May 2007 13:06:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l41D11kJ077800; Tue, 1 May 2007 13:01:01 GMT (envelope-from nobody) Message-Id: <200705011301.l41D11kJ077800@www.freebsd.org> Date: Tue, 1 May 2007 13:01:01 GMT From: Spencer Minear To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: threads/112300: Memory leak in free_tls within ld-elf.so X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 13:10:05 -0000 >Number: 112300 >Category: threads >Synopsis: Memory leak in free_tls within ld-elf.so >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 01 13:10:05 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Spencer Minear >Release: 6.0 >Organization: Secure Computing Corp >Environment: Found running our modified 6.0 code, but observed on 6.0 and code inspection suggests it is present on Current. >Description: The allocate_tls function in libexec/rtld-elf/rtld.c allocates two memory areas with each call. The free_tls function in the same file only free's one of them wich each call. I.E. there is a memory leak with each thread distruction. The problem gets rather serious for applications like a mail filter based on libmilter. We found the problem with our modified 6.0 based system but it code has not changed even on current so I think it is present in all current released versions fo the code. A static link does not leak, which lead us to the solution in that the code for the same functions in libc (gen/tls.c) does not have the problem. The problem was observed when we used both libpthread and libthr, thus pointin us to the ld-elf code. >How-To-Repeat: Run a program that creates many short lived threads. Following test program shows the problem very quickly. #include #include #include #include #include #include #include #include #include #define INFO_FILE "thread_test_file" #define CREATE_THREAD(ret, func, arg) \ { \ pthread_t tid; \ if ((ret = pthread_create(&tid, NULL, func, (void*)(arg))) == 0) \ ret = pthread_detach(tid); \ } static void* mem_thread(void *arg) { int fd; FILE *fp; pthread_t tid; tid = pthread_self(); if ((fd = open(INFO_FILE, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) { fprintf(stderr, "Error opening %s: %s\n", INFO_FILE, strerror(errno)); return(NULL); } printf("File %s created\n", INFO_FILE); if ((fp = fdopen(fd, "w")) == NULL) { printf("Can't fdopen fd %d, %s\n", fd, strerror(errno)); close(fd); return(NULL); } fprintf(fp, "TEST of writing to file"); fflush(fp); fclose(fp); close(fd); return(NULL); } int main(int argc, char **argv, char **envp) { int ret; struct timespec rqtp; int i = 0; printf("Starting\n"); while (1) { CREATE_THREAD(ret, &mem_thread, NULL); if (ret) { perror("Creating thread1"); return -1; } rqtp.tv_sec = 0; rqtp.tv_nsec = 1000 * (i % 25); nanosleep(&rqtp, NULL); i++; } return 0; } >Fix: Copy the logic in the libc/gen/tls.c code and add a call to free the dtv pointer in free_tls within rtld.c. The Diff within in our code base CVS tree is as follows. This seems to fix the problem. I trust you will let us know if we are overlooking something and this fix is not safe. --- rtld.c 3 Jan 2006 20:44:27 -0000 1.4 +++ rtld.c 1 May 2007 12:37:45 -0000 @@ -2733,6 +2733,7 @@ } free((void*) tlsstart); + free(dtv); } #endif >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Tue May 1 14:48:16 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F31216A400; Tue, 1 May 2007 14:48:16 +0000 (UTC) (envelope-from mb@imp.ch) Received: from pop.imp.ch (mx2.imp.ch [157.161.9.17]) by mx1.freebsd.org (Postfix) with ESMTP id CB68113C487; Tue, 1 May 2007 14:48:15 +0000 (UTC) (envelope-from mb@imp.ch) Received: from godot (godot.imp.ch [157.161.4.8]) by pop.imp.ch (8.13.8/8.13.8/Submit_imp) with ESMTP id l41EJRbV072451; Tue, 1 May 2007 16:19:28 +0200 (CEST) (envelope-from mb@imp.ch) Date: Tue, 1 May 2007 16:19:27 +0200 (CEST) From: Martin Blapp X-X-Sender: mb@godot To: Spencer Minear In-Reply-To: <200705011242.l41CgGDN069444@www.freebsd.org> Message-ID: <20070501161700.X3334@godot> References: <200705011242.l41CgGDN069444@www.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/112297: Memory leak in ld-elf.so with each thread destruction X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 14:48:16 -0000 Hi, > --- rtld.c 3 Jan 2006 20:44:27 -0000 1.4 > +++ rtld.c 1 May 2007 12:37:45 -0000 > @@ -2733,6 +2733,7 @@ > } > > free((void*) tlsstart); > + free(dtv); > } Also clamd seems to suffer under this memleak. Without the fix clamd slowly leaks memory untill it dies after some months. -- Martin From owner-freebsd-threads@FreeBSD.ORG Tue May 1 14:50:14 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BAA0D16A403 for ; Tue, 1 May 2007 14:50:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 5384D13C468 for ; Tue, 1 May 2007 14:50:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l41EoEjn023283 for ; Tue, 1 May 2007 14:50:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l41EoE3n023282; Tue, 1 May 2007 14:50:14 GMT (envelope-from gnats) Date: Tue, 1 May 2007 14:50:14 GMT Message-Id: <200705011450.l41EoE3n023282@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Spencer Minear Cc: Subject: Re: threads/112300: Memory leak in free_tls within ld-elf.so X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Spencer Minear List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 14:50:14 -0000 The following reply was made to PR threads/112300; it has been noted by GNATS. From: Spencer Minear To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/112300: Memory leak in free_tls within ld-elf.so Date: Tue, 1 May 2007 09:23:06 -0500 Clearly 113300 is a duplicate of 112297. I thought I had hit an error in my browser and the first submit had failed, so I sent the request again without waiting to see if the reply arrived. Clearly that was a mistake on my part, sorry for the duplication. -- Spence --------------------------------------------------------------- The information contained in this email message may be privileged, confidential and protected from disclosure. If you are not the intended recipient, any review, dissemination, distribution or copying is strictly prohibited. If you have received this email message in error, please notify the sender by reply email and delete the message and any attachments. Spencer Minear Ph. D. Secure Computing Corp. minear@securecomputing.com 2340 Energy Park Drive (651) 628-2756 St. Paul, MN 55108 U.S.A. (651) 628-2701 (fax) --------------------------------------------------------------- From owner-freebsd-threads@FreeBSD.ORG Tue May 1 14:50:19 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B3C716A401 for ; Tue, 1 May 2007 14:50:19 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CF4DA13C459 for ; Tue, 1 May 2007 14:50:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l41EoIoB023309 for ; Tue, 1 May 2007 14:50:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l41EoIoq023308; Tue, 1 May 2007 14:50:18 GMT (envelope-from gnats) Date: Tue, 1 May 2007 14:50:18 GMT Message-Id: <200705011450.l41EoIoq023308@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Martin Blapp Cc: Subject: Re: threads/112297: Memory leak in ld-elf.so with each thread destruction X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin Blapp List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 14:50:19 -0000 The following reply was made to PR threads/112297; it has been noted by GNATS. From: Martin Blapp To: Spencer Minear Cc: freebsd-gnats-submit@freebsd.org, freebsd-threads@freebsd.org Subject: Re: threads/112297: Memory leak in ld-elf.so with each thread destruction Date: Tue, 1 May 2007 16:19:27 +0200 (CEST) Hi, > --- rtld.c 3 Jan 2006 20:44:27 -0000 1.4 > +++ rtld.c 1 May 2007 12:37:45 -0000 > @@ -2733,6 +2733,7 @@ > } > > free((void*) tlsstart); > + free(dtv); > } Also clamd seems to suffer under this memleak. Without the fix clamd slowly leaks memory untill it dies after some months. -- Martin From owner-freebsd-threads@FreeBSD.ORG Tue May 1 15:11:56 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A6F8116A401; Tue, 1 May 2007 15:11:56 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECC913C46E; Tue, 1 May 2007 15:11:56 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l41FBu5A024387; Tue, 1 May 2007 15:11:56 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l41FBuub024383; Tue, 1 May 2007 15:11:56 GMT (envelope-from linimon) Date: Tue, 1 May 2007 15:11:56 GMT From: Mark Linimon Message-Id: <200705011511.l41FBuub024383@freefall.freebsd.org> To: minear@securecomputing.com, linimon@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: threads/112300: Memory leak in free_tls within ld-elf.so X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 May 2007 15:11:56 -0000 Synopsis: Memory leak in free_tls within ld-elf.so State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Tue May 1 15:11:27 UTC 2007 State-Changed-Why: Duplicate of threads/112297. http://www.freebsd.org/cgi/query-pr.cgi?pr=112300 From owner-freebsd-threads@FreeBSD.ORG Sat May 5 08:50:08 2007 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9DC316A402 for ; Sat, 5 May 2007 08:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 9726313C45A for ; Sat, 5 May 2007 08:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l458o82B071774 for ; Sat, 5 May 2007 08:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l458o86a071773; Sat, 5 May 2007 08:50:08 GMT (envelope-from gnats) Date: Sat, 5 May 2007 08:50:08 GMT Message-Id: <200705050850.l458o86a071773@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: threads/112297: commit references a PR X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2007 08:50:09 -0000 The following reply was made to PR threads/112297; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/112297: commit references a PR Date: Sat, 5 May 2007 08:45:10 +0000 (UTC) davidxu 2007-05-05 08:44:59 UTC FreeBSD src repository Modified files: libexec/rtld-elf rtld.c Log: Fix a TLS memory leak. PR: threads/112297 MFC: 1 week Revision Changes Path 1.123 +1 -0 src/libexec/rtld-elf/rtld.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"