From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15691 invoked by alias); 7 May 2002 14:56:08 -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 15642 invoked by uid 71); 7 May 2002 14:56:02 -0000 Resent-Date: 7 May 2002 14:56:02 -0000 Resent-Message-ID: <20020507145602.15641.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, edh@twcny.rr.com Received:(qmail 12276 invoked by uid 61); 7 May 2002 14:47:42 -0000 Message-Id:<20020507144741.12275.qmail@sources.redhat.com> Date: Tue, 07 May 2002 07:56:00 -0000 From: edh@twcny.rr.com Reply-To: edh@twcny.rr.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/6594: strstreambuf leaks 16 bytes - gcc 3.0.x X-SW-Source: 2002-05/txt/msg00191.txt.bz2 List-Id: >Number: 6594 >Category: libstdc++ >Synopsis: strstreambuf leaks 16 bytes - gcc 3.0.x >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 07 07:56:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ed Hourigan >Release: gcc 3.0.4 >Organization: >Environment: Red Hat Linux 7.2 on x86 processor >Description: The default constructor for strstreambuf allocates a buffer of 16 bytes. If you assign a user supplied buffer by calling setp(...), then the 16 byte buffer is not released and the pointer is lost. I have verified this leak using the linux tool 'memprof' Sample code: ( I am deriving a class from strstreambuf so I can control where the output stream goes ) class MyStreambuf : public strstreambuf { public: MyStreambuf() { setp( _buffer, _buffer, _buffer+BUFSIZE ); // leak here! ... } private: static const int BUFSIZE=256; char _buffer[BUFSIZE]; } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: