From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3643 invoked by alias); 2 Jan 2003 22:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3625 invoked by uid 71); 2 Jan 2003 22:36:01 -0000 Resent-Date: 2 Jan 2003 22:36:01 -0000 Resent-Message-ID: <20030102223601.3624.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, doolin@ce.berkeley.edu Received: (qmail 1484 invoked by uid 61); 2 Jan 2003 22:26:15 -0000 Message-Id: <20030102222615.1483.qmail@sources.redhat.com> Date: Thu, 02 Jan 2003 22:36:00 -0000 From: doolin@ce.berkeley.edu Reply-To: doolin@ce.berkeley.edu To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/9147: Memory leak resulting from std::valarray->push_back(arg) X-SW-Source: 2003-01/txt/msg00156.txt.bz2 List-Id: >Number: 9147 >Category: libstdc++ >Synopsis: Memory leak resulting from std::valarray->push_back(arg) >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Jan 02 14:36:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: doolin@ce.berkeley.edu >Release: g++-3.2 >Organization: >Environment: GNU/Linux >Description: Memory leak in valarray and vg_clientfuncs.c: dave@dda:~/sf.net/geotechnica/projects/stratsection/test$ !va valgrind --leak-check=yes --show-reachable=yes ./coltest ==4378== valgrind-1.0.3, a memory error detector for x86 GNU/Linux. ==4378== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward. ==4378== Estimated CPU clock rate is 552 MHz ==4378== For more details, rerun with: -v ==4378== Sum: 20 RSum: 20 ==4378== ==4378== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==4378== malloc/free: in use at exit: 2640 bytes in 3 blocks. ==4378== malloc/free: 7 allocs, 4 frees, 2724 bytes allocated. ==4378== For counts of detected errors, rerun with: -v ==4378== searching for pointers to 3 not-freed blocks. ==4378== checked 4400124 bytes. ==4378== ==4378== definitely lost: 16 bytes in 1 blocks. ==4378== possibly lost: 0 bytes in 0 blocks. ==4378== still reachable: 2624 bytes in 2 blocks. ==4378== ==4378== 16 bytes in 1 blocks are definitely lost in loss record 1 of 3 ==4378== at 0x4004491B: malloc (vg_clientfuncs.c:100) ==4378== by 0x40044E84: realloc (vg_clientfuncs.c:262) ==4378== by 0x4038F83B: (within /lib/libc-2.2.5.so) ==4378== by 0x4033D166: (within /lib/libc-2.2.5.so) ==4378== ==4378== 64 bytes in 1 blocks are still reachable in loss record 2 of 3 ==4378== at 0x4004491B: malloc (vg_clientfuncs.c:100) ==4378== by 0x4033D35F: (within /lib/libc-2.2.5.so) ==4378== by 0x402C7560: (within /usr/lib/libstdc++.so.5.0.1) ==4378== by 0x40295420: (within /usr/lib/libstdc++.so.5.0.1) ==4378== ==4378== 2560 bytes in 1 blocks are still reachable in loss record 3 of 3 ==4378== at 0x40044A0B: __builtin_new (vg_clientfuncs.c:125) ==4378== by 0x40044A51: operator new(unsigned) (vg_clientfuncs.c:138) ==4378== by 0x402B81DB: (within /usr/lib/libstdc++.so.5.0.1) ==4378== by 0x402B80F0: (within /usr/lib/libstdc++.so.5.0.1) ==4378== ==4378== LEAK SUMMARY: ==4378== definitely lost: 16 bytes in 1 blocks. ==4378== possibly lost: 0 bytes in 0 blocks. ==4378== still reachable: 2624 bytes in 2 blocks. ==4378== dave@dda:~/sf.net/geotechnica/projects/stratsection/test$ >How-To-Repeat: Use std::valarray->push_back(arg). I would be willing to submit an example if I don't get flamed too hard. If I get some time in a couple of weeks, I may even try to fix it. >Fix: Add a call to free() in the appropriate places. >Release-Note: >Audit-Trail: >Unformatted: