From nobody Sun Dec 10 05:37:07 2023 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SnttC72Cbz537yZ for ; Sun, 10 Dec 2023 05:37:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SnttC5CRQz3SSm for ; Sun, 10 Dec 2023 05:37:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702186627; a=rsa-sha256; cv=none; b=Ort9fNNl+SQYGlYQzYB+oa3ue0/rmqaRCDbyLpUt4yU48I+4y8/JU8PRH6ztpk35g2g40B bQpasbjm6nXhRWtlQcxx5+mDDQ5HPNsWHBdnw3g3sRkMgUkg3FoU6VZit4zLQjwrkuQYiG ewWiSBzZvkc2jwCYJ8JO2ti8J6qXOw8wm9VH7DLJyalevRNfM9jf0tKaQ95GdJx1VN8y3v dhGqsM7Lmw0s4bC2AjlCMug7Hddxny23FOQIJFmYlPvVlReRr/qCgkkp/EdhA6xDoJn2I+ 3IsLoD1gWjIiO0Vq1MneIcI6MhQhLhZv2Al30o7cZnz8zQ5WKuYjKB0wGL82yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702186627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0meazOu6TqON6WJl0bTNtlnoBx1nXz6wlncxjZADQac=; b=MQKw1ahDZ1w3aMMx64M+M/JZnA+9VBd1gTzhILWwG3SgYlKQnvmf5BAyx2/PhNaGnmHs+r 4QBHVX0C0S8IfMsnIY+OYta5F4h5FQpcv6triESYUxR0PvcK4i9tuCRfLFUh21/hqrgh27 UkeWHpFpM6s8RIMbnwwaEJnKP1QMf7rOKEHZNLFYXIzwedohdrrdByqQdf3dV2gCLfrd+Q tF6LzE9Lwgmj7q6KpehD5azE7LYIiDQmqXCICAN8u8rd/4lio5EYbOoM+GhQnbCIMXvQ0m 55eydKHBZ/VDr0KAkRFZ5GL4ek7l0hW5V09NAYZCRYnJo6Q+aU4OhxrgSnpKDA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SnttC4BGRzbWH for ; Sun, 10 Dec 2023 05:37:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3BA5b76m096703 for ; Sun, 10 Dec 2023 05:37:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3BA5b7VW096701 for standards@FreeBSD.org; Sun, 10 Dec 2023 05:37:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 275661] /usr/bin/dc hangs with a trivial calculation Date: Sun, 10 Dec 2023 05:37:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dclarke@blastwave.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275661 --- Comment #2 from Dennis Clarke --- (In reply to Mark Millard from comment #1) Excellent ! Thank you. I knew it was from Scientific American but clearly not Martin Gardner. Also, it seems that dc is not hung or strangely locked up. It is just very very very slow. Also it gets slower and slower depending on the exponent in this trivial computation :=20 (1) firstly I need something that will kick out the current UNIX time along with the subseconds : https://git.sr.ht/~blastwave/bw/tree/bw/item/time_and_date/timenow/tn.c pluto$ cc -std=3Diso9899:1999 -g -O0 -m64 -o $HOME/bin/tn /opt/bulk/users/dclarke/tn.c pluto$ $HOME/bin/tn 1702150944 pluto$ bin/tn -f 1702150948.185400780 I can generally trust that time data down to the millisecond but no further. (2) try that same computation with an exponent of 2^21 : pluto$ bin/tn -f ; echo "16k 1.0000001 2 21^ ^ pq" | dc ; bin/tn -f 1702150982.359058318 1.2333267455406059 1702151041.388274513 pluto$ echo '16k 1702151041.388274513 1702150982.359058318 - pq' | dc 59.029216195 (3) same thing again with 2^22 : pluto$ bin/tn -f ; echo "16k 1.0000001 2 22^ ^ pq" | dc ; bin/tn -f 1702151116.511391274 1.5210948612657825 1702151292.913553255 pluto$ echo '16k 1702151292.913553255 1702151116.511391274 - pq' | dc 176.402161981 (4) and now 2^23 pluto$ bin/tn -f ; echo "16k 1.0000001 2 23^ ^ pq" | dc ; bin/tn -f 1702151370.327805625 2.3137295769691702 1702151899.256797300 pluto$ echo '16k 1702151899.256797300 1702151370.327805625 - pq' | dc 528.928991675 (5) things are really getting slow with 2^24 pluto$ bin/tn -f ; echo "16k 1.0000001 2 24^ ^ pq" | dc ; bin/tn -f 1702152105.644851540 5.3533445553419354 1702153691.392552070 pluto$ echo '16k 1702153691.392552070 1702152105.644851540 - pq' | dc 1585.747700530 (6) again with 2^25 pluto$ bin/tn -f ; echo "16k 1.0000001 2 25^ ^ pq" | dc ; bin/tn -f 1702154005.973187537 28.6582979282091444 1702158766.756840716 pluto$=20=20 pluto$ echo '16k 1702158766.756840716 1702154005.973187537 - pq' | dc 4760.783653179 It looks like a factor of three increase in time required with each test. The test for 2^26 is still running and I expect 5 hours or so will be needed and that means the computation with 2^27 may be about 16 hours or so. Dennis --=20 You are receiving this mail because: You are the assignee for the bug.=