Public bug reported:

uutils comm reports that input data is not sorted despite it being
sorted using uutils sort.


When using GNU coreutils, the correct results are produced. 

You will find a simple test script below which demonstrates the problem
with trivial data.

*However*, there seem to be additional problems in uutils with either
comm or sort when used with non-trivial data, but I have not been able
to find a pattern to it yet. The result of this is that comm produces
incorrect output, not just spurious error messages. I don't know if this
is the product of bugs in sort or of bugs in comm. The example below
however shows that there is some sort of problem.

Also note that the sorted output from uutils sort is in a different
order from the sorted output from GNU core-utils. This has a high chance
of causing errors if used on stored data which was sorted before an
upgrade. uutils sort needs to preserve the same sorting order as the GNU
version it is trying to replace.

I use sort with comm extensively, and I have been trying to solve this
for now by editing my scripts to call the gnu versions explicitly as
otherwise lots of things are non-functional due to the above mentioned
non-trivial data.

I suspect that a lot of people will be forced to do the same, in which
case this will cause further problems down the road if GNU core-utils
are not available in a future version if not fixed quickly.


#!/bin/sh

# Tested with 
#sort --version
#sort (uutils coreutils) 0.10.0
#comm --version
#comm (uutils coreutils) 0.10.0


# Sort with uutils.
echo a A b B | tr ' ' '\n' | sort > tst1.txt
echo a A b C | tr ' ' '\n' | sort > tst2.txt

echo "uutils sort 1"
cat tst1.txt
echo
echo "uutils sort 2"
cat tst2.txt

# Now test comm
echo
echo "uutils comm results"
echo
comm -23 tst1.txt tst2.txt

# This reports.
#comm: file 1 is not in sorted order
#comm: file 2 is not in sorted order
#B
#comm: input is not in sorted order


# Repeat with GNU core utils
echo
echo a A b B | tr ' ' '\n' | gnusort > tst3.txt
echo a A b C | tr ' ' '\n' | gnusort > tst4.txt

echo "GNU coreutils sort 3"
cat tst3.txt
echo
echo "GNU coreutils sort 4"
cat tst4.txt
echo

echo
echo "GNU coreutils comm results"
echo
gnucomm -23 tst3.txt tst4.txt

# This reports.
#B


# This is a simple test.
# With more complex data I am getting incorrect results from uutils comm,
# not just error messages. I have not been able to find a pattern to this yet.

# Note also that the sorting order for uutils is different than for 
# GNU coreutils.
# This will likely cause additional errors with stored data after an upgrade.

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: rust-coreutils 0.10.0-1ubuntu2~26.04.1
ProcVersionSignature: Ubuntu 7.0.0-38.38-generic 7.0.14
Uname: Linux 7.0.0-38-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct  6 19:06:14 2026
InstallationDate: Installed on 2024-11-01 (704 days ago)
InstallationMedia: Ubuntu 24.04.1 LTS "Noble Numbat" - Release amd64 
(20240827.1)
SourcePackage: rust-coreutils
UpgradeStatus: Upgraded to resolute on 2026-09-29 (7 days ago)

** Affects: rust-coreutils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169780

Title:
  uutils 0.10.0 comm reports data not sorted with data sorted using
  uutils sort

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2169780/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to