From owner-freebsd-bugs@freebsd.org Tue Jun 23 14:14:03 2020 Return-Path: Delivered-To: freebsd-bugs@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 73443356227 for ; Tue, 23 Jun 2020 14:14:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 49rpDW2VTkz4ZtL for ; Tue, 23 Jun 2020 14:14:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 53FE335657F; Tue, 23 Jun 2020 14:14:03 +0000 (UTC) Delivered-To: bugs@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 53C5A35640A for ; Tue, 23 Jun 2020 14:14:03 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49rpDW1ZMtz4b4p for ; Tue, 23 Jun 2020 14:14:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 1729021BC1 for ; Tue, 23 Jun 2020 14:14:03 +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 05NEE2qr064946 for ; Tue, 23 Jun 2020 14:14:02 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05NEE20L064945 for bugs@FreeBSD.org; Tue, 23 Jun 2020 14:14:02 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: bugs@FreeBSD.org Subject: [Bug 247494] sort(1) order affected by LC_CTYPE Date: Tue, 23 Jun 2020 14:14:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.1-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: cem@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@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 MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 14:14:03 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247494 --- Comment #1 from Conrad Meyer --- On CURRENT: $ LC_CTYPE=3Dja_JP.UTF-8 LC_COLLATE=3DC LANG=3DC locale LANG=3DC LC_CTYPE=3Dja_JP.UTF-8 LC_COLLATE=3D"C" LC_TIME=3D"C" LC_NUMERIC=3D"C" LC_MONETARY=3D"C" LC_MESSAGES=3D"C" LC_ALL=3D sort(1) attempts to identify situations where it can run in fast, byte-comp= are only mode by looking only at LC_COLLATE. The --debug option shows more information: $ (echo =E8=80=B3 ; echo =E8=84=B3 ; echo =E8=80=B3) | LC_CTYPE=3Dja_JP.UTF= -8 LC_COLLATE=3DC LANG=3DC sort --debug Memory to be used for sorting: 17100230656 Using collate rules of C locale Byte sort is used sort_method=3Dradixsort ; offset=3D1 ; k1=3D<=E8=80=B3>(1), k2=3D<=E8=84=B3>(1); offset=3D1; s1=3D<=E8=80=B3>, s= 2=3D<=E8=84=B3>; cmp1=3D0 ; offset=3D1 ; k1=3D<=E8=84=B3>(1), k2=3D<=E8=80=B3>(1); offset=3D1; s1=3D<=E8=84=B3>, s= 2=3D<=E8=80=B3>; cmp1=3D0 =E8=80=B3 =E8=84=B3 =E8=80=B3 Both compares seem wrong. The UTF-8 sequences share only the first byte, 0= xe8. In LC_CTYPE=3DC mode: ; offset=3D1 ; k1=3D<=E8=80=B3>(3), k2=3D<=E8=84=B3>(3); offset=3D1; s1=3D<=E8=80=B3>, s= 2=3D<=E8=84=B3>; cmp1=3D-4 ; offset=3D1 ; k1=3D<=E8=84=B3>(3), k2=3D<=E8=80=B3>(3); offset=3D1; s1=3D<=E8=84=B3>, s= 2=3D<=E8=80=B3>; cmp1=3D4 ; offset=3D1 ; k1=3D<=E8=80=B3>(3), k2=3D<=E8=80=B3>(3); offset=3D1; s1=3D<=E8=80=B3>, s= 2=3D<=E8=80=B3>; cmp1=3D0 =E8=80=B3 =E8=80=B3 =E8=84=B3 The comparisons look correct. I will look a little more. I think this is a bug, not design, but I am not sure yet. --=20 You are receiving this mail because: You are the assignee for the bug.=