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 1CC493858D28 for ; Tue, 2 May 2023 16:24:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CC493858D28 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=1683044668; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Grc/Vft3c/mRdT3kvEjKKOF4wN9andToMuJ30/nNDvw=; b=gNNNUhJGbgtwycYyikhpwkwIKxfvf0JHMpkyjiTUXOQze9CjFH0bhDeevZKnSXtvDQRmLz 5cIshZhbBlnIunkU8aVCJ13TlRfQCD7oy+K3WRMInxQqI5K/ZLQ+hJqtudbTkM4plmCNtp zszzNb/8XakgdQtetFQ5hSaor77lwiY= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-MZoDk7U9PjGlBACyqMZeNQ-1; Tue, 02 May 2023 12:24:26 -0400 X-MC-Unique: MZoDk7U9PjGlBACyqMZeNQ-1 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-63b87d2367dso2524160b3a.2 for ; Tue, 02 May 2023 09:24:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683044665; x=1685636665; h=content-transfer-encoding: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=Grc/Vft3c/mRdT3kvEjKKOF4wN9andToMuJ30/nNDvw=; b=QMxsOb6n8T8FHVgaa9TmLlKt7KKLiGlQ3NMI/6uXHnbbaV4bk7irQ4Ex5OxjDwdwbp VRTswpXDfD2tyg2aAiSXWkuRXATMTVWDT7t/reZTY6YJdd0SS5wErRExaHeXYUPbd7sg N7REacY8nnKvIcxgPjTW3HQel2F8W6tKCyNAJiDk8NvAOUGiE1wXvX/qsMsHeUAzRixt ng+YpJm45sozP1yFnddqy+sMh053cMB9nwKVn7rUeJJrh6aQEcF07ax/jsKBpEFkzluf YSOmTkg49dEy+bsDh6Py78InNqsMZNmvFeJRR+801IK3LclbJzdfVy0CRx4JxDZiwU3G lbIA== X-Gm-Message-State: AC+VfDzDdjgVWygbCVPVsnt8AfIPZ6UgiZg3gYWuYNuSq60lgn32KXFW NjeNko1B6QJQIn4y+nuuccKt1zzw6rJ8iG9B1vmQeOvpWOPSzWL2VAfqR1pxPP4PeLYbpnqN9OO rZ0XuFfQLHPgddaW4nUyW/5KMQoL2/JJFyx0uCe8gJAtuow8= X-Received: by 2002:a05:6a20:7da6:b0:f8:c19f:1c1d with SMTP id v38-20020a056a207da600b000f8c19f1c1dmr20352104pzj.61.1683044665479; Tue, 02 May 2023 09:24:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6N7JrzlJLvUDn1Hi5ti5opFhR9x02/DVeG9APm4nomLJ8GEUDegGUqzwHE9UdkR9jTqhAI5cMBDmTXb3fxO+M= X-Received: by 2002:a05:6a20:7da6:b0:f8:c19f:1c1d with SMTP id v38-20020a056a207da600b000f8c19f1c1dmr20352086pzj.61.1683044665213; Tue, 02 May 2023 09:24:25 -0700 (PDT) MIME-Version: 1.0 References: <20230227194212.348003-1-amerey@redhat.com> <20230227194212.348003-6-amerey@redhat.com> <87ilda91kc.fsf@redhat.com> In-Reply-To: <87ilda91kc.fsf@redhat.com> From: Aaron Merey Date: Tue, 2 May 2023 12:24:13 -0400 Message-ID: Subject: Re: [PATCH 6/7] gdb/testsuite/gdb.debuginfod: Add lazy downloading tests To: Andrew Burgess Cc: Aaron Merey via Gdb-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Hi Andrew, On Tue, May 2, 2023 at 11:48=E2=80=AFAM Andrew Burgess wrote: > I compile GDB with both '-D_GLIBCXX_DEBUG=3D1' and > '-D_GLIBCXX_DEBUG_PEDANTIC=3D1' defined. > > After applying this series I see the following GDB crash when running > the fetch_src_and_symbols.exp test: > > (gdb) file > No executable file now. > /usr/include/c++/9/debug/safe_iterator.h:597: > In function: > __gnu_debug::_Safe_iterator<_Iterator, _Sequence, > std::bidirectional_iterator_tag>& __gnu_debug::_Safe_iterator<_Iter= ator, > _Sequence, std::bidirectional_iterator_tag>::operator--() [with > _Iterator =3D std::__cxx1998::_List_iterator >; > _Sequence =3D std::__debug::list >] > > Error: attempt to decrement a dereferenceable (start-of-sequence) itera= tor. Thanks for spotting this. It looks like the culprit is from the following c= hange in patch 5/7 [1]: diff --git a/gdbsupport/iterator-range.h b/gdbsupport/iterator-range.h index e934f5ebf01..853ebb9074a 100644 --- a/gdbsupport/iterator-range.h +++ b/gdbsupport/iterator-range.h @@ -61,4 +61,49 @@ struct iterator_range +template +struct reverse_iterator_range +{ + using iterator =3D IteratorType; + + /* Create a reverse iterator range using explicit BEGIN and END iterators. */ + template + reverse_iterator_range (IteratorType begin, IteratorType end) + : m_begin (std::move (end)), m_end (std::move (begin)) + { + if (m_begin !=3D m_end) + { + /* M_BEGIN is the base iterator's one-past-the-end. Increment it + so it points to the ranges's last element. */ + ++m_begin; + + /* M_END points to the range's first element. Increment it so it's + one-past-the-end. */ + ++m_end; + } + } [...] '++m_end' has the effect of decrementing a std::list begin() iterator, thou= gh it should never be dereferenced. I'll fix this and post a follow up to patch 5= /7. Aaron [1] https://sourceware.org/pipermail/gdb-patches/2023-April/199076.html