From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EF74D3858D1E for ; Mon, 1 May 2023 20:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF74D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682971531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ea2LVdbT0iZa39WfugZkvXXm7scP9Pj9PgrZPymr4Ac=; b=fn8y1k6HgeDepzo9VZty9HB28tweqMsh/dT+mDOhqmz7VppNurYL3pNkwxQPNaiJJ/srK4 K2j5IUrpp93fYfOC1zNKd2oBYqv7mtzD4i6AKOYh2x4+wkHXKVKdjl7SaCx7NGQAnVNRik sA2hTVaRw/7OSeXcTdvtEWGBrfTXHhg= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-13-XU7VWg9uNdSkhHh3yQK4TA-1; Mon, 01 May 2023 16:05:29 -0400 X-MC-Unique: XU7VWg9uNdSkhHh3yQK4TA-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-4f00d3f91a3so12470814e87.0 for ; Mon, 01 May 2023 13:05:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682971528; x=1685563528; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ea2LVdbT0iZa39WfugZkvXXm7scP9Pj9PgrZPymr4Ac=; b=Hm68roPNeqkb0JSy1bl5wvhDSm0EtBeG04qyHoqkI8h+vylN0OlVJYwvq/RAb+1sMh wGhF4yKB7dPtnm7U19XqeuhciqX9X4Cxds+PiB3lUyhGDQXrq4tHpXvnXaEtVFMkPeVO JrFXiZI7CWEHYlkzBHGy6j27uBpylfevT0pFYx+muH4e6sKWUE8zDGKZzfXv9W5x8Drg 7qITUn9JE2LLlumQ1uTNwf/Jtin064xUQX1/AJ8+IRfSGqlqx8G+PZ6N4joanEr6Bl8i ZclWOm3NonJh6ZzK+0HM/kdXZ/WiQ8hJglKMWgi2lhCaA6SHocL+sYZdzG8pIymwKg4l M4OQ== X-Gm-Message-State: AC+VfDzbv+B/Z9/L17Obb2VgPjU/xx3z8Um1R5w591aZoZKCzyExKhrE /sL7WG3CVpPr3wcPsd00h69pnqOLOeW15HNJZg1DrnQj1hChdUx4ml+VGNRE8SsEPv+P8typuBa RYANHMDisO4V+VhikYBmrDCBaLJrOJNY= X-Received: by 2002:a05:6512:12d1:b0:4e2:7ab6:15cd with SMTP id p17-20020a05651212d100b004e27ab615cdmr5655061lfg.30.1682971528525; Mon, 01 May 2023 13:05:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6yHeirefhreTBS/6673xVW6S3/nZjfJVZFIqxnYD2g9noECR3EPwKyHFF7KkkI6uWvZbVSt2ZtsKca/mC1aic= X-Received: by 2002:a05:6512:12d1:b0:4e2:7ab6:15cd with SMTP id p17-20020a05651212d100b004e27ab615cdmr5655056lfg.30.1682971528157; Mon, 01 May 2023 13:05:28 -0700 (PDT) MIME-Version: 1.0 References: <20230501070622.847749-1-tchaikov@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Mon, 1 May 2023 21:05:17 +0100 Message-ID: Subject: Re: [PATCH v1 0/1] Set _M_string_length before calling _M_dispose() To: Kefu Chai Cc: libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000001a75b805faa758aa" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000001a75b805faa758aa Content-Type: text/plain; charset="UTF-8" On Mon, 1 May 2023 at 21:04, Jonathan Wakely wrote: > > > On Mon, 1 May 2023 at 08:06, Kefu Chai via Libstdc++ < > libstdc++@gcc.gnu.org> wrote: > >> This patch fixes the false alarm when performing the check introduced by >> bf78b43873b0b7e8f9a430df38749b8b61f9c9b8 . A minimal reproducer can be >> found at https://godbolt.org/z/7q4nG68xn >> >> I am pasting the reproducer here just in case: >> >> #include >> #include >> #include >> >> int main() { >> unsigned char buf[sizeof(std::string)] ; >> std::memset(buf, 0xff, sizeof(buf)); >> const char s[] = "1234567890abcdefg"; >> std::istringstream in{s}; >> std::istreambuf_iterator it{in}, end; >> auto* p = new (buf) std::string(it, end); >> return 0; >> } >> >> Tested on x86_64-pc-linux-gnu, with "make check-target-libstdc++-v3". >> Would be great if this change can be included in thunk, 13.2 and 12 >> branches. >> > > The bf78b43873b0b7e8f9a430df38749b8b61f9c9b8 change isn't on the gcc-12 > branch. > Oh wait, yes it is - I was thinking of another change that I didn't backport, sorry. > > >> Kefu Chai (1): >> libstdc++: Set _M_string_length before calling _M_dispose() >> >> libstdc++-v3/include/bits/basic_string.tcc | 1 + >> 1 file changed, 1 insertion(+) >> >> -- >> 2.40.1 >> >> --0000000000001a75b805faa758aa--