From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13126 invoked by alias); 27 Mar 2007 18:22:20 -0000 Received: (qmail 13081 invoked by uid 48); 27 Mar 2007 18:22:06 -0000 Date: Tue, 27 Mar 2007 18:22:00 -0000 Message-ID: <20070327182206.13080.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/31368] basic_string and unsigned short leads to memory fault In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pcarlini at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg02597.txt.bz2 ------- Comment #12 from pcarlini at suse dot de 2007-03-27 19:22 ------- Ok, now I see. The kind of issue is unfortunately known, akin to 24196 for example, and ultimately due to the special, optimized way we are dealing with empty strings, not allocating dynamic memory at all. I don't think we can really solve the problem without breaking the binary compatibility of the entire library, therefore we suggest various options: 1- Make sure to never deal with empty strings (which means a string not holding a memory buffer, that's why reserve(1) works, for example) 2- Rebuild the library passing --enable-fully-dynamic-string, the option has been added exactly to help users in this case. 3- Switch to a different implementation of the string class: in recent releases we are offering one under (will become standard when we decide to break binary compatibility) -- pcarlini at suse dot de changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de |dot org | Status|WAITING |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2007-03-27 19:22:05 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31368