From nobody Tue Jul 04 00:07:50 2023 X-Original-To: dev-commits-src-main@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 4Qw35v4tgWz4l7hH; Tue, 4 Jul 2023 00:08:03 +0000 (UTC) (envelope-from khng300@gmail.com) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qw35v39rqz4CYq; Tue, 4 Jul 2023 00:08:03 +0000 (UTC) (envelope-from khng300@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-262d9e75438so3556545a91.2; Mon, 03 Jul 2023 17:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688429281; x=1691021281; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vtR6ZvZJ99ZA5O2X896T68Axt4rdLd5LHfgPaFCvx64=; b=aTfF2O8uEkMbZg6ygqgBEukbOPsdbNPr5plMIF2BiI6B1An3PBp5i6fDrD2Bwk3rZn Ks1qYaKGla0BUrfronW4hQwOEHFmjNLtzFc/wys1rtXntZcKYFpJVWnGLQ9xuMz3dXEz IMtun5GG08FAtmrUq2x1XpGaS1UCCvajeyxJ0HLUsBuTZdJyTtap+R/q0a3aRTDBlkZY eaY5raOsArU39f1mkwL71rFuP2o05XLINrmdumCAZTl/y4QXjVps/PsxRk7rhhvmJy+s xbycaL/B+DX1MYJIi1IsF6HjlxOC03CGZGY6TmHFLY/+fe3I5CpOKQu8FDMIafQ4DPbt GfAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688429281; x=1691021281; 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=vtR6ZvZJ99ZA5O2X896T68Axt4rdLd5LHfgPaFCvx64=; b=g2Y0ENms7s7LmEHYmYIbSzpV9RzuTCfpKvFw2Zrhx7KILlx7Dgr6I0SsRwdZFH5RYB 3xq8T/okSMHZ8wsfjf3yFuw1dXx+GmSNxzIeERJ4x+ElR4vdPt6eGOiHxPuYRm2BZpc2 MZzqcWYPoNn/GQCekrWEyWa2ZMEyoOrXAhzS+19VMvZ3S6Efu2zkqUAauQRl/flK9Lqv W/3/jjVjakhlcECeB9V+gK9PQkq9xfDPaptWBl0IvAHZ50SlxQ+IDz429c9YFp6crPfF ejAqw/U7SXzQ4S1MLbBUoZwaNoh4P7qBul85Sp7NsIaVJYLZuSq2WcXLoiGw/Ma4oPTQ JvpQ== X-Gm-Message-State: ABy/qLaRCzM6MY+dzr5kclXf/wdEAemkXJiHbCEcj0kEztDwIPrVvLeA yXXKOxrepx5fF7Vl6FCprUH8tmSpYnuJarleRwR5zUa5nSGMo39Y X-Google-Smtp-Source: APBJJlEwoX1/fIZmSC0XvSGyZT/u82SLxjktYvlSM9N7sOChFanIY4TaRKYlF6jYO5T/lAqUguU53fCLi7Dry8B8OsU= X-Received: by 2002:a17:903:18c:b0:1b8:3ab:e1c with SMTP id z12-20020a170903018c00b001b803ab0e1cmr13601701plg.30.1688429281491; Mon, 03 Jul 2023 17:08:01 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202307012259.361MxM4i017090@gitrepo.freebsd.org> In-Reply-To: From: Ka Ho Ng Date: Mon, 3 Jul 2023 20:07:50 -0400 Message-ID: Subject: Re: git: 005aa1743b42 - main - modules: bzero the modspecific_t To: Brooks Davis Cc: Ka Ho Ng , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000008d3efd05ff9e1329" X-Rspamd-Queue-Id: 4Qw35v39rqz4CYq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --0000000000008d3efd05ff9e1329 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 3, 2023, 17:24 Brooks Davis wrote: > On Sat, Jul 01, 2023 at 10:59:22PM +0000, Ka Ho Ng wrote: > > The branch main has been updated by khng: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=005aa1743b42b52fbd49b9d5ec44816902b6ee9f > > > > commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f > > Author: Ka Ho Ng > > AuthorDate: 2023-07-01 19:41:53 +0000 > > Commit: Ka Ho Ng > > CommitDate: 2023-07-01 22:58:46 +0000 > > > > modules: bzero the modspecific_t > > > > Per https://reviews.llvm.org/D68115, only the first field is > > zero-initialized, meanwhile other fields are undef. > > > > The pattern can be observed on clang as well, that when > > -ftrivial-auto-var-init=pattern is specified 0xaa is filled for > > non-active fields, otherwise they are zero-initialized. > > Technically both are acceptable when using clang. However it > > would be good to simply bzero the modspecific_t in such case to > > be strict to the standard. > > IMO this is a move in the wrong direction. We should see about > switching this file to C17 which IIRC removes this bug in the standard. > > Ideally we'd be moving to C23 where we can just do foo = {} > to zero things, but we've got a ways to go... > That seems like a good idea. Ka Ho --0000000000008d3efd05ff9e1329 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jul 3, 2023, 17:24 Brooks Davis <brooks@freebsd.org> wrote:
On Sat, Jul 01, 2023 at 10:59:22PM +0000, Ka Ho Ng wrote= :
> The branch main has been updated by khng:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D005aa1743b42b52fbd49b9d5ec4481= 6902b6ee9f
>
> commit 005aa1743b42b52fbd49b9d5ec44816902b6ee9f
> Author:=C2=A0 =C2=A0 =C2=A0Ka Ho Ng <khng@FreeBSD.org>
> AuthorDate: 2023-07-01 19:41:53 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Ka Ho Ng <khng@FreeBSD.org>
> CommitDate: 2023-07-01 22:58:46 +0000
>
>=C2=A0 =C2=A0 =C2=A0modules: bzero the modspecific_t
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Per https://reviews.llvm.org/D6811= 5, only the first field is
>=C2=A0 =C2=A0 =C2=A0zero-initialized, meanwhile other fields are undef.=
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0The pattern can be observed on clang as well, that = when
>=C2=A0 =C2=A0 =C2=A0-ftrivial-auto-var-init=3Dpattern is specified 0xaa= is filled for
>=C2=A0 =C2=A0 =C2=A0non-active fields, otherwise they are zero-initiali= zed.
>=C2=A0 =C2=A0 =C2=A0Technically both are acceptable when using clang. H= owever it
>=C2=A0 =C2=A0 =C2=A0would be good to simply bzero the modspecific_t in = such case to
>=C2=A0 =C2=A0 =C2=A0be strict to the standard.

IMO this is a move in the wrong direction.=C2=A0 We should see about
switching this file to C17 which IIRC removes this bug in the standard.

Ideally we'd be moving to C23 where we can just do foo =3D {}
to zero things, but we've got a ways to go...
That seems like a good idea.
Ka Ho
--0000000000008d3efd05ff9e1329--