From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7182 invoked by alias); 24 Jan 2013 06:23:29 -0000 Received: (qmail 7173 invoked by uid 22791); 24 Jan 2013 06:23:28 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-yh0-f74.google.com (HELO mail-yh0-f74.google.com) (209.85.213.74) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Jan 2013 06:23:23 +0000 Received: by mail-yh0-f74.google.com with SMTP id z12so779921yhz.1 for ; Wed, 23 Jan 2013 22:23:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:mime-version :content-type:x-gm-message-state; bh=ZQX+V/vQ6Z1FiM61crF87/kIX6PqinsV0WPJ91wc+u8=; b=FZ16S15O0P1HSQF6BEuu8q1SiRuWO745XcvO7eiAjyen4vntQNwSPAAWR7e+HNxgVw m2si2VBjKykDwCxJUAkB0/VFs3l21gPrRCUe3gF3z7KoGRMS30UxyHj8PcBYdcAjkww0 6LP5UXM+1HFnhhS8rDKP87xs4gzW9J4xchqzvGgixRBT3n+0BKGo+Rv9bgNfJOXHS5G5 aKzhYmFDq9FLdQlPahXTYoqpng7jWIFlyTtGaaFh+bb6YJJWgxit5/IWxoz/NjB3BUIf DWUAhY4/Ug8Fl93z4dL9hSIvDgA0gdJByBlhz2OxUwpMX7CXPWp+rGfRPKCRr+UQt/ix KU+w== X-Received: by 10.101.16.20 with SMTP id t20mr147025ani.8.1359008602266; Wed, 23 Jan 2013 22:23:22 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id i27si1015335yhe.4.2013.01.23.22.23.22 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 23 Jan 2013 22:23:22 -0800 (PST) Received: from elbrus2.mtv.corp.google.com (elbrus2.mtv.corp.google.com [172.17.128.95]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 2239B31C1F8; Wed, 23 Jan 2013 22:23:22 -0800 (PST) Received: by elbrus2.mtv.corp.google.com (Postfix, from userid 74925) id BA7081C4804; Wed, 23 Jan 2013 22:23:21 -0800 (PST) From: Paul Pluzhnikov To: dnovillo@google.com, gcc-patches@gcc.gnu.org Cc: ppluzhnikov@google.com Subject: [google gcc-4_7, integration] Scribble on destructed strings to catch invalid accesses. Date: Thu, 24 Jan 2013 06:23:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQlhgMUnQ30HrMfsOtcjKxKEza9TSQUNljPvdAYnkMvJb3N/NNRf7kyVN5StJjAzeVh5cFud79gaN8F9xUY3k2iCQkEhfR146BeB05BsVZvxkQxH/Txogi1D+aoI3KDl9rjvDv7w3QbS5S3upinCCvI5lzm/3kGqP5Ht8w7K3c6IkABmVbI/aodNj/i4AhMjDkE2RBqyIbG2i3MkGYGB3CA8jFQ5rhDqJn2SSqs2Tuh4OoT0gRM= Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg01186.txt.bz2 This patch allows us to catch use of destructed strings. Google ref: b/5430313 Ok for google/gcc-4_7 and google/integration? -- Paul Pluzhnikov Index: libstdc++-v3/include/ext/sso_string_base.h =================================================================== --- libstdc++-v3/include/ext/sso_string_base.h (revision 195417) +++ libstdc++-v3/include/ext/sso_string_base.h (working copy) @@ -215,7 +215,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const _Alloc& __a); ~__sso_string_base() - { _M_dispose(); } + { + _M_dispose(); +#ifdef __google_stl_debug_dangling_string + __builtin_memset(this, 0xcd, sizeof(*this)); +#endif + } _CharT_alloc_type& _M_get_allocator()