From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 7D9323861863; Mon, 19 Feb 2024 08:21:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D9323861863 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7D9323861863 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708330880; cv=none; b=jKBt0cEzHsu0SC5cNIkveDoY/rGDUBYpTef4LJmqK0JWHL8tvkGEJp2DzpoEi6EhHMJ5iwxiTFaWoT6k0e3rN8AR7rQq4PWWWApwUpy3rPOXYo5RotrZkf0HdvQdii79TQigRTu+Mw1cHLFTSFn42mvxLYyiqLr7mCpd1G70/wg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708330880; c=relaxed/simple; bh=/6NTVPsrgBwE2M7NuexW5AEupTc/iFHHiwsjKxpnelo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=aL+qFc89ymTPLr+G7R6LQ6j7ofgW9CP7TGb4QRGAmN4nIJdAwS4Z5/IPokSsngM9KlYRG57Nnk78Prmd4eWKKqIPKSF+njFHM3vndlhUyyReLmcuG6suV6hdTDf6vqHyNvpjghOymeursqcNme+UdL6fxJhqNZK9s0MDCnFyN+w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a3122b70439so471447966b.3; Mon, 19 Feb 2024 00:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708330877; x=1708935677; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K0ZdkapBAiOl5PvNEGKtCQwPFVlYwlA22Tly9DC+E4g=; b=dWk23qJDN53Ab5BoGtsbLS2JDlpkcLEwO2CdhyIk32C1h/QtaRdLiuQMysCfTUpqAS 7OSJxlCqW9H+qrCVh1uTUtINl/hvMfz2hwrQzEvJ3zN+spkZsRNchDwDYGatXohwZgGo ykSo6CfBQyxMbjQYCeRAiS+bsBbO9R9UCP5r0M23S4IRSpnnOX+lsQHYprFIqJmZ3e/U U6iPmZIbY67nUm4Z/fY6FVNWOomglU/cSMu8v5v+lO6tWqTCA5uPapc8S2RNvrOc9Hw9 W3rdicTNWpmxU6K5gyE47rp7KfKs+WSt3YZIw3A2nI9agx0GfCaLXKXPfh5XyqcurOCB GV5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708330877; x=1708935677; 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=K0ZdkapBAiOl5PvNEGKtCQwPFVlYwlA22Tly9DC+E4g=; b=MkidOBR2dJwN4avhXR7eN7OpHlg1n97lhdfK+yXraDRc926uFOfNn3NlFhLcGGViWc 6FEmr2G4kM0266hyDxCB4ar5luE95fklLuq+1YPChaUvCtO+pwGcDKk7tEZkeeJpnv2+ TRb7YzCJSlTsXjojOE0CTxOrM3xRXM4VsAeQOwWRvyVqo5Btg30nqFi7zHuUKuhfTiMb Mw2gFf58kEKXvhGbYDsAg2xx6fk0nt4i0VDo6Kh0+jZBnD7R1rdVZ5jwbujUKX/woYZ7 avT8Qoi1xPTGcw5cu0XUV/6koqyy0F8DzAXaW0RrkKeF0o2x6J8S/TvyH481s1DqZFRM +hRQ== X-Forwarded-Encrypted: i=1; AJvYcCX5jVwk4Nhr9u443SezFrtCqtypxGXeMfXIZQ1KE8FLP9PjvdGGbwdQf/+5hE56LIrvjz9bdmsqArcEfphmfClJ25TmIAKA1w== X-Gm-Message-State: AOJu0YztA7k/4kKW2LoRrcNpImiwRozfg5mTd5RrbG6qaVkLNhWRS5Xt tTYpy6HmksJK9T9hbKjK3Px8pq108jU0HvgrPyB2QU+exJ/nQzTMU3puLsPIcBxUlU6bSuyo0Rk jVuHO2PXhKdWLjotyHrP+75X9LRFKeX+v X-Google-Smtp-Source: AGHT+IH5G3a5gQFomu8w5onBV4btb0NVM5qAJLtCkooaJKYQ/pfXnS2gGC3nDwmvmbgYKrP+rqGyDYtRRHhCuSNr1pA= X-Received: by 2002:a17:906:407:b0:a3e:a3dc:45c9 with SMTP id d7-20020a170906040700b00a3ea3dc45c9mr837911eja.72.1708330877006; Mon, 19 Feb 2024 00:21:17 -0800 (PST) MIME-Version: 1.0 References: <4c78d538-da4d-4a54-987d-3c4257913035@gmail.com> <9a6615ee-0a2c-4bcb-ad13-ba810edb9ee1@gmail.com> <3e1e1652-4320-4b63-a72f-572f045780ca@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Mon, 19 Feb 2024 08:21:04 +0000 Message-ID: Subject: Re: [PATCH][_GLIBCXX_DEBUG] Fix std::__niter_base behavior To: Stephan Bergmann Cc: "libstdc++" , gcc-patches , =?UTF-8?Q?Fran=C3=A7ois_Dumont?= , Jonathan Wakely Content-Type: multipart/alternative; boundary="00000000000015394e0611b7c74f" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: --00000000000015394e0611b7c74f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 19 Feb 2024, 08:12 Jonathan Wakely, wrote: > > > On Mon, 19 Feb 2024, 07:08 Stephan Bergmann, wrote: > >> On 2/17/24 15:14, Fran=C3=A7ois Dumont wrote: >> > Thanks for the link, tested and committed. >> >> I assume this is the cause for the below failure now, >> > > Yes, the new >=3D C++11 overload of __niter_base recursively unwraps > multiple layers of wrapping, so that a safe iterator wrapping a normal > iterator wrapping a pointer is unwrapped to just a pointer. But then > __niter_wrap doesn't restore both layers. > Actually that's not the problem. __niter_wrap would restore both layers, except that it uses __niter_base itself: > 347 | { return __from + (__res - std::__niter_base(__from)); } > | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ And it seems to be getting called with the wrong types. Maybe that's just a bug in std:: erase or maybe niter_wrap needs adjusting. I'll check in a couple of hours if Fran=C3=A7ois doesn't get to it first. I have to wonder how this wasn't caught by existing tests though. --00000000000015394e0611b7c74f--