From owner-freebsd-bugs@freebsd.org Tue Jun 23 15:40:09 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 47C4A330982 for ; Tue, 23 Jun 2020 15:40:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49rr7s1GbLz3SqS for ; Tue, 23 Jun 2020 15:40:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 29CBB330980; Tue, 23 Jun 2020 15:40:09 +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 2993D33072D for ; Tue, 23 Jun 2020 15:40:09 +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 49rr7s0NG1z3STb for ; Tue, 23 Jun 2020 15:40:09 +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 041F5229D4 for ; Tue, 23 Jun 2020 15:40:09 +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 05NFe8eW051622 for ; Tue, 23 Jun 2020 15:40:08 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 05NFe8ut051621 for bugs@FreeBSD.org; Tue, 23 Jun 2020 15:40:08 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 15:40:09 +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 15:40:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247494 --- Comment #5 from Conrad Meyer --- Hm we actually do bucket same-byte values in add_to_sublevel. Why do we ca= ll strcmp eventually? ah: 379 default: 380 if (TINY_NODE(sl) || (sl->level > 15)) { 381 listcoll_t func; 382 383 func =3D get_list_call_func(sl->level); ( =3D=3D list_coll_offset(,, sl->level)) ... 385 sl->leaves =3D sl->tosort; 386 sl->leaves_num =3D sl->tosort_num; 387 sl->leaves_sz =3D sl->leaves_num; ... 403 DEFAULT_SORT_FUNC_RADIXSORT(sl->leave= s, sl->leaves_num, 404 sizeof(struct sort_list_item *), 405 (int(*)(const void *, const void = *)) func); This appears to be a fast path when sorting a relatively small number of strings (< 65), or a degenerate case for comparing string bytes beyond 15 bytes. When I input 100 1-wchar strings to radixsort, it attempts to radix sort, b= ut does so incorrectly. So there are several bugs: 1. radixsort does not process wchar strings correctly. 2. radixsort's fastpath does not invoke collate correctly for wchar strings. --=20 You are receiving this mail because: You are the assignee for the bug.=