Your message dated Fri, 23 May 2025 20:59:41 +0200
with message-id 
<gq6gfxoqi6gimeqd5gh3e6u77i6s5v2w44ddwvqvkr7dy2n...@tarta.nabijaczleweli.xyz>
and subject line Close: Bug#579923: msort: double free or corruption
has caused the Debian Bug report #579923,
regarding msort: double free or corruption
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
579923: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579923
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: msort
Version: 8.52-1.2
Severity: normal

When trying to sort an UTF-8 file with 2 sort keys in a bash script, I get
the following error:

----------------------------------------------------------------------
$ test-msort.sh 
+ msort -l -d '\t' -n 1 -s fr_FR.UTF-8 -n 2 -s fr_FR.UTF-8 test1.txt
Key 1 obligatory  first field   Increasing lexicographic
Key 2 obligatory  second field   Increasing lexicographic
Reading from test1.txt.
Records processed:                          0*** glibc detected *** msort: 
double free or corruption (!prev): 0x09d344d8 ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6[0xb76f2624]
/lib/i686/cmov/libc.so.6(cfree+0x96)[0xb76f4826]
msort[0x8055292]
msort[0x8057edd]
msort[0x805a082]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb769a455]
msort[0x8049761]
======= Memory map: ========
08048000-08067000 r-xp 00000000 09:06 1655763    /usr/bin/msort
08067000-08068000 rw-p 0001e000 09:06 1655763    /usr/bin/msort
09cfd000-09d3f000 rw-p 00000000 00:00 0          [heap]
b5000000-b5021000 rw-p 00000000 00:00 0 
b5021000-b5100000 ---p 00000000 00:00 0 
b512e000-b5135000 r--s 00000000 09:06 1658437    
/usr/lib/gconv/gconv-modules.cache
b5135000-b6137000 rw-p 00000000 00:00 0 
b6137000-b62e8000 r--p 00000000 09:06 1658539    /usr/lib/locale/locale-archive
b62e8000-b62ea000 rw-p 00000000 00:00 0 
b62ea000-b62f6000 r-xp 00000000 09:06 4071673    /lib/libgcc_s.so.1
b62f6000-b62f7000 rw-p 0000b000 09:06 4071673    /lib/libgcc_s.so.1
b62f7000-b63da000 r-xp 00000000 09:06 1658070    /usr/lib/libstdc++.so.6.0.10
b63da000-b63dd000 r--p 000e2000 09:06 1658070    /usr/lib/libstdc++.so.6.0.10
b63dd000-b63df000 rw-p 000e5000 09:06 1658070    /usr/lib/libstdc++.so.6.0.10
b63df000-b63e5000 rw-p 00000000 00:00 0 
b63e5000-b732a000 r--p 00000000 09:06 1655202    /usr/lib/libicudata.so.42.1
b732a000-b732b000 rw-p 00f44000 09:06 1655202    /usr/lib/libicudata.so.42.1
b732b000-b74d3000 r-xp 00000000 09:06 1655203    /usr/lib/libicui18n.so.42.1
b74d3000-b74da000 rw-p 001a8000 09:06 1655203    /usr/lib/libicui18n.so.42.1
b74da000-b74fe000 r-xp 00000000 09:06 4071819    /lib/i686/cmov/libm-2.7.so
b74fe000-b7500000 rw-p 00023000 09:06 4071819    /lib/i686/cmov/libm-2.7.so
b7500000-b7501000 rw-p 00000000 00:00 0 
b7501000-b7543000 r-xp 00000000 09:06 1657962    /usr/lib/libgmp.so.3.4.2
b7543000-b7544000 rw-p 00042000 09:06 1657962    /usr/lib/libgmp.so.3.4.2
b7544000-b7678000 r-xp 00000000 09:06 1655744    /usr/lib/libicuuc.so.42.1
b7678000-b7682000 rw-p 00134000 09:06 1655744    /usr/lib/libicuuc.so.42.1
b7682000-b7684000 rw-p 00000000 00:00 0 
b7684000-b77d9000 r-xp 00000000 09:06 4071815    /lib/i686/cmov/libc-2.7.so
b77d9000-b77da000 r--p 00155000 09:06 4071815    /lib/i686/cmov/libc-2.7.so
b77da000-b77dc000 rw-p 00156000 09:06 4071815    /lib/i686/cmov/libc-2.7.so
b77dc000-b77df000 rw-p 00000000 00:00 0 
b77df000-b77fd000 r-xp 00000000 09:06 1655743    /usr/lib/libicutu.so.42.1
b77fd000-b77fe000 rw-p 0001e000 09:06 1655743    /usr/lib/libicutu.so.42.1
b77fe000-b7823000 rw-p 00000000 00:00 0 
b7823000-b7831000 r-xp 00000000 09:06 1655761    /usr/lib/libtre.so.5.0.0
b7831000-b7832000 rw-p 0000d000 09:06 1655761    /usr/lib/libtre.so.5.0.0
b7832000-b7843000 r-xp 00000000 09:06 1658081    /usr/lib/libuninum.so.5.2.1
b7843000-b7846000 rw-p 00010000 09:06 1658081    /usr/lib/libuninum.so.5.2.1
b7846000-b7847000 rw-p 00000000 00:00 0 
b784d000-b784f000 rw-p 00000000 00:00 0 
b784f000-b7850000 r-xp 00000000 00:00 0          [vdso]
b7850000-b786a000 r-xp 00000000 09:06 4071650    /lib/ld-2.7.so
b786a000-b786c000 rw-p 0001a000 09:06 4071650    /lib/ld-2.7.so
bfbd3000-bfbe8000 rw-p 00000000 00:00 0          [stack]
/home/fevrier/bin/test-msort.sh: line 5: 14067 Abandon                 msort -l 
-d '\t' -n 1 -s fr_FR.UTF-8 -n 2 -s 
fr_FR.UTF-8 test1.txt
----------------------------------------------------------------------

