[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#224735: marked as done (libstdc++5-3.3-dev: Leaks in string allocation?)



Your message dated Thu, 06 Jan 2005 22:58:41 +0100
with message-id <42083108@web.de>
and subject line libstdc++5-3.3-dev: Leaks in string allocation?
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 21 Dec 2003 20:44:42 +0000
>From marga@altern.org Sun Dec 21 14:44:41 2003
Return-path: <marga@altern.org>
Received: from 200-42-58-181.cab.prima.net.ar (erwin.amadeus) [200.42.58.181] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1AY7Yz-0003FG-00; Sun, 21 Dec 2003 11:40:21 -0600
Received: from hormiga.amadeus ([192.168.21.101] ident=mail)
	by erwin.amadeus with esmtp (Exim 3.35 #1 (Debian))
	id 1AY7Yx-0003TU-00; Sun, 21 Dec 2003 14:40:19 -0300
Received: from marga by hormiga.amadeus with local (Exim 3.35 #1 (Debian))
	id 1AY7dd-00050K-00; Sun, 21 Dec 2003 14:45:09 -0300
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="ISO-8859-1"
From: Margarita Manterola <debian@marga.com.ar>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libstdc++5-3.3-dev: Leaks in string allocation?
X-Mailer: reportbug 2.20
Date: Sun, 21 Dec 2003 14:45:09 -0300
Message-Id: <E1AY7dd-00050K-00@hormiga.amadeus>
Sender: Marga <marga@marga.com.ar>
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 
	2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_12_15 
	(1.212-2003-09-23-exp) on master.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=HAS_PACKAGE autolearn=no 
	version=2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_12_15
X-Spam-Level: 

Package: libstdc++5-3.3-dev
Version: 1:3.3.1-0pre0
Severity: normal
Tags: upstream

Hi, I think I've found a bug in the allocation of strings done by the
standard c++ library.  Maybe you are already aware of it, but I thought
it might be useful to report it.

This small testcase:
-------------------
#include <string>

int main(int argc, char* argv[])
{
    std::string stars = "*************";
    return 0;
}

Is reported to have leaks with three different leak analyzers:

leaktracer (2.4-1.0)
Gathered 1 (1 unique) points of data.
(gdb) 
#-- Leak: counted 1x / total Size: 1280
No source file for address 0x400a7efb.

ccmalloc (0.4.0-2.0)
(...)
.---------------.
|ccmalloc report|
=======================================================
| total # of|   allocated | deallocated |     garbage |
+-----------+-------------+-------------+-------------+
|      bytes|        1280 |           0 |        1280 |
+-----------+-------------+-------------+-------------+
|allocations|           1 |           0 |           1 |
+-----------------------------------------------------+
(...)
*100.0% = 1280 Bytes of garbage allocated in 1 allocation
|       |
|       |       0x40121da6 in <???>
|       |
|       |       0x080490b5 in <main>
(...)

valgrind (20031012)
(...)
==19195== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==19195== malloc/free: in use at exit: 1280 bytes in 1 blocks.
==19195== malloc/free: 1 allocs, 0 frees, 1280 bytes allocated.
==19195== 
==19195== searching for pointers to 1 not-freed blocks.
==19195== checked 4562000 bytes.
==19195== 
==19195== 1280 bytes in 1 blocks are still reachable in loss record 1 of 1
==19195==    at 0x4002CAFD: __builtin_new (vg_replace_malloc.c:172)
==19195==    by 0x4002CB68: operator new(unsigned) (vg_replace_malloc.c:185)
==19195==    by 0x402CEEFA: std::__default_alloc_template<true,0>::_S_chunk_alloc(unsigned, int&) (in /usr/lib/libstdc++.so.5.0.5)
==19195==    by 0x402CEE0C: std::__default_alloc_template<true,0>::_S_refill(unsigned) (in /usr/lib/libstdc++.so.5.0.5)
==19195== 
==19195== LEAK SUMMARY:
==19195==    definitely lost: 0 bytes in 0 blocks.
==19195==    possibly lost:   0 bytes in 0 blocks.
==19195==    still reachable: 1280 bytes in 1 blocks.
==19195==         suppressed: 0 bytes in 0 blocks.
(...)


Testing with other string constructors, such as 
  string stars(10, '*');
or passing a string as a parameter to a procedure, gives the same
results, while using the empty constructor (string stars;) shows no
leak at all.


At first I thought this might be a problem of the leak analyzers, but 3
analyzers having the same problem seems a bit too much.

I consulted some other programmers, and all agreed that this really
looked as a bug in the standard library.

I hope you can have a look at it.

Love,
Margarita Manterola


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux hormiga.amadeus 2.4.19-686 #1 Mon Nov 18 23:59:03 EST 2002 i686
Locale: LANG=es_AR, LC_CTYPE=es_AR

Versions of packages libstdc++5-3.3-dev depends on:
ii  g++-3.3                    1:3.3.1-0pre0 The GNU C++ compiler
ii  gcc-3.3-base               1:3.3.1-0pre0 The GNU Compiler Collection (base 
ii  libc6-dev                  2.3.2.ds1-10  GNU C Library: Development Librari
ii  libstdc++5                 1:3.3.2-4     The GNU Standard C++ Library v3

-- no debconf information


---------------------------------------
Received: (at 224735-done) by bugs.debian.org; 6 Jan 2005 21:59:17 +0000
>From falk@debian.org Thu Jan 06 13:59:17 2005
Return-path: <falk@debian.org>
Received: from fmmailgate04.web.de [217.72.192.242] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1Cmff3-0007SM-00; Thu, 06 Jan 2005 13:59:17 -0800
Received: by fmmailgate04.web.de (8.12.10/8.12.10/webde Linux 0.7) with SMTP id j06LwV2O002238
        for 224735-done@bugs.debian.org; Thu, 6 Jan 2005 22:58:46 +0100
Received: from [62.158.94.32] by freemailng5704.web.de with HTTP;
	Thu, 06 Jan 2005 22:58:41 +0100
Date: Thu, 06 Jan 2005 22:58:41 +0100
Message-Id: <42083108@web.de>
MIME-Version: 1.0
From: "Falk Hueffner" <falk@debian.org>
To: 224735-done@bugs.debian.org
Subject: libstdc++5-3.3-dev: Leaks in string allocation?
Precedence: fm-user
X-WEBDE-Sender: <falk.hueffner@web.de>
Organization: http://freemail.web.de/
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Delivered-To: 224735-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no 
	version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Hi,

the submitter forgot to cc: control@bugs.d.o, so this wasn't closed properly.

Falk




Reply to: