From owner-freebsd-hackers@freebsd.org Sun Jan 17 10:19:35 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B8924E3358 for ; Sun, 17 Jan 2021 10:19:35 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from rayleigh.systella.fr (newton-ipv6.systella.fr [IPv6:2001:7a8:a8ed:253::1]) (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 "*.systella.fr", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJW9y4fzhz4hln for ; Sun, 17 Jan 2021 10:19:34 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from [192.168.10.103] (hilbert.systella.fr [192.168.10.103]) (authenticated bits=0) by rayleigh.systella.fr (8.15.2/8.15.2/Debian-19) with ESMTPSA id 10HAJKmf445574 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 17 Jan 2021 11:19:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=systella.fr; s=mail; t=1610878762; bh=0I2YpXT7oKcXsU26TDJ0agfl/ZZQUj91fRfyeB90WWk=; h=To:From:Subject:Date:From; b=HwjUkWu488IbX76wpGRLUA73ThsPfAdxO7OENCA7hdB6d2XJNpGBm+pO3lOXMN9L8 9XtAsOkDQAgFa3Vr8DkbDS6cdrz6uGC38wBuUcZTb4YiUR9eNK3BOVr3TKpTFH+Bi2 cHmWMmsedsng1VNo2Kq/6S2V+ycBxT1OdChxvn/u0DXmXLE86vIdvyGYY2Ei40Ao63 Guh3wsChcjA1XMlJcEyB1+17PggwYGPFu9QtVFZzJvTTZXEXVomm3xFYc65UxkHGBU 15qTeKwTaBYiYo11AKIbUwYs45j3j11eZrC4DC706OqlTzDL+o3VX4RpTvwbG8S/gE VYyGVuoeg9jgw== To: freebsd-hackers@freebsd.org From: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= Subject: Mounting swap device on iscsi target Openpgp: preference=signencrypt Autocrypt: addr=joel.bertrand@systella.fr; prefer-encrypt=mutual; keydata= mQINBFphqV8BEAC+ye6YQBdlEn9p/mbZhiQLkZQjIbGL84M0XOd66AgWqJ3T2TiwEyiExQyM Of0VswmB1q6SaIyh0x4bzaRyKwJLWDJy+AMGLGT2cpmsrDgllUxiBv3xAoLpwR8yDuLs5+bT vPpu81Pm/nzO2NDl85+3WAQbW+bUDAUdBhkg7X07bjJePypRxoRh4LF/syalOjzPEFARFNBY VrXFCTS/F7ZwmUHLv2xWJpEyKHfsC4BSo4ZPjrKmPJBxBPxuR+KiSYG/TkjU6CzoFvdwRY33 GNrK+dUmt9/VnPC/l1rGWS3durgah4OEkxciesKiTvQBUzVfMY0dvzBQKJeNNMFLstnjq3NP qvo3g5DnhFYFSAjI7wzqLkcYO8qg01wrWYyY/NLfAY6CvK0VjlenlKu84ePQDu7zh9/DUzBs 75ZAP2vZv4o00B2A3ksbkXSIs9eSDDx19OS1EUkSqw1VtFRfupoMkK7I7zrGR+DBENl5oK09 SOYJw594XVAoPpZ5zVUlEBDpatBNICTTT17EHrVpEB222TVfChvoE0cwYGkS40nVRIhQ1Yo3 A8qeKb2EeeCtslgiNcb1ajeZOSGUSHnczWHTaX5jMB/evNxZpLJH1WX8PqZ/+7wVRYuZGZ/b r8V3wXjZVNzPSTONwq3w/VjizPcQqdwicoNtxvuB6hM1J1tLGQARAQABtCpCRVJUUkFORCBK b8OrbCA8am9lbC5iZXJ0cmFuZEBzeXN0ZWxsYS5mcj6JAlQEEwEKAD4WIQSrhgKgAkzAsSVl Vhc4B+jSUpDz5wUCWmGpXwIbIwUJCWYBgAULCQgHAgYVCgkICwIEFgIDAQIeAQ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xkBIFS5jPGzL8dSKDu5jIx8cboy9QUeH Tr6FXnLg Message-ID: Date: Sun, 17 Jan 2021 11:19:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.0 at rayleigh X-Virus-Status: Clean X-Rspamd-Queue-Id: 4DJW9y4fzhz4hln X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=systella.fr header.s=mail header.b=HwjUkWu4; dmarc=none; spf=pass (mx1.freebsd.org: domain of joel.bertrand@systella.fr designates 2001:7a8:a8ed:253::1 as permitted sender) smtp.mailfrom=joel.bertrand@systella.fr X-Spamd-Result: default: False [-2.55 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[systella.fr:s=mail]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:7a8:a8ed:253::1:from]; R_SPF_ALLOW(-0.20)[+ip6:2001:7a8:a8ed:253::1/64:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2001:7a8:a8ed:253::1:from:127.0.2.255]; DMARC_NA(0.00)[systella.fr]; DKIM_TRACE(0.00)[systella.fr:+]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_SHORT(-0.68)[-0.678]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.62)[subject]; ASN(0.00)[asn:13193, ipnet:2001:7a8::/32, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 10:19:35 -0000 Hello, I'm trying to mount iSCSI swap device during boot process. Of course, I have checked that configuration doesn't contains errors. On running system, if I start /etc/rc.d/iscsictl start, device is mounted without error. But not during boot, I obtains : Jan 17 10:48:17 pythagore iscsid[1009]: cannot open or create pidfile "/var/run/iscsid.pid": Operation not supported Jan 17 10:48:17 pythagore root[1010]: /etc/rc: WARNING: failed to start iscsid Jan 17 10:48:28 pythagore root[1014]: /etc/rc: WARNING: failed to start iscsictl Jan 17 10:49:20 pythagore kernel: WARNING: 192.168.10.128 (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting for iscsid(8) for 61 seconds; reconnecting Jan 17 10:50:23 pythagore kernel: WARNING: 192.168.10.128 (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting for iscsid(8) for 61 seconds; reconnecting This workstation doesn't have any hard disk : root@pythagore:/var/log # df -h Filesystem Size Used Avail Capacity Mounted on 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / devfs 1.0K 1.0K 0B 100% /dev procfs 4.0K 4.0K 0B 100% /proc fdescfs 1.0K 1.0K 0B 100% /dev/fd 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home After boot, /var/run/iscsid.pid is created but doesn't contains anything. If I start by hands iscsid and iscsictl, this file contains real PID of iscsid and target is connected as da0. For information, rc.conf contains : iscsid_enable="YES" iscsictl_enable="YES" iscsictl_flags="-Aa -w 10" Best regards, JKB From owner-freebsd-hackers@freebsd.org Sun Jan 17 16:03:04 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4B874EE067 for ; Sun, 17 Jan 2021 16:03:04 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJfpH61Rpz3NNv for ; Sun, 17 Jan 2021 16:03:03 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10HG2mRK006788 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 17 Jan 2021 16:02:51 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: joel.bertrand@systella.fr Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10HG2fQA004185 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 17 Jan 2021 23:02:41 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Mounting swap device on iscsi target To: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= , freebsd-hackers@freebsd.org References: From: Eugene Grosbein Message-ID: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> Date: Sun, 17 Jan 2021 23:02:34 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DJfpH61Rpz3NNv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.10 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c2c:26d8::2:from]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c2c:26d8::2:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[empty SPF record]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 16:03:04 -0000 17.01.2021 17:19, BERTRAND Joël wrote: > I'm trying to mount iSCSI swap device during boot process. Of course, I > have checked that configuration doesn't contains errors. > > On running system, if I start /etc/rc.d/iscsictl start, device is > mounted without error. But not during boot, I obtains : > > Jan 17 10:48:17 pythagore iscsid[1009]: cannot open or create pidfile > "/var/run/iscsid.pid": Operation not supported > Jan 17 10:48:17 pythagore root[1010]: /etc/rc: WARNING: failed to start > iscsid > Jan 17 10:48:28 pythagore root[1014]: /etc/rc: WARNING: failed to start > iscsictl > Jan 17 10:49:20 pythagore kernel: WARNING: 192.168.10.128 > (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting > for iscsid(8) for 61 seconds; reconnecting > Jan 17 10:50:23 pythagore kernel: WARNING: 192.168.10.128 > (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting > for iscsid(8) for 61 seconds; reconnecting > > This workstation doesn't have any hard disk : > > root@pythagore:/var/log # df -h > Filesystem Size Used Avail Capacity Mounted on > 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / > devfs 1.0K 1.0K 0B 100% /dev > procfs 4.0K 4.0K 0B 100% /proc > fdescfs 1.0K 1.0K 0B 100% /dev/fd > 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home For diskless system, you better create in-memory tmpfs for /var/run directory or for /var as a whole. Refer to rc.conf(5) manual page for "varmfs" setting. From owner-freebsd-hackers@freebsd.org Sun Jan 17 16:20:38 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4F824EEB29 for ; Sun, 17 Jan 2021 16:20:38 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from rayleigh.systella.fr (newton-ipv6.systella.fr [IPv6:2001:7a8:a8ed:253::1]) (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 "*.systella.fr", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJgBY6VzPz3PR1 for ; Sun, 17 Jan 2021 16:20:37 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from [192.168.10.103] (hilbert.systella.fr [192.168.10.103]) (authenticated bits=0) by rayleigh.systella.fr (8.15.2/8.15.2/Debian-19) with ESMTPSA id 10HGKNZ5558083 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 17 Jan 2021 17:20:24 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=systella.fr; s=mail; t=1610900424; bh=sZeII78LkMpqKJP3THjEnZ13OdgYoZ/FvdUjVnegYi0=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Rz5AmuDtAnornaageD/xcyhZpBPu9gAKhE6/8rx6xpn8t7x+p+8J1wUTsSxWZulHO 4322sfJAn1Yf3uY3uHH2uhREaK5bI71m8Yn3eJ1Tik/vWCh7C904UCvij/ZsrKfjPI WeBN1xXNRgVDZ1oG//uxbaK9fpRqH1kgYiLWgLsP1gSCn54q9XFhl74iiEZrdYlJgp avBBeHfbRT3iUEPCmRGpzzVfMM8/I5RUZJG89aGuPJZ5zO+n90KoNTxIpX+HT55f4i FGd1GRJ4hmpqylxnaO4yFdMd3VwLFOGeQPbjcYe1ZV6FT1bCtGWtIBEl1m2SWelaTj iU7/3WE3m4NKQ== Subject: Re: Mounting swap device on iscsi target To: freebsd-hackers@freebsd.org References: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> From: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= Openpgp: preference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TGdga2rMzO9ZycKo7DPrdZVi7bZWKM/WM0IL5m6FTPSJteJ886NP9oc8U6o2GxZ1cMeZwnu AprT77mISL0Z1CCcoSDZEnD+EmOcKxYnkxJuhMY2kdMd2x47I2HFxTa1ix6UQ7OY6i0VQ4gG WZ3tgiHYIHbeAyZXn0P4nM5ofgEAEQEAAYkCPAQYAQoAJhYhBKuGAqACTMCxJWVWFzgH6NJS kPPnBQJaYalfAhsMBQkJZgGAAAoJEDgH6NJSkPPn9mEP/2mEFZGT0AaecRRXfpfrVnxxIwK8 YK3mmaa8jqSLXzDgubTO6PWojVt/SCrvhCtEf5vxATPbeFz5Ho0foI/iGys9SQkYmsIn13m0 z9oY8LBIyrPFud56RrIqYBno3qR6N7SWBWtZeUw+gc6HYbMyk2L7//wz4DkneJYLLcTfMxb/ +Ok0tNmWp6YfuyRBt5yHU6VfW4tZxF5qzg+9niW3VbB6BEZbM+ya7qBZD8su4e1EfUjaKb2z Egyw09laSgBW4NzGBwlhX3zeDsNTiReqa78e1pv52Ur3dI5GH4psLw4rH7ghh/aA/eVDMcKn LPNeTNl+Sz/1PK+oVNxz6tGBVsTVbZpwbanv6+qQP3yPvX0MS1x5QQPp/SAsjJv6lpFkoUGK n2clMYH8pSefR7jp0UPCrMBeFv5bom8tNMTHrIQrpnWo7vXUmeJ7OP/lHUtbBB26882pYbpa 05D79xUkBMYX2BGvtM687+CZaWwA4u/Tl7cu3PpIavPWgmmvIBJOwsDKxNgopLkix8AGFbfs wPcE7d03t9tdauheHA8pssNQmy3scoThC3DQc4eIEBUU5M9uIW2HARl3OgJP9h9OePsgaT8g zTlN3q6QmDWQwRmxF6J7Z9dtIDmXr+014XtK7UCzxkBIFS5jPGzL8dSKDu5jIx8cboy9QUeH Tr6FXnLg Message-ID: <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> Date: Sun, 17 Jan 2021 17:20:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.5.1 MIME-Version: 1.0 In-Reply-To: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.0 at rayleigh X-Virus-Status: Clean X-Rspamd-Queue-Id: 4DJgBY6VzPz3PR1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=systella.fr header.s=mail header.b=Rz5AmuDt; dmarc=none; spf=pass (mx1.freebsd.org: domain of joel.bertrand@systella.fr designates 2001:7a8:a8ed:253::1 as permitted sender) smtp.mailfrom=joel.bertrand@systella.fr X-Spamd-Result: default: False [-2.94 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[systella.fr:s=mail]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:7a8:a8ed:253::1:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:7a8:a8ed:253::1/64]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2001:7a8:a8ed:253::1:from:127.0.2.255]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[systella.fr:+]; NEURAL_HAM_SHORT(-1.00)[-0.998]; DMARC_NA(0.00)[systella.fr]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.56)[subject]; ASN(0.00)[asn:13193, ipnet:2001:7a8::/32, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 16:20:38 -0000 >> root@pythagore:/var/log # df -h >> Filesystem Size Used Avail Capacity Mounted on >> 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / >> devfs 1.0K 1.0K 0B 100% /dev >> procfs 4.0K 4.0K 0B 100% /proc >> fdescfs 1.0K 1.0K 0B 100% /dev/fd >> 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home > > For diskless system, you better create in-memory tmpfs for /var/run directory > or for /var as a whole. Refer to rc.conf(5) manual page for "varmfs" setting. If I have understood, varmfs creates whole /var. I have some troubles with /var/at also. How can I create a file system in memory for /var/run and /var/at ? Regards, JKB From owner-freebsd-hackers@freebsd.org Sun Jan 17 16:31:21 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26FF84EF086 for ; Sun, 17 Jan 2021 16:31:21 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJgQw2nN1z3QNn for ; Sun, 17 Jan 2021 16:31:19 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10HGVDIt006995 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 17 Jan 2021 16:31:14 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: joel.bertrand@systella.fr Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10HGV9Aw004573 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 17 Jan 2021 23:31:09 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Mounting swap device on iscsi target To: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= , freebsd-hackers@freebsd.org References: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> From: Eugene Grosbein Message-ID: Date: Sun, 17 Jan 2021 23:31:02 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DJgQw2nN1z3QNn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.10 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c2c:26d8::2:from]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c2c:26d8::2:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[empty SPF record]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-0.997]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 16:31:21 -0000 17.01.2021 23:20, BERTRAND Joël wrote: >>> root@pythagore:/var/log # df -h >>> Filesystem Size Used Avail Capacity Mounted on >>> 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / >>> devfs 1.0K 1.0K 0B 100% /dev >>> procfs 4.0K 4.0K 0B 100% /proc >>> fdescfs 1.0K 1.0K 0B 100% /dev/fd >>> 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home >> >> For diskless system, you better create in-memory tmpfs for /var/run directory >> or for /var as a whole. Refer to rc.conf(5) manual page for "varmfs" setting. > > If I have understood, varmfs creates whole /var. I have some troubles > with /var/at also. How can I create a file system in memory for /var/run > and /var/at ? Read diskless(8) manual page, section CONFIGURATION. From owner-freebsd-hackers@freebsd.org Sun Jan 17 18:43:23 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D4324D3E35 for ; Sun, 17 Jan 2021 18:43:23 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from rayleigh.systella.fr (newton-ipv6.systella.fr [IPv6:2001:7a8:a8ed:253::1]) (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 "*.systella.fr", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJkMF2MwSz3rkf for ; Sun, 17 Jan 2021 18:43:20 +0000 (UTC) (envelope-from joel.bertrand@systella.fr) Received: from [192.168.10.103] (hilbert.systella.fr [192.168.10.103]) (authenticated bits=0) by rayleigh.systella.fr (8.15.2/8.15.2/Debian-19) with ESMTPSA id 10HIh6o2602585 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 17 Jan 2021 19:43:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=systella.fr; s=mail; t=1610908987; bh=/omdOQJ84UG7RxfTYxXMmVXl9yrEGhGU1Oka71CM+ig=; h=Subject:To:References:From:Date:In-Reply-To:From; b=BoVd7GrsPs2cq14xSNclPLTpJcUuASK7SuH1XZ3tIv7dpvzkyysHq7GCfPBGNZavH r2+3YhrGFbKqVmoKOw2D5yqiInCtqjNK6bj0X0/GB34ZReNFHUUqEvw6HvXwOMzV5D NMTfsxweI9p0WiHG2BbovunOP7DmvukAS3wS8BmZX3UELJJmM8ubKki5MMn2ATlsYv JXsUW9OQHGNtlJgYUHW33aCUSmJ+RwiuXWphxXWkxgEh+SCo391pkhNvTAf87s8VIB h9ZNk47kgEnulGAKLT5FcwyouLyKS9ZKdKVRnfu7JVntz8728N8fpVpjBhfcYKWhk4 q66/u6TgooQAA== Subject: Re: Mounting swap device on iscsi target To: freebsd-hackers@freebsd.org References: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> From: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= Openpgp: preference=signencrypt Autocrypt: addr=joel.bertrand@systella.fr; prefer-encrypt=mutual; keydata= mQINBFphqV8BEAC+ye6YQBdlEn9p/mbZhiQLkZQjIbGL84M0XOd66AgWqJ3T2TiwEyiExQyM Of0VswmB1q6SaIyh0x4bzaRyKwJLWDJy+AMGLGT2cpmsrDgllUxiBv3xAoLpwR8yDuLs5+bT vPpu81Pm/nzO2NDl85+3WAQbW+bUDAUdBhkg7X07bjJePypRxoRh4LF/syalOjzPEFARFNBY VrXFCTS/F7ZwmUHLv2xWJpEyKHfsC4BSo4ZPjrKmPJBxBPxuR+KiSYG/TkjU6CzoFvdwRY33 GNrK+dUmt9/VnPC/l1rGWS3durgah4OEkxciesKiTvQBUzVfMY0dvzBQKJeNNMFLstnjq3NP qvo3g5DnhFYFSAjI7wzqLkcYO8qg01wrWYyY/NLfAY6CvK0VjlenlKu84ePQDu7zh9/DUzBs 75ZAP2vZv4o00B2A3ksbkXSIs9eSDDx19OS1EUkSqw1VtFRfupoMkK7I7zrGR+DBENl5oK09 SOYJw594XVAoPpZ5zVUlEBDpatBNICTTT17EHrVpEB222TVfChvoE0cwYGkS40nVRIhQ1Yo3 A8qeKb2EeeCtslgiNcb1ajeZOSGUSHnczWHTaX5jMB/evNxZpLJH1WX8PqZ/+7wVRYuZGZ/b r8V3wXjZVNzPSTONwq3w/VjizPcQqdwicoNtxvuB6hM1J1tLGQARAQABtCpCRVJU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tl7cu3PpIavPWgmmvIBJOwsDKxNgopLkix8AGFbfs wPcE7d03t9tdauheHA8pssNQmy3scoThC3DQc4eIEBUU5M9uIW2HARl3OgJP9h9OePsgaT8g zTlN3q6QmDWQwRmxF6J7Z9dtIDmXr+014XtK7UCzxkBIFS5jPGzL8dSKDu5jIx8cboy9QUeH Tr6FXnLg Message-ID: <8ab80674-a54f-8720-93b9-8161a590c373@systella.fr> Date: Sun, 17 Jan 2021 19:43:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.0 at rayleigh X-Virus-Status: Clean X-Rspamd-Queue-Id: 4DJkMF2MwSz3rkf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=systella.fr header.s=mail header.b=BoVd7Grs; dmarc=none; spf=pass (mx1.freebsd.org: domain of joel.bertrand@systella.fr designates 2001:7a8:a8ed:253::1 as permitted sender) smtp.mailfrom=joel.bertrand@systella.fr X-Spamd-Result: default: False [-2.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[systella.fr:s=mail]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2001:7a8:a8ed:253::1:from]; R_SPF_ALLOW(-0.20)[+ip6:2001:7a8:a8ed:253::1/64:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2001:7a8:a8ed:253::1:from:127.0.2.255]; DMARC_NA(0.00)[systella.fr]; DKIM_TRACE(0.00)[systella.fr:+]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.930]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_MIXED_CHARSET(0.56)[subject]; ASN(0.00)[asn:13193, ipnet:2001:7a8::/32, country:FR]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 18:43:23 -0000 Eugene Grosbein a écrit : > 17.01.2021 23:20, BERTRAND Joël wrote: > >>>> root@pythagore:/var/log # df -h >>>> Filesystem Size Used Avail Capacity Mounted on >>>> 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / >>>> devfs 1.0K 1.0K 0B 100% /dev >>>> procfs 4.0K 4.0K 0B 100% /proc >>>> fdescfs 1.0K 1.0K 0B 100% /dev/fd >>>> 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home >>> >>> For diskless system, you better create in-memory tmpfs for /var/run directory >>> or for /var as a whole. Refer to rc.conf(5) manual page for "varmfs" setting. >> >> If I have understood, varmfs creates whole /var. I have some troubles >> with /var/at also. How can I create a file system in memory for /var/run >> and /var/at ? > > Read diskless(8) manual page, section CONFIGURATION. I don't understand your answer. I have configured this workstation a long time ago and I have read this manual page to write its configuration. My question was : how create two ramdisks, one for /var/at, the second for /var/run in /etc/rc.conf ? I suppose I can write a script in /etc/rc.d, but I'm pretty sure somebody use diskless FreeBSD workstation also. JKB From owner-freebsd-hackers@freebsd.org Sun Jan 17 18:58:56 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76ED94D4888 for ; Sun, 17 Jan 2021 18:58:56 +0000 (UTC) (envelope-from "") Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJkjC4Y18z3spk for ; Sun, 17 Jan 2021 18:58:55 +0000 (UTC) (envelope-from "") Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B97372400FF for ; Sun, 17 Jan 2021 19:58:51 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DJkj63XcTz6tmS; Sun, 17 Jan 2021 19:58:50 +0100 (CET) From: Walter von Entferndt To: Mark Millard Cc: freebsd-hackers@freebsd.org Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) Date: Sun, 17 Jan 2021 19:58:36 +0100 Message-ID: <5658698.5PxWuGnUD2@t450s.local.lan> In-Reply-To: References: <1648904.MsCH1bHPGx@t450s.local.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5028971.ppSauYnzuk" Content-Transfer-Encoding: 7Bit X-Rspamd-Queue-Id: 4DJkjC4Y18z3spk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=posteo.net (policy=none); spf=none (mx1.freebsd.org: domain of mout02.posteo.de has no SPF policy when checking 185.67.36.142) smtp.helo=mout02.posteo.de X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; CTE_CASE(0.50)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.142:from]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[yahoo.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers]; DMARC_POLICY_SOFTFAIL(0.10)[posteo.net : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 18:58:56 -0000 This is a multi-part message in MIME format. --nextPart5028971.ppSauYnzuk Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" At Samstag, 16. Januar 2021, 23:08:30 CET, Mark Millard wrote: > [... on POSIX ...] > You can use that to help judge if only supporting time_t as an > integer type is worthwhile in your view. > Yes, I think it's worth it. I'll try to find out if there's some implementation around with a floating point *time_t*, or with a *time_t* longer than 8 bytes or shorter than 4. I'd strongly assume there's (currently) not, because < 32 bit or > 8 byte *time_t* support an unreasonably short (or long, resp.) time frame. Special applications will very likely use their own data format and not *time_t*. With an 8-byte *time_t* you could even represent the time of big bang with a 1-second precision, right? This is a version with explicit assignments (and thus type conversions) in the routine /guess_time_t_max ()/ and another loop susceptible for overflow fixed, and the formatting done according to the genuine file. I hope this is maximal portable, /but/ I guess it will not compile on old compilers due to the use of the (new?) *uint_max_t* and *uint64_t* types. --- check_mktime.c.patch --- --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-17 19:33:55.695872000 +0100 @@ -3,6 +3,11 @@ # include # include # include +# include /* putenv(), exit(), EXIT_xxx */ +# include /* uintmax_t */ +# include /* printf() */ +# include /* CHAR_BIT, INT_MAX */ +# include /* format spec PRIX64: ll/l + X on 32/64-bit arch */ /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv @@ -16,6 +21,80 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) +/* The following two routines (should) work for integer representation + in either 2's or 1's complement (else it's a compiler bug). */ + +/* Count the bits set in any integer type. + Returns the precision (width - padding bits - sign bit) iff given + the xxx_MAX value of any integer type, signed or unsigned. + From SEI CERT C Coding Standard: + Rules for Developing Safe, Reliable, and Secure Systems (2016) */ +size_t +popcount (num) +uintmax_t num; +{ + size_t cnt = 0; + + while (num != 0) + { + if (num % 2 == 1) + cnt++; + num >>= 1; + } + return cnt; +} +#define PRECISION(max_value) popcount(max_value) +#define SIGN_BIT (1) + +/* Guess the maximum value of a time_t from it's storage width. + ASSERT time_t is not a floating point, or of any arcane width, + or unsigned (i.e. the bit pattern of (-1) treated special). + Only 4...8 byte width of a time_t are tested. + On error: returns (time_t)(-1) */ +time_t +guess_time_t_max () +{ + time_t t0, t1 = (time_t)(-1); + size_t size, prec = 1; + uint64_t u64; + + switch ((size = sizeof(time_t))) + { + case 4: + t0 = (time_t) 0xFFFFFFFF; + break; + case 5: + t0 = (time_t) 0xFFFFFFFFFF; + break; + case 6: + t0 = (time_t) 0xFFFFFFFFFFFF; + break; + case 7: + t0 = (time_t) 0xFFFFFFFFFFFFFF; + break; + case 8: + t0 = (time_t) 0xFFFFFFFFFFFFFFFF; + break; + default: + prec = 0; + break; + } + if (prec) + { + prec = PRECISION(t0) - SIGN_BIT; + t0 = (time_t) 1 << (prec - 1); + t1 = t0|(t0 - 1); + } +#ifdef DEBUG + fprintf (stderr, "time_t_max\t= 0x%"PRIX64"\n", (u64 = t1)); + fprintf (stderr, "sizeof(time_t)\t= %2zd byte\n", size); + fprintf (stderr, "precision\t= %2zd bit\n", prec); + fprintf (stderr, "padding\t\t= %2zd bit\n", size*CHAR_BIT - prec - SIGN_BIT); +#endif /* DEBUG */ + return t1; +} +#undef SIGN_BIT + /* Fail if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static void @@ -37,8 +116,8 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + if (mktime (&tm) == (time_t)(-1)) + exit (EXIT_FAILURE); } static void @@ -47,10 +126,10 @@ { struct tm *lt; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); now = time_t_max - now; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); } static void @@ -67,7 +146,7 @@ tm.tm_isdst = -1; mktime (&tm); if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + exit (EXIT_FAILURE); } static void @@ -82,7 +161,7 @@ alarm (10); now = mktime (&tm); alarm (0); - if (now != (time_t) -1) + if (now != (time_t)(-1)) { struct tm *lt = localtime (&now); if (! (lt @@ -96,7 +175,7 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + exit (EXIT_FAILURE); } } @@ -106,9 +185,10 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; + time_t_max = guess_time_t_max (); + if (time_t_max == (time_t)(-1)) + exit (EXIT_FAILURE); + delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { @@ -120,11 +200,15 @@ mktime_test ((time_t) 60 * 60); mktime_test ((time_t) 60 * 60 * 24); - for (j = 1; 0 < j; j *= 2) + /* NOTE This does not reach very large values > time_t_max/2 + neither the (susceptible for overflow) version + for (j = 1; 0 < j; j *= 2) does */ + for (i = j = 1; i < PRECISION(INT_MAX); i++, j *= 2) bigtime_test (j); bigtime_test (j - 1); } irix_6_4_bug (); spring_forward_gap (); - exit (0); + exit (EXIT_SUCCESS); } +/*! vi: set ai tabstop=8 shiftwidth=2: */ --- -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss) --nextPart5028971.ppSauYnzuk Content-Disposition: attachment; filename="check_mktime.c.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="check_mktime.c.patch" --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-17 19:33:55.695872000 +0100 @@ -3,6 +3,11 @@ # include # include # include +# include /* putenv(), exit(), EXIT_xxx */ +# include /* uintmax_t */ +# include /* printf() */ +# include /* CHAR_BIT, INT_MAX */ +# include /* format spec PRIX64: ll/l + X on 32/64-bit arch */ /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv @@ -16,6 +21,80 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) +/* The following two routines (should) work for integer representation + in either 2's or 1's complement (else it's a compiler bug). */ + +/* Count the bits set in any integer type. + Returns the precision (width - padding bits - sign bit) iff given + the xxx_MAX value of any integer type, signed or unsigned. + From SEI CERT C Coding Standard: + Rules for Developing Safe, Reliable, and Secure Systems (2016) */ +size_t +popcount (num) +uintmax_t num; +{ + size_t cnt = 0; + + while (num != 0) + { + if (num % 2 == 1) + cnt++; + num >>= 1; + } + return cnt; +} +#define PRECISION(max_value) popcount(max_value) +#define SIGN_BIT (1) + +/* Guess the maximum value of a time_t from it's storage width. + ASSERT time_t is not a floating point, or of any arcane width, + or unsigned (i.e. the bit pattern of (-1) treated special). + Only 4...8 byte width of a time_t are tested. + On error: returns (time_t)(-1) */ +time_t +guess_time_t_max () +{ + time_t t0, t1 = (time_t)(-1); + size_t size, prec = 1; + uint64_t u64; + + switch ((size = sizeof(time_t))) + { + case 4: + t0 = (time_t) 0xFFFFFFFF; + break; + case 5: + t0 = (time_t) 0xFFFFFFFFFF; + break; + case 6: + t0 = (time_t) 0xFFFFFFFFFFFF; + break; + case 7: + t0 = (time_t) 0xFFFFFFFFFFFFFF; + break; + case 8: + t0 = (time_t) 0xFFFFFFFFFFFFFFFF; + break; + default: + prec = 0; + break; + } + if (prec) + { + prec = PRECISION(t0) - SIGN_BIT; + t0 = (time_t) 1 << (prec - 1); + t1 = t0|(t0 - 1); + } +#ifdef DEBUG + fprintf (stderr, "time_t_max\t= 0x%"PRIX64"\n", (u64 = t1)); + fprintf (stderr, "sizeof(time_t)\t= %2zd byte\n", size); + fprintf (stderr, "precision\t= %2zd bit\n", prec); + fprintf (stderr, "padding\t\t= %2zd bit\n", size*CHAR_BIT - prec - SIGN_BIT); +#endif /* DEBUG */ + return t1; +} +#undef SIGN_BIT + /* Fail if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static void @@ -37,8 +116,8 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + if (mktime (&tm) == (time_t)(-1)) + exit (EXIT_FAILURE); } static void @@ -47,10 +126,10 @@ { struct tm *lt; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); now = time_t_max - now; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); } static void @@ -67,7 +146,7 @@ tm.tm_isdst = -1; mktime (&tm); if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + exit (EXIT_FAILURE); } static void @@ -82,7 +161,7 @@ alarm (10); now = mktime (&tm); alarm (0); - if (now != (time_t) -1) + if (now != (time_t)(-1)) { struct tm *lt = localtime (&now); if (! (lt @@ -96,7 +175,7 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + exit (EXIT_FAILURE); } } @@ -106,9 +185,10 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; + time_t_max = guess_time_t_max (); + if (time_t_max == (time_t)(-1)) + exit (EXIT_FAILURE); + delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { @@ -120,11 +200,15 @@ mktime_test ((time_t) 60 * 60); mktime_test ((time_t) 60 * 60 * 24); - for (j = 1; 0 < j; j *= 2) + /* NOTE This does not reach very large values > time_t_max/2 + neither the (susceptible for overflow) version + for (j = 1; 0 < j; j *= 2) does */ + for (i = j = 1; i < PRECISION(INT_MAX); i++, j *= 2) bigtime_test (j); bigtime_test (j - 1); } irix_6_4_bug (); spring_forward_gap (); - exit (0); + exit (EXIT_SUCCESS); } +/*! vi: set ai tabstop=8 shiftwidth=2: */ --nextPart5028971.ppSauYnzuk-- From owner-freebsd-hackers@freebsd.org Sun Jan 17 19:03:13 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B64D4D49E5 for ; Sun, 17 Jan 2021 19:03:13 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJkp80yNVz3tLt for ; Sun, 17 Jan 2021 19:03:12 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: by mail-wr1-x42b.google.com with SMTP id 91so14424824wrj.7 for ; Sun, 17 Jan 2021 11:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=qWWuoCgOXdyQohGfEeXeVfAihBJeg8rfK+vwark25Ms=; b=Fjcd41aX4X+dKVJqTMDuOUsGui0AoDEI3Bca5s30NciIIakSLuoVTC6OKJT4AMloAN VN17uya8dlbSvTyPPqvXfsBlDo9iMeue9vZkFFrq4p1CEpGeI5sBc5s21+ecZlrngJGx e8ALyAlpBWT9gaRiL8n7RIWR7PfOOCCBEWCDzSSxM75WRwkY/hoLKZhsRu5E2lY2OtdM Q/ovKEV2yGpIRpzW1IbbFu2K6rkQC61jdzh3tYFs5azbdmBBieUKUqkrY1zAuUUu50UE EBzx8q1X9FhXb0cm1dzmBO3S/wSp2k7ZomuOQLeVY6/rFGfAp7n/z0EIM7ETiNib/4nV 8WcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=qWWuoCgOXdyQohGfEeXeVfAihBJeg8rfK+vwark25Ms=; b=bGUn2e+wg5HNQGjizekdp8bc/8sU50fVsonrfQiTLQTjqF/I/yq1se85lWhPTajh8j M5/LRDYU918tPEs42xdfyUjwYn3SImCbZrjPVimpf9fEZR2vIRaMryd+86eGBC49B3+k AW4AkifbJESXubch+1zYh28GRtHO5xZZc5UlRcm1x5gT47PRHHt5BHvBttOtGO0Neez6 cdjIcFhItb2/BauX1JOYQkgG5ZN3Q10DQHXsJWO+ovjf9o2Xw7RKb3zmQctnDE6+fret K9MOXhlMmSRUwVsEWtUKCkNWGc9oiRI/foedmApNeSciiRZd+1OfCGJSsrah3eW8HCWx XGRA== X-Gm-Message-State: AOAM530xcp0mBkqZNDt5hkoMHGLOnFvHuKqW5GaeGE0jIGQpW9uhqxvu td87Dnaz8l5p+cdpEcdV3r/58/D3mSVpgw== X-Google-Smtp-Source: ABdhPJyP2iKeM0x0gwy9TLDjyFe6SO8qWGIZP3HllhWTpvx8gtV8FZZOFLmFqQsKDHxlbSwgSo7UcA== X-Received: by 2002:a05:6000:1543:: with SMTP id 3mr12765434wry.254.1610910190398; Sun, 17 Jan 2021 11:03:10 -0800 (PST) Received: from [192.168.1.11] (88-105-96-80.dynamic.dsl.as9105.com. [88.105.96.80]) by smtp.gmail.com with ESMTPSA id g5sm25580336wro.60.2021.01.17.11.03.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jan 2021 11:03:09 -0800 (PST) To: freebsd-hackers From: Graham Perrin Subject: panic: vm_fault_hold: fault on nofault entry during live boot of FreeBSD-based helloSystem Message-ID: <9abc6bac-5937-7aa0-0e1c-67967701577d@gmail.com> Date: Sun, 17 Jan 2021 19:03:09 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Rspamd-Queue-Id: 4DJkp80yNVz3tLt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Fjcd41aX; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of grahamperrin@gmail.com designates 2a00:1450:4864:20::42b as permitted sender) smtp.mailfrom=grahamperrin@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RECEIVED_SPAMHAUS_PBL(0.00)[88.105.96.80:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::42b:from]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::42b:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::42b:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 19:03:13 -0000 Hi What, if anything, might people make of the kernel panic pictured at ? Transcript (copy typed): Context, from : > … constructs a r/w Live filesystem tree (e.g., by replicating the system image to swap-based memdisk) … TIA From owner-freebsd-hackers@freebsd.org Sun Jan 17 19:29:14 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1D964D5703 for ; Sun, 17 Jan 2021 19:29:14 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJlNB0jd6z3vWx for ; Sun, 17 Jan 2021 19:29:13 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10HJT4AJ008955 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 17 Jan 2021 19:29:06 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: joel.bertrand@systella.fr Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10HJSu31006353 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 18 Jan 2021 02:28:56 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Mounting swap device on iscsi target To: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= , freebsd-hackers@freebsd.org References: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> <8ab80674-a54f-8720-93b9-8161a590c373@systella.fr> From: Eugene Grosbein Message-ID: Date: Mon, 18 Jan 2021 02:28:49 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8ab80674-a54f-8720-93b9-8161a590c373@systella.fr> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DJlNB0jd6z3vWx X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-1.53 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c2c:26d8::2:from]; NEURAL_SPAM_SHORT(0.57)[0.567]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c2c:26d8::2:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_PERMFAIL(0.00)[empty SPF record]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 19:29:15 -0000 18.01.2021 1:43, BERTRAND Joël wrote: >>> If I have understood, varmfs creates whole /var. I have some troubles >>> with /var/at also. How can I create a file system in memory for /var/run >>> and /var/at ? >> >> Read diskless(8) manual page, section CONFIGURATION. > > I don't understand your answer. I have configured this workstation a > long time ago and I have read this manual page to write its > configuration. My question was : how create two ramdisks, one for > /var/at, the second for /var/run in /etc/rc.conf ? I suppose I can write > a script in /etc/rc.d, but I'm pretty sure somebody use diskless FreeBSD > workstation also. We have /etc/rc.initdiskless script that runs if there is (empty) /etc/diskless file at boot time. In addition to diskless(8) manual page, please read comments at the beginning of /etc/rc.initdiskless, they describe its mechanics in more details. In particular, it tells: # The existence of a directory /conf/T/M causes this script to create a # memory filesystem mounted as /M on the client. So it is able to create as many in-memory file system as you need once you provide diskless machine with correct /conf directory. Use that, it works. From owner-freebsd-hackers@freebsd.org Sun Jan 17 21:26:20 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A2604D8C90 for ; Sun, 17 Jan 2021 21:26:20 +0000 (UTC) (envelope-from "") Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJnzH70L9z4Y1K for ; Sun, 17 Jan 2021 21:26:19 +0000 (UTC) (envelope-from "") Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2B69116005C for ; Sun, 17 Jan 2021 22:26:17 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DJnz52x6mz6tm8; Sun, 17 Jan 2021 22:26:09 +0100 (CET) From: Walter von Entferndt To: Mark Millard Cc: freebsd-hackers@freebsd.org Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) Date: Sun, 17 Jan 2021 22:25:08 +0100 Message-ID: <22093525.sr7ieKrsik@t450s.local.lan> In-Reply-To: References: <1648904.MsCH1bHPGx@t450s.local.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3320458.j5jfTYeP2b" Content-Transfer-Encoding: 7Bit X-Rspamd-Queue-Id: 4DJnzH70L9z4Y1K X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=posteo.net (policy=none); spf=none (mx1.freebsd.org: domain of mout01.posteo.de has no SPF policy when checking 185.67.36.141) smtp.helo=mout01.posteo.de X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; CTE_CASE(0.50)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; HAS_ATTACHMENT(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.141:from]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[yahoo.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers]; DMARC_POLICY_SOFTFAIL(0.10)[posteo.net : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 21:26:20 -0000 This is a multi-part message in MIME format. --nextPart3320458.j5jfTYeP2b Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" My previous naiive attempt silently assumed CHAR_BIT = 8... Isn't that funny? Now this is hopefully my last try to fix the issue, it should be agnostic to any padding and machine word length. It does not cover *time_t* beeing a floating point type, though. Compile witch 'cc -DDEBUG' to get the diagnostics to *stderr* . Regards --- check_mktime.c.patch --- --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-17 22:01:38.157124000 +0100 @@ -3,6 +3,11 @@ # include # include # include +# include /* putenv(), exit(), EXIT_xxx */ +# include /* intmax_t */ +# include /* printf() */ +# include /* CHAR_BIT, INT_MAX */ +# include /* format spec PRIX64: ll/l + X on 32/64-bit arch */ /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv @@ -16,6 +21,74 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) +/* The following two routines (should) work for integer representation + in either 2's or 1's complement and for any #bits per byte. */ + +/* Count the bits set in any integer type. + Returns the precision (width - padding bits - sign bit) iff given + the xxx_MAX value of any integer type, signed or unsigned. + From SEI CERT C Coding Standard: + Rules for Developing Safe, Reliable, and Secure Systems (2016) */ +size_t +popcount (num) +uintmax_t num; +{ + size_t cnt = 0; + + while (num != 0) + { + if (num % 2 == 1) + cnt++; + num >>= 1; + } + return cnt; +} +#define PRECISION(max_value) popcount(max_value) +#define SIGN_BIT (1) +#ifndef MIN +#define MIN(a, b) ((a) < (b)? (a): (b)) +#endif +/* Guess the maximum value of a time_t from it's storage width. + On error: returns (time_t)(-1) iff time_t is longer than an intmax_t. + ASSERTION: time_t is a signed integer type, + i.e. not (unsigned, but the bit pattern of (-1) treated special). */ +time_t +guess_time_t_max () +{ + time_t t0, t1 = (time_t)(-1); + size_t size = sizeof(time_t); + size_t prec; + uintmax_t max; + uint64_t u64; + + if (sizeof(time_t) > sizeof(uintmax_t)) + return t1; + + /* Get an uintmax_t with all bits set that could be in a time_t. + We can not do this calculation with a time_t as long we do not + know its precision (overflow could occur). */ + prec = MIN (PRECISION (UINTMAX_MAX), CHAR_BIT * sizeof(time_t)); + max = (uintmax_t) 1 << (prec - 1); + max = max|(max - 1); + + t0 = max; /* maybe trucation happens here */ + + /* Now account for any padding */ + prec = PRECISION(t0) - SIGN_BIT; + t0 = (time_t) 1 << (prec - 1); + t1 = t0|(t0 - 1); + +#ifdef DEBUG + fprintf (stderr, "time_t_max\t= 0x%"PRIX64"\n", (u64 = t1)); + fprintf (stderr, "sizeof(time_t)\t= %2zd byte\n", size); + fprintf (stderr, "precision\t= %2zd bit\n", prec); + fprintf (stderr, "padding\t\t= %2zd bit\n", CHAR_BIT*size - prec - SIGN_BIT); + fprintf (stderr, "bits per byte\t= %2d bit\n", CHAR_BIT); +#endif /* DEBUG */ + return t1; +} +#undef SIGN_BIT + /* Fail if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static void @@ -37,8 +110,8 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + if (mktime (&tm) == (time_t)(-1)) + exit (EXIT_FAILURE); } static void @@ -47,10 +120,10 @@ { struct tm *lt; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); now = time_t_max - now; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); } static void @@ -67,7 +140,7 @@ tm.tm_isdst = -1; mktime (&tm); if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + exit (EXIT_FAILURE); } static void @@ -82,7 +155,7 @@ alarm (10); now = mktime (&tm); alarm (0); - if (now != (time_t) -1) + if (now != (time_t)(-1)) { struct tm *lt = localtime (&now); if (! (lt @@ -96,7 +169,7 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + exit (EXIT_FAILURE); } } @@ -106,9 +179,10 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; + time_t_max = guess_time_t_max (); + if (time_t_max == (time_t)(-1)) + exit (EXIT_FAILURE); + delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { @@ -120,11 +194,15 @@ mktime_test ((time_t) 60 * 60); mktime_test ((time_t) 60 * 60 * 24); - for (j = 1; 0 < j; j *= 2) + /* NOTE This does not reach very large values > time_t_max/2 + neither the (susceptible for overflow) version + for (j = 1; 0 < j; j *= 2) does */ + for (i = j = 1; i < PRECISION(INT_MAX); i++, j *= 2) bigtime_test (j); bigtime_test (j - 1); } irix_6_4_bug (); spring_forward_gap (); - exit (0); + exit (EXIT_SUCCESS); } +/*! vi: set ai tabstop=8 shiftwidth=2: */ -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss) --nextPart3320458.j5jfTYeP2b Content-Disposition: attachment; filename="check_mktime.c.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="check_mktime.c.patch" --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-17 22:01:38.157124000 +0100 @@ -3,6 +3,11 @@ # include # include # include +# include /* putenv(), exit(), EXIT_xxx */ +# include /* intmax_t */ +# include /* printf() */ +# include /* CHAR_BIT, INT_MAX */ +# include /* format spec PRIX64: ll/l + X on 32/64-bit arch */ /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv @@ -16,6 +21,74 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) +/* The following two routines (should) work for integer representation + in either 2's or 1's complement and for any #bits per byte. */ + +/* Count the bits set in any integer type. + Returns the precision (width - padding bits - sign bit) iff given + the xxx_MAX value of any integer type, signed or unsigned. + From SEI CERT C Coding Standard: + Rules for Developing Safe, Reliable, and Secure Systems (2016) */ +size_t +popcount (num) +uintmax_t num; +{ + size_t cnt = 0; + + while (num != 0) + { + if (num % 2 == 1) + cnt++; + num >>= 1; + } + return cnt; +} +#define PRECISION(max_value) popcount(max_value) +#define SIGN_BIT (1) +#ifndef MIN +#define MIN(a, b) ((a) < (b)? (a): (b)) +#endif +/* Guess the maximum value of a time_t from it's storage width. + On error: returns (time_t)(-1) iff time_t is longer than an intmax_t. + ASSERTION: time_t is a signed integer type, + i.e. not (unsigned, but the bit pattern of (-1) treated special). */ +time_t +guess_time_t_max () +{ + time_t t0, t1 = (time_t)(-1); + size_t size = sizeof(time_t); + size_t prec; + uintmax_t max; + uint64_t u64; + + if (sizeof(time_t) > sizeof(uintmax_t)) + return t1; + + /* Get an uintmax_t with all bits set that could be in a time_t. + We can not do this calculation with a time_t as long we do not + know its precision (overflow could occur). */ + prec = MIN (PRECISION (UINTMAX_MAX), CHAR_BIT * sizeof(time_t)); + max = (uintmax_t) 1 << (prec - 1); + max = max|(max - 1); + + t0 = max; /* maybe trucation happens here */ + + /* Now account for any padding */ + prec = PRECISION(t0) - SIGN_BIT; + t0 = (time_t) 1 << (prec - 1); + t1 = t0|(t0 - 1); + +#ifdef DEBUG + fprintf (stderr, "time_t_max\t= 0x%"PRIX64"\n", (u64 = t1)); + fprintf (stderr, "sizeof(time_t)\t= %2zd byte\n", size); + fprintf (stderr, "precision\t= %2zd bit\n", prec); + fprintf (stderr, "padding\t\t= %2zd bit\n", CHAR_BIT*size - prec - SIGN_BIT); + fprintf (stderr, "bits per byte\t= %2d bit\n", CHAR_BIT); +#endif /* DEBUG */ + return t1; +} +#undef SIGN_BIT + /* Fail if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static void @@ -37,8 +110,8 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + if (mktime (&tm) == (time_t)(-1)) + exit (EXIT_FAILURE); } static void @@ -47,10 +120,10 @@ { struct tm *lt; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); now = time_t_max - now; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); } static void @@ -67,7 +140,7 @@ tm.tm_isdst = -1; mktime (&tm); if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + exit (EXIT_FAILURE); } static void @@ -82,7 +155,7 @@ alarm (10); now = mktime (&tm); alarm (0); - if (now != (time_t) -1) + if (now != (time_t)(-1)) { struct tm *lt = localtime (&now); if (! (lt @@ -96,7 +169,7 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + exit (EXIT_FAILURE); } } @@ -106,9 +179,10 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; + time_t_max = guess_time_t_max (); + if (time_t_max == (time_t)(-1)) + exit (EXIT_FAILURE); + delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { @@ -120,11 +194,15 @@ mktime_test ((time_t) 60 * 60); mktime_test ((time_t) 60 * 60 * 24); - for (j = 1; 0 < j; j *= 2) + /* NOTE This does not reach very large values > time_t_max/2 + neither the (susceptible for overflow) version + for (j = 1; 0 < j; j *= 2) does */ + for (i = j = 1; i < PRECISION(INT_MAX); i++, j *= 2) bigtime_test (j); bigtime_test (j - 1); } irix_6_4_bug (); spring_forward_gap (); - exit (0); + exit (EXIT_SUCCESS); } +/*! vi: set ai tabstop=8 shiftwidth=2: */ --nextPart3320458.j5jfTYeP2b-- From owner-freebsd-hackers@freebsd.org Sun Jan 17 23:31:51 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA5BE4DB40C for ; Sun, 17 Jan 2021 23:31:51 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-21.consmr.mail.gq1.yahoo.com (sonic317-21.consmr.mail.gq1.yahoo.com [98.137.66.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJrm60gmNz4fyw for ; Sun, 17 Jan 2021 23:31:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1610926308; bh=tr6T3mA4HBQgX/393DlRUU9X0VMoNeNR1xAnZ/uHEo6=; h=Subject:From:Date:To:From:Subject:Reply-To; b=cT0LLgt/3QIs7WgqYFzhNouPARiUuVM+rbyoOKkJ66iNm405nx3iwvTAEGEEZjbgm6X95QH0IVFW7P/7TAKqr1os8iKYMSNA2V8GU/JXihz7UV+Edq6FeI/6Mp4D80fVCfFL/rRuLCOYk4fDf4lBIrO4zKc3LqIslMbvJKxTpTuABeAzBp8GKTf/vCQr8c1tEXG+gwmtr//7Lxg/BYjzzApxkSQPpiol40y2H3tJUaHvHtQ6grSQ8FHDGVIgMq6HZ9CqK9DS2971hwdezbWJwVsZTfYpedG3Ger+c5YtbtZlhhVRcSYU9zydVuoMsRI8vi7pCvrFeHDkMT+HcrVV/A== X-YMail-OSG: vXjoArUVM1kBDIhH2eYCBJ_CVtRuqWakwYKuMmqldeAP1SEZRXLWbRMwPVfHlzw 6TE1BjUavE2Dyg9UfS7LxJp8JW0Bq1oHgiEvcnpFO5RFrnYN0h2ju5fHYaz2EX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Bfq8gjQayXhS VFbQ80Pw4gOHS5iflC8UBPp22jCypa0ZeTJEdquI02yRieUviCLGHC19vc8df1h9Q_1eFkNHxO_b 2CjlM_kKB5qbpuQLTyic.YTGE0Jeiu.5QZE3.cL9eNyTnjFs7HCiaNosf99kdufrCe1bN.dFwV6R EnyuBRFaJXE6pX47ECBt6LlwODXV7hnjag2edqbvKqZzotckNY3YCOE9CFVN2fgmbcXbW6sQ4LOA gqZeZoumJSF_vbHwB35j.XHTuOy4iYyWewBEj8rPFWZMkqVPkzg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Sun, 17 Jan 2021 23:31:48 +0000 Received: by smtp416.mail.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ac743ae6d700ef704260789805e88df3; Sun, 17 Jan 2021 23:31:47 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) From: Mark Millard In-Reply-To: <22093525.sr7ieKrsik@t450s.local.lan> Date: Sun, 17 Jan 2021 15:31:46 -0800 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <1648904.MsCH1bHPGx@t450s.local.lan> <22093525.sr7ieKrsik@t450s.local.lan> To: Walter von Entferndt X-Mailer: Apple Mail (2.3654.40.0.2.32) X-Rspamd-Queue-Id: 4DJrm60gmNz4fyw X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.66.147:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.66.147:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.66.147:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.66.147:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 23:31:52 -0000 On 2021-Jan-17, at 13:25, Walter von Entferndt = wrote: > . . . > - for (j =3D 1; 0 < j; j *=3D 2) > + /* NOTE This does not reach very large values > time_t_max/2 > + neither the (susceptible for overflow) version > + for (j =3D 1; 0 < j; j *=3D 2) does */ > + for (i =3D j =3D 1; i < PRECISION(INT_MAX); i++, j *=3D 2) I'm unclear on why INT_MAX here. 32767 <=3D INT_MAX for C (and the LP32 data model), but 2147483647 =3D=3D INT_MAX is common (IPL32, LLP64, LP64). The bigtime_test(j) call has j being 2**(i-1), inventing notation for an exponent. So for the 2 identified cases varying the exponent calls for: 2**(1-1) to 2**(14-1) for 0x7FFF=3D=3DINT_MAX 2**(1-1) to 2**(30-1) for 0x7FFFFFFF=3D=3DINT_MAX > bigtime_test (j); and so for the below bigtime_test(j-1): (2**(15-1))-1 for 0x7FFF=3D=3DINT_MAX (2**(31-1))-1 for 0x7FFFFFFF=3D=3DINT_MAX > bigtime_test (j - 1); The above notes are independent of time_t. I'm also unsure of your intended relationship to time_t in general (if any). For example, for time_t being 64 bits (63 value bits) on powerpc (32-bit and 64-bit) for FreeBSD but 32-bit (31 value bits) for i386 for FreeBSD and 64-bit (63 value bits) for amd64 for FreeBSD. (As I understand, FreeBSD does not claim to support INT_MAX<2147483647 even though C of itself does. FreeBSD is just an example here.) It leaves me to wonder about using something that invovled PRECISION(time_t_max). (Not that I've thought that through enough to claim just what would always be appropriate.) > } > irix_6_4_bug (); > spring_forward_gap (); > - exit (0); > + exit (EXIT_SUCCESS); > } > +/*! vi: set ai tabstop=3D8 shiftwidth=3D2: */ Again, I do not make a claim of having thought every aspect of the code through. The above is just what stood out on a quick read. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-freebsd-hackers@freebsd.org Mon Jan 18 11:47:15 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7218E4E86F6 for ; Mon, 18 Jan 2021 11:47:15 +0000 (UTC) (envelope-from "") Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DK94f3nglz3pJ3 for ; Mon, 18 Jan 2021 11:47:14 +0000 (UTC) (envelope-from "") Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 0698716005C for ; Mon, 18 Jan 2021 12:47:11 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DK94Z4Cydz6tm6; Mon, 18 Jan 2021 12:47:10 +0100 (CET) From: Walter von Entferndt To: Mark Millard Cc: freebsd-hackers@freebsd.org Subject: Re: Implicit assumptions (was: Re: Some fun with -O2) Date: Mon, 18 Jan 2021 12:46:58 +0100 Message-ID: <4907874.QyqR4RcxXA@t450s.local.lan> In-Reply-To: References: <22093525.sr7ieKrsik@t450s.local.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3148181.qzLpRxe9IO" Content-Transfer-Encoding: 7Bit X-Rspamd-Queue-Id: 4DK94f3nglz3pJ3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=posteo.net (policy=none); spf=none (mx1.freebsd.org: domain of mout01.posteo.de has no SPF policy when checking 185.67.36.141) smtp.helo=mout01.posteo.de X-Spamd-Result: default: False [-2.70 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.141:from]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_TO(0.00)[yahoo.com]; R_DKIM_NA(0.00)[]; CTE_CASE(0.50)[]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; MIME_TRACE(0.00)[0:+,1:+,2:+]; MAILMAN_DEST(0.00)[freebsd-hackers]; DMARC_POLICY_SOFTFAIL(0.10)[posteo.net : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 11:47:15 -0000 This is a multi-part message in MIME format. --nextPart3148181.qzLpRxe9IO Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Now to test the above solution (and out of curiosity), I tried it with *time_t* changed to *signed char* in /guess_time_t_max()/ and it gave: DEBUG: prec(signed_char) = 8 schar_t_max = 0xFFFFFFFFFFFFFFFF sizeof(schar_t) = 1 byte precision = 63 bit padding = -56 bit bits per byte = 8 bit Exitcode 1 which is from the check I added at the start of /main()/ (0xFF = -1, anyway it would fall into an endless loop because the delta gets =0 then), while with *signed int* instead of *time_t* it gives: DEBUG: prec(signed int) = 32 xxx_t_max = 0x7FFFFFFF sizeof(xxx_t) = 4 byte precision = 63 bit padding = -32 bit bits per byte = 8 bit and the program runs ok (I have set /printexitvalue/ in my tcsh). It does not concern me that the program fails if *sizeof(time_t)* = 1, but I didn't expect these other curiosities. Now I went back to a simple switch-on-storage-width, that I believe will cover most (all?) cases except when *time_t* is a floating point. Rationale: the standard says *time_t* is either a floating point or integer type, and from that I conclude it's equivalent to one of the standard types. I tested with time_t faked beeing 1 (char), 2 (short), 4 (int) and 8 (standard on my 64-bit Intel). Of course with a 1-byte *time_t* it falls into the endless loop as expected. At Montag, 18. Januar 2021, 00:31:46 CET, Mark Millard wrote: > On 2021-Jan-17, at 13:25, Walter von Entferndt wrote: > > . . . > > - for (j = 1; 0 < j; j *= 2) > > + /* NOTE This does not reach very large values > time_t_max/2 > > + neither the (susceptible for overflow) version > > + for (j = 1; 0 < j; j *= 2) does */ > > + for (i = j = 1; i < PRECISION(INT_MAX); i++, j *= 2) > > I'm unclear on why INT_MAX here. > Because i and j are *int* s. My intent was to avoid sign overflow, which can happen silently (j *= 2), but the standard says it's undefined, and that was the starting point of this thread. The genuine version relies on silent overflow, which is sub-optimal. The above version is (intentionally) not equivalent to the genuine one. Instead this would do what the author intended (from my understanding), but without any chance for overflow: for (i = 0; i < PRECISION (INT_MAX); i++) { j = (int) 1 << i; bigtime_test (j); } bigtime_test (INT_MAX); } The point is that on sign overflow j switches to INT_MIN, and the author expects the difference INT_MIN - 1 = INT_MAX, which is reasonable, but mathematically bogus, as well as j *= 2 will mathematically always be >0 as long you start with a positive value. And today's clever optimizing compilers do what you write, not what you intend; e.g. produce an endless loop when you write an expression that it can prove to be always true as the loop condition. > It leaves me to wonder about using something that > invovled PRECISION(time_t_max). > You can't do that as long you don't know if it's really the maximum value. In the code above (i < PRECISION (INT_MAX)): to account for any padding bits. To be portable. > > +/*! vi: set ai tabstop=8 shiftwidth=2: */ When fixing code, I think it's polite to adopt the genuine formating. Since in this case it's rather unusual, I'm telling my editor to use sw=2 (I use 4). -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss) --nextPart3148181.qzLpRxe9IO Content-Disposition: attachment; filename="check_mktime.c.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="check_mktime.c.patch" --- check_mktime.c.orig 2021-01-15 03:19:33.962253000 +0100 +++ check_mktime.c 2021-01-18 12:33:10.068968000 +0100 @@ -3,6 +3,11 @@ # include # include # include +# include /* putenv(), exit(), EXIT_xxx */ +# include /* intmax_t */ +# include /* printf() */ +# include /* CHAR_BIT, xxx_MAX */ +# include /* format spec PRIX64: ll/l + X on 32/64-bit arch */ /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv @@ -16,6 +21,97 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) +/* The following two routines (should) work for any integer representation + in either 2's or 1's complement and for any #bits per byte. */ + +/* Count the bits set in any unsigned integer type. + Returns the precision (width - padding bits - sign bit) iff given + the xxx_MAX value of any integer type, signed or unsigned. + From SEI CERT C Coding Standard: + Rules for Developing Safe, Reliable, and Secure Systems (2016) */ +size_t +popcount (num) +uintmax_t num; +{ + size_t cnt = 0; + + while (num != 0) + { + if (num % 2 == 1) + cnt++; + num >>= 1; + } + return cnt; +} +#define PRECISION(max_value) popcount(max_value) +#define SIGN_BIT (1) + +/* Get the maximum value of a signed integer type from it's storage width. + Parameters: + size_t size: storage width in bytes as given by the sizeof operator. + On error: + Returns (intmax_t)(-1) iff xxxint_t is longer than an intmax_t. + ASSERTIONS the type is equivalent to one of the C standard integer types. + I.e. if it's 6 bytes wide, but no standard type is 6 bytes, we're out. + NOTE the maximum of any unsigned integer type can be derived by + umax = (-max) - 1 on 2's-complement machines; on 1's-complement it's simply + simply umax = -max. Test for 1's complement: (-1)|1 == (-0) */ +intmax_t +get_xxxint_t_max (size) +size_t size; +{ + size_t prec = 0; + intmax_t max = (intmax_t)(-1); + + if (size > sizeof(intmax_t)) + prec = 0; + else if (size == sizeof(intmax_t)) + { + prec = PRECISION (INTMAX_MAX); + max = (intmax_t) INTMAX_MAX; + } +#ifdef __LONG_LONG_SUPPORTED + else if (size == sizeof(long long)) + { + prec = PRECISION (LLONG_MAX); + max = (intmax_t) LLONG_MAX; + } +#endif /* __LONG_LONG_SUPPORTED */ + else if (size == sizeof(long)) + { + prec = PRECISION (LONG_MAX); + max= (intmax_t) LONG_MAX; + } + else if (size == sizeof(int)) + { + prec = PRECISION (INT_MAX); + max = (intmax_t) INT_MAX; + } + else if (size == sizeof(short)) + { + prec = PRECISION (SHRT_MAX); + max = (intmax_t) SHRT_MAX; + } + else if (size == sizeof(signed char)) + { + prec = PRECISION (SCHAR_MAX); + max = (intmax_t) SCHAR_MAX; + } + else + /* out of options... */ + prec = 0; + +#ifdef DEBUG + fprintf (stderr, "xxx_t_max\t= 0x%"PRIX64"\n", (uint64_t) max); + fprintf (stderr, "sizeof(xxx_t)\t= %3zd byte\n", size); + fprintf (stderr, "precision\t= %3zd bit\n", prec); + fprintf (stderr, "padding\t\t= %3zd bit\n", CHAR_BIT*size - prec - SIGN_BIT); + fprintf (stderr, "bits per byte\t= %3d bit\n", CHAR_BIT); +#endif /* DEBUG */ + return max; +} +#undef SIGN_BIT + /* Fail if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static void @@ -37,8 +133,8 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + if (mktime (&tm) == (time_t)(-1)) + exit (EXIT_FAILURE); } static void @@ -47,10 +143,10 @@ { struct tm *lt; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); now = time_t_max - now; if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + exit (EXIT_FAILURE); } static void @@ -67,7 +163,7 @@ tm.tm_isdst = -1; mktime (&tm); if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + exit (EXIT_FAILURE); } static void @@ -82,7 +178,7 @@ alarm (10); now = mktime (&tm); alarm (0); - if (now != (time_t) -1) + if (now != (time_t)(-1)) { struct tm *lt = localtime (&now); if (! (lt @@ -96,7 +192,7 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + exit (EXIT_FAILURE); } } @@ -106,9 +202,10 @@ time_t t, delta; int i, j; - for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2) - continue; - time_t_max--; + time_t_max = get_xxxint_t_max (sizeof (time_t_max)); + if (time_t_max == (time_t)(-1)) + exit (EXIT_FAILURE); + delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { @@ -120,11 +217,16 @@ mktime_test ((time_t) 60 * 60); mktime_test ((time_t) 60 * 60 * 24); - for (j = 1; 0 < j; j *= 2) - bigtime_test (j); - bigtime_test (j - 1); + for (i = 0; i < PRECISION (INT_MAX); i++) + { + j = (int) 1 << i; + bigtime_test (j); + } + j = INT_MAX; + bigtime_test (j); } irix_6_4_bug (); spring_forward_gap (); - exit (0); + exit (EXIT_SUCCESS); } +/*! vi: set ai tabstop=8 shiftwidth=2: */ --nextPart3148181.qzLpRxe9IO-- From owner-freebsd-hackers@freebsd.org Mon Jan 18 13:02:27 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C525B4EB069 for ; Mon, 18 Jan 2021 13:02:27 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DKBlQ6J1qz3tTN for ; Mon, 18 Jan 2021 13:02:26 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10ID2EqL019012 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 18 Jan 2021 13:02:16 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: joel.bertrand@systella.fr Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10ID27A3020762 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 18 Jan 2021 20:02:07 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: Mounting swap device on iscsi target To: =?UTF-8?Q?BERTRAND_Jo=c3=abl?= References: <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> <8ab80674-a54f-8720-93b9-8161a590c373@systella.fr> From: Eugene Grosbein Cc: Freebsd hackers list Message-ID: Date: Mon, 18 Jan 2021 20:01:59 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.0 SPF_PASS SPF: sender matches SPF record * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * 2.6 LOCAL_FROM From my domains * -0.3 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DKBlQ6J1qz3tTN X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.10 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:c2c:26d8::2:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; SPAMHAUS_ZRD(0.00)[2a01:4f8:c2c:26d8::2:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; R_SPF_PERMFAIL(0.00)[empty SPF record]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 13:02:27 -0000 18.01.2021 15:36, BERTRAND Joël wrote: >>>>> If I have understood, varmfs creates whole /var. I have some troubles >>>>> with /var/at also. How can I create a file system in memory for /var/run >>>>> and /var/at ? >>>> >>>> Read diskless(8) manual page, section CONFIGURATION. >>> >>> I don't understand your answer. I have configured this workstation a >>> long time ago and I have read this manual page to write its >>> configuration. My question was : how create two ramdisks, one for >>> /var/at, the second for /var/run in /etc/rc.conf ? I suppose I can write >>> a script in /etc/rc.d, but I'm pretty sure somebody use diskless FreeBSD >>> workstation also. >> >> We have /etc/rc.initdiskless script that runs if there is (empty) /etc/diskless file at boot time. >> In addition to diskless(8) manual page, please read comments at the beginning of /etc/rc.initdiskless, >> they describe its mechanics in more details. In particular, it tells: >> >> # The existence of a directory /conf/T/M causes this script to create a >> # memory filesystem mounted as /M on the client. >> >> So it is able to create as many in-memory file system as you need >> once you provide diskless machine with correct /conf directory. >> >> Use that, it works. > > I have read documentation and I have a simple question. If I create > /conf/default/at, I understand this script will create a memory disk > mounted in /at. > > I want to create, for example, /var/at. If I understand, > /conf/default/at.cpio.gz is required also. > > But how can I mount this filesystem on /var/at ? Is > /config/default/at/diskless_remount (that contains /var/at) enough ? There are several options. You can follow an example in comments about "generic diskless fstab" and just add single line for /var/at to /conf/default/etc/fstab, it's handy if you are fine with empty file system. Or you can create /at and have a symlink /var/at -> /at, it should work, too. This way you will be able to populate the directory with template contents and/or template override. From owner-freebsd-hackers@freebsd.org Mon Jan 18 14:55:04 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 179184ED9F4 for ; Mon, 18 Jan 2021 14:55:04 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DKFFM1HnQz4X28 for ; Mon, 18 Jan 2021 14:55:02 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 10IEst1i062371; Mon, 18 Jan 2021 06:54:55 -0800 (PST) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 10IEstwl062370; Mon, 18 Jan 2021 06:54:55 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202101181454.10IEstwl062370@gndrsh.dnsmgr.net> Subject: Re: Mounting swap device on iscsi target In-Reply-To: To: =?UTF-8?Q?BERTRAND_Jo=C3=ABl?= Date: Mon, 18 Jan 2021 06:54:55 -0800 (PST) CC: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4DKFFM1HnQz4X28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[69.59.192.140:from]; AUTH_NA(1.00)[]; SPAMHAUS_ZRD(0.00)[69.59.192.140:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 14:55:04 -0000 > Hello, > > I'm trying to mount iSCSI swap device during boot process. Of course, I > have checked that configuration doesn't contains errors. > > On running system, if I start /etc/rc.d/iscsictl start, device is > mounted without error. But not during boot, I obtains : > > Jan 17 10:48:17 pythagore iscsid[1009]: cannot open or create pidfile > "/var/run/iscsid.pid": Operation not supported Looks like a startup sequence problem, it could be that / is still mounted readonly, but I do not see how that happens, as /etc/rc.d/iscsid should be pretty late in the startup phase. Are you trying to run with a readonly root filesystem? Since you dont really need iscsid until you go to mount additional file systems maybe it can be moved to a later start up phase. Argh, you trying to swap to it, hum, that is going to be a "new file system" and would need iscsid to setup the connection. What does "services -e" show for a startup sequence. What does your /etc/fstab look like. > Jan 17 10:48:17 pythagore root[1010]: /etc/rc: WARNING: failed to start > iscsid > Jan 17 10:48:28 pythagore root[1014]: /etc/rc: WARNING: failed to start > iscsictl > Jan 17 10:49:20 pythagore kernel: WARNING: 192.168.10.128 > (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting > for iscsid(8) for 61 seconds; reconnecting > Jan 17 10:50:23 pythagore kernel: WARNING: 192.168.10.128 > (iqn.2020-02.fr.systella.legendre.istgt:pythagore): timed out waiting > for iscsid(8) for 61 seconds; reconnecting > > This workstation doesn't have any hard disk : > > root@pythagore:/var/log # df -h > Filesystem Size Used Avail Capacity Mounted on > 192.168.10.128:/srv/pythagore 523G 221G 276G 44% / > devfs 1.0K 1.0K 0B 100% /dev > procfs 4.0K 4.0K 0B 100% /proc > fdescfs 1.0K 1.0K 0B 100% /dev/fd > 192.168.10.128:/home 3.6T 2.4T 1.0T 71% /home > > After boot, /var/run/iscsid.pid is created but doesn't contains > anything. If I start by hands iscsid and iscsictl, this file contains > real PID of iscsid and target is connected as da0. Thats odd, how did it get created if the open failed. Can you stop iscsid/iscsictl, rm /var/run/iscsid.pid and do a reboot, see if it comes back do not start anything manually I want to know if an empty file really is being created during boot? > > For information, rc.conf contains : > > iscsid_enable="YES" > iscsictl_enable="YES" > iscsictl_flags="-Aa -w 10" What is in your /etc/iscsictl.conf file, your asking for All sessions in it to be added here, I am assuming that is /home? > Best regards, > JKB -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Mon Jan 18 18:11:52 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA7F94F2590 for ; Mon, 18 Jan 2021 18:11:52 +0000 (UTC) (envelope-from anrxc@sysphere.org) Received: from mail.sysphere.org (sysphere.org [216.18.171.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4DKKcR6F9bz4n4N for ; Mon, 18 Jan 2021 18:11:51 +0000 (UTC) (envelope-from anrxc@sysphere.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sysphere.org (Postfix) with ESMTP id 4695A61CE4 for ; Mon, 18 Jan 2021 19:11:46 +0100 (CET) Date: Mon, 18 Jan 2021 19:11:46 +0100 From: "Adrian C." To: freebsd-hackers@freebsd.org Subject: pkg signing with an agent Message-ID: User-Agent: Alpine 2.11 (LNX 23 2013-08-11) Organization: sysphere dot org X-GPG-PUBLIC-KEY: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD20A0618 X-GPG-FINGERPRINT: 02A5 628A D8EE 2A93 996E 929F D5CB 31B7 D20A 0618 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Rspamd-Queue-Id: 4DKKcR6F9bz4n4N X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of anrxc@sysphere.org has no SPF policy when checking 216.18.171.198) smtp.mailfrom=anrxc@sysphere.org X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[216.18.171.198:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; HAS_ORG_HEADER(0.00)[]; SPAMHAUS_ZRD(0.00)[216.18.171.198:from:127.0.2.255]; DMARC_NA(0.00)[sysphere.org]; NEURAL_HAM_SHORT(-1.00)[-0.997]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:29789, ipnet:216.18.160.0/19, country:US]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 18:11:52 -0000 Hello. I made a tool to do pkg signing with an (ssh/gpg) agent. If this has already been done and it's common knowledge I apologize for the noise and you can ignore the rest. I couldn't find anything on search engines. It's a python tool and uses py37-paramiko (readily available as a package or port) for the agent protocol. Unfortunately a small patch was required to add RSA sign flags support, I don't know if they will accept the feature request. If anyone on the python team has any influence with them and could impart on them its usefulness I would be grateful. If you want the tool: http://git.sysphere.org/freebsd-pkgsign/plain/pkgsign If you want a tutorial: http://sysphere.org/~anrxc/j/archives/2021/01/16/freebsd_pkg_signing_with_an_agent/index.html Thanks. From owner-freebsd-hackers@freebsd.org Tue Jan 19 03:08:28 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC7E44E136A for ; Tue, 19 Jan 2021 03:08:28 +0000 (UTC) (envelope-from bapt@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 4DKYWc5Y9Pz3vyk; Tue, 19 Jan 2021 03:08:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 9882326AE9; Tue, 19 Jan 2021 03:08:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 579D3E9CAA; Tue, 19 Jan 2021 04:07:56 +0100 (CET) Date: Tue, 19 Jan 2021 04:07:56 +0100 From: Baptiste Daroussin To: "Adrian C." Cc: freebsd-hackers@freebsd.org Subject: Re: pkg signing with an agent Message-ID: <20210119030756.xfibegagyeer6dwq@ivaldir.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hazzojaemo76agfb" Content-Disposition: inline In-Reply-To: X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2021 03:08:28 -0000 --hazzojaemo76agfb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 18, 2021 at 07:11:46PM +0100, Adrian C. wrote: > Hello. I made a tool to do pkg signing with an (ssh/gpg) agent. >=20 > If this has already been done and it's common knowledge I apologize for t= he > noise and you can ignore the rest. I couldn't find anything on search > engines. >=20 >=20 > It's a python tool and uses py37-paramiko (readily available as a package= or > port) for the agent protocol. Unfortunately a small patch was required to > add RSA sign flags support, I don't know if they will accept the feature > request. If anyone on the python team has any influence with them and cou= ld > impart on them its usefulness I would be grateful. >=20 > If you want the tool: > http://git.sysphere.org/freebsd-pkgsign/plain/pkgsign >=20 > If you want a tutorial: > http://sysphere.org/~anrxc/j/archives/2021/01/16/freebsd_pkg_signing_with= _an_agent/index.html >=20 >=20 This is really cool! Thank you for sharing! Best regards, Bapt --hazzojaemo76agfb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmAGTQkACgkQY4mL3PG3 Plo0LA//TUfC1XdMNT7s8PoBLPRQVt0KGND0GLKu7pS/WqFWl63AHVDDaRJBjEoA 9aWvldL978ywulh4kB6kpaknMINX3vNk6R1yVHVmxKeHUj18Ck41odca7wohdlvf aMCuBuGJaegwlV3SQ1ypOsEcLYO5DR0n/Y1rqyMZ2XM+Eft5TGZVG16t5ous4bl/ SPRlAR8G5kqYDhBPus7gzSPqeunN1BjrqHahuuthwKOARUUhLt0KTqAU7rtEDCuq cHuGoupAsuQZYTne9vlPINiNjF7CPzZ4xktayUcsQRfSDPosPfikL2pmC2V1pEXC K0jb0Q5/8RftUmqe3imaNMAJ3vFYlUahwm4Q53ERMYG7JjWBGa3RosWZqx805BGZ gmOSuSkenx+qdnpIeAprG1gfkNIShdLEb2pmAtili1yF5xro/SiycS1dYasG0rVt 1us6SBIIeLBdKZT2UHPXyauDo0UYNNkVN6/tKwqvNtprZg6XzbQ24YSk3GDLhSKr WIDMw7uxT7DLDiZ2+wruqllLSgZVz2+9lDCC9UWFji4Jv74AiFFoFveCha20xn+o nImLDtmSwFtQCDBRC1CNG1f+/BJqmReVc8FcDpct0YLAHH1EAjwrkK4z7J8L9ybX 2kVaeR2Xg5uj1dOi+Lqqii/RlQmbt7x+CvyjqN12VUp20cqdSqA= =k610 -----END PGP SIGNATURE----- --hazzojaemo76agfb-- From owner-freebsd-hackers@freebsd.org Thu Jan 21 20:14:32 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E0324DE746 for ; Thu, 21 Jan 2021 20:14:32 +0000 (UTC) (envelope-from sega01@go-beyond.org) Received: from haggis.mythic-beasts.com (haggis.mythic-beasts.com [IPv6:2a00:1098:0:86:1000:0:2:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DMDBZ6L1Tz4rcp for ; Thu, 21 Jan 2021 20:14:30 +0000 (UTC) (envelope-from sega01@go-beyond.org) Received: from [174.126.29.109] (port=63628 helo=localhost) by haggis.mythic-beasts.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1l2gLb-0005An-Ii for freebsd-hackers@freebsd.org; Thu, 21 Jan 2021 20:14:28 +0000 Date: Thu, 21 Jan 2021 20:14:22 +0000 From: Teran McKinney To: freebsd-hackers@freebsd.org Subject: FreeBSD 12.1-RELEASE DVD boots on Thinkpads, 12.2-RELEASE DVD does not Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BlackCat-Spam-Score: 4 X-Spam-Status: No, score=0.4 X-Rspamd-Queue-Id: 4DMDBZ6L1Tz4rcp X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sega01@go-beyond.org designates 2a00:1098:0:86:1000:0:2:1 as permitted sender) smtp.mailfrom=sega01@go-beyond.org X-Spamd-Result: default: False [-1.04 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1098:0:86:1000:0:2:1:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1098::86:1000:0:2:1]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[go-beyond.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2a00:1098:0:86:1000:0:2:1:from:127.0.2.255]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_SPAM_SHORT(0.96)[0.964]; RCVD_IN_DNSWL_MED(-0.20)[2a00:1098:0:86:1000:0:2:1:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:44684, ipnet:2a00:1098::/32, country:GB]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-hackers] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 20:14:32 -0000 Hey everyone, I was wondering if you had any thoughts on my bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250999 12.1 ISO boots as DVD or a USB flash drive on my Thinkpads and my Dell T5400 desktop. 12.2 ISO boots as USB flash drive on my Thinkpads and my Dell T5400 desktop. The desktop can boot it as a DVD as well. However, the Thinkpads cannot boot it fully, and get that Lua bootloader error. A bug report was mentioned in the ticket, mostly in Russian, with a similar problem and some commits referenced. Do you have any suggestions on how I might be able to track this down? Thank you, Teran