Using the same command from the command line does not reproduce the error.

Here is the script that reproduces the problem:
----------------------------------------------------------------------
#!/bin/bash

set -x

msort -l -d '\t' -n 1 -s fr_FR.UTF-8 -n 2 -s fr_FR.UTF-8 test1.txt
----------------------------------------------------------------------

I get no error if I remove the "-n 2 -s fr_FR.UTF-8" part.

I had this problem with the Debian stable version of msort. Upgrading
msort to the version in testing has made no difference.

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'proposed-updates'), (400, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-3-686 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages msort depends on:
ii  libc6                       2.7-18lenny2 GNU C Library: Shared libraries
ii  libicu42                    4.2.1-3      International Components for Unico
ii  libtre5                     0.8.0-2      regexp matching library with appro
ii  libuninum5                  2.7-1        library for handling numbers as Un

msort recommends no packages.

Versions of packages msort suggests:
pn  msort-gui                     <none>     (no description available)

-- no debconf information

Attachment: test1.txt.bz2
Description: Binary data


--- End Message ---
--- Begin Message ---
Version: 8.53-2.3+b2

On Sat, Jul 24, 2010 at 06:15:23PM -0000, Jean-Philippe Guérard wrote:
> After some new tests, I've been able to reproduce this
> problem by just typing the following test in a test file
> and feeding it into msort.
> 
> fevrier@yakkuru:~$ cat > essai.txt
> hook  point d'ancrage
> hook    point d'accrochage
> fevrier@yakkuru:~$ cat essai.txt | msort -q -l -d '\t' -n 1 -s fr_FR.UTF-8
> -n 2 -s fr_FR.UTF-8
> 
> This does happen both from the command line and inside a script.
I can repro this in lenny.

I can't repro this with
    msort_8.52-1.2_amd64.deb
  + libicu42_4.2.1-3_amd64.deb
  + bookworm
BUT I do see 
  $ cat essai.txt | LD_LIBRARY_PATH=libi/usr/lib/ valgrind ms/usr/bin/msort -q 
-l -d '  ' -n 1 -s fr_FR.UTF-8 -n 2 -s fr_FR.UTF-8
  ==2491648== Memcheck, a memory error detector
  ==2491648== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
  ==2491648== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
  ==2491648== Command: ms/usr/bin/msort -q -l -d _ -n 1 -s fr_FR.UTF-8 -n 2 -s 
fr_FR.UTF-8
  ==2491648==
  ==2491648== Conditional jump or move depends on uninitialised value(s)
  ==2491648==    at 0x41441D: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x40ACCF: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x4117DF: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x4C70249: (below main) (libc_start_call_main.h:58)
  ==2491648==
  ==2491648== Conditional jump or move depends on uninitialised value(s)
  ==2491648==    at 0x414476: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x40ACCF: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x4117DF: ??? (in /home/nabijaczleweli/uwu/ms/usr/bin/msort)
  ==2491648==    by 0x4C70249: (below main) (libc_start_call_main.h:58)
  ==2491648==
  hook    point d'accrochage
  hook    point d'ancrage
  ==2491648==
  ==2491648== HEAP SUMMARY:
  ==2491648==     in use at exit: 16,870,070 bytes in 26 blocks
  ==2491648==   total heap usage: 101 allocs, 75 frees, 16,963,425 bytes 
allocated
  ==2491648==
  ==2491648== LEAK SUMMARY:
  ==2491648==    definitely lost: 23 bytes in 2 blocks
  ==2491648==    indirectly lost: 0 bytes in 0 blocks
  ==2491648==      possibly lost: 0 bytes in 0 blocks
  ==2491648==    still reachable: 16,870,047 bytes in 24 blocks
  ==2491648==         suppressed: 0 bytes in 0 blocks
  ==2491648== Rerun with --leak-check=full to see details of leaked memory
  ==2491648==
  ==2491648== Use --track-origins=yes to see where uninitialised values come 
from
  ==2491648== For lists of detected and suppressed errors, rerun with: -s
  ==2491648== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

I can't repro this with msort 8.53-2.3+b2 on bookworm (with bookworm deps),
so this got fixed somewhen between lenny and bookworm.

Best,

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Reply via email to