From nobody Mon Nov 22 17:58:19 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7D7DD1890DAC; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HyZkv2wLnz4qwG; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 38F589630; Mon, 22 Nov 2021 17:58:31 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id b17so13031718qvl.9; Mon, 22 Nov 2021 09:58:31 -0800 (PST) X-Gm-Message-State: AOAM533jHtAuxFtQhSuVxAkJFL3/h9JQlvef4NUceoK5H0MTgh4Skh6W /4E3D0ZzSJLWdlr+sOTtU7ZAKsfUyLL1JCYGfVo= X-Google-Smtp-Source: ABdhPJyc+6XdnL9lpc9IurF8KNhQ9/chXr9g2fF5waqrUn/cv6ZtX5XJboxu9VsBzfszzjI+8rJrl/wdZ8x9guZrJqc= X-Received: by 2002:a0c:fa07:: with SMTP id q7mr102838644qvn.18.1637603910671; Mon, 22 Nov 2021 09:58:30 -0800 (PST) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202111221634.1AMGYoK4064366@gitrepo.freebsd.org> <20211122172544.a3wi636tajsnsfme@mutt-hbsd> In-Reply-To: <20211122172544.a3wi636tajsnsfme@mutt-hbsd> From: Kyle Evans Date: Mon, 22 Nov 2021 11:58:19 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 68396709e73a - releng/12.3 - libctf: Improve check for duplicate SOU definitions in ctf_add_type() To: Shawn Webb Cc: Mark Johnston , src-committers , "" , dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-ThisMailContainsUnwantedMimeParts: N On Mon, Nov 22, 2021 at 11:25 AM Shawn Webb wrote: > > On Mon, Nov 22, 2021 at 04:34:50PM +0000, Mark Johnston wrote: > > The branch releng/12.3 has been updated by markj: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=68396709e73a4cd392ffc06fde6bfa44d79118a7 > > > > commit 68396709e73a4cd392ffc06fde6bfa44d79118a7 > > Author: Mark Johnston > > AuthorDate: 2021-10-04 16:28:22 +0000 > > Commit: Mark Johnston > > CommitDate: 2021-11-22 16:32:18 +0000 > > > > libctf: Improve check for duplicate SOU definitions in ctf_add_type() > > > > When copying a struct or union from one CTF container to another, > > ctf_add_type() checks whether it matches an existing type in the > > destination container. It does so by looking for a type with the same > > name and kind as the new type, and if one exists, it iterates over all > > members of the source type and checks whether a member with matching > > name and offset exists in the matched destination type. This can > > produce false positives, for example because member types are not > > compared, but this is not expected to arise in practice. If the match > > fails, ctf_add_type() returns an error. > > > > The procedure used for member comparison breaks down in the face of > > anonymous struct and union members. ctf_member_iter() visits each > > member in the source definition and looks up the corresponding member in > > the desination definition by name using ctf_member_info(), but this > > function will descend into anonymous members and thus fail to match. > > Fix the problem by introducing a custom comparison routine which does > > not assume member names are unique. This should also be faster for > > types with many members; in the previous scheme, membcmp() would perform > > a linear scan of the desination type's members to perform a lookup by > > name. The new routine steps through the members of both types in a > > single loop. > > Hey Mark, > > Out of curiosity, would commits to releng branches necessitate an EN? > > Thanks, > This is just the in-progress release branch, so not here, at least.