public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: kk71878@hotmail.com To: gcc-gnats@gcc.gnu.org Cc: kk71878@hotmail.com Subject: libstdc++/5492: basic_string allocator problem Date: Fri, 25 Jan 2002 09:56:00 -0000 [thread overview] Message-ID: <200201251746.g0PHkbe22442@localhost.localdomain> (raw) >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:
next reply other threads:[~2002-01-25 17:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-01-25 9:56 kk71878 [this message] 2002-01-25 15:46 Carlo Wood
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200201251746.g0PHkbe22442@localhost.localdomain \ --to=kk71878@hotmail.com \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).