From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18729 invoked by alias); 25 Jan 2002 17:56: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 18694 invoked by uid 71); 25 Jan 2002 17:56:00 -0000 Resent-Date: 25 Jan 2002 17:56:00 -0000 Resent-Message-ID: <20020125175600.18693.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, kk71878@hotmail.com Received:(qmail 18384 invoked from network); 25 Jan 2002 17:53:42 -0000 Received: from unknown (HELO localhost.localdomain) (68.34.152.164) by sources.redhat.com with SMTP; 25 Jan 2002 17:53:42 -0000 Received: (from kevin@localhost) by localhost.localdomain (8.11.2/8.11.2) id g0PHkbe22442; Fri, 25 Jan 2002 11:46:37 -0600 Message-Id:<200201251746.g0PHkbe22442@localhost.localdomain> Date: Fri, 25 Jan 2002 09:56:00 -0000 From: kk71878@hotmail.com Reply-To: kk71878@hotmail.com To: gcc-gnats@gcc.gnu.org Cc: kk71878@hotmail.com X-Send-Pr-Version:3.113 Subject: libstdc++/5492: basic_string allocator problem X-SW-Source: 2002-01/txt/msg00887.txt.bz2 List-Id: >Number: 5492 >Category: libstdc++ >Synopsis: basic_string seems to fail to use template-defined allocator. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Jan 25 09:56:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Kevin Killingsworth >Release: 3.0.3 >Organization: Utilicorp >Environment: System: Linux fenix 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ./configure >Description: I am using a persistent object storage library to allocate memory using mmap(). Using this process, I can define allocators for all STL objects. I defined a new typedef (pstring) which is identical to string except that it uses the new allocator. This completely works with STLPort. It compiles completely with gcc 3.0.3, but when the program is stopped and re-started (re-loading the data from the storage file, I get a valid basic_string object, but the data within it is not valid. >How-To-Repeat: You should be able to reproduce this error by using any allocator other than default and the tracking which one is used (my inclination is that basic_string's data is being allocated by the default allocator regardless of any allocator passed as a template parameter) I reproduced this problem by using the POST++ library with a modified post_stl.h. POST++'s site is available at http://www.ispras.ru/~knizhnik/post.html I contacted Konstantin Kriznik, the author of this library and he too was unable to get it to work with gcc 3.0.3. If, for some reason you need a copy of the post_stl.h I was using, I am available at kk71878@hotmail.com >Fix: Honestly, I'm using an XML import/export for saving data instead of the persistent storage. If I can't get this resolved, I may have to come up with a work-around such as creating a new string class which doesn't have issues with the persistent storage allocator. (perhaps just a wrapper for basic_string which keeps its data as a char * buffer. >Release-Note: >Audit-Trail: >Unformatted: