Bug 93629 - GNU sort(1) tool dumps core within non-regular locale settings
Summary: GNU sort(1) tool dumps core within non-regular locale settings
Status: Closed DUPLICATE of bug 93566
Alias: None
Product: Base System
Classification: Unclassified
Component: gnu (show other bugs)
Version: 6.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-21 09:00 UTC by Yaroslav Kolomiyets
Modified: 2016-06-01 21:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yaroslav Kolomiyets 2006-02-21 09:00:16 UTC
GNU sort(1) tool dumps core within non-regular locale settings:

$ locale
LANG=uk_UA.KOI8-U
LC_CTYPE=ja_JP.UTF-8
LC_COLLATE="uk_UA.KOI8-U"
LC_TIME="uk_UA.KOI8-U"
LC_NUMERIC="uk_UA.KOI8-U"
LC_MONETARY="uk_UA.KOI8-U"
LC_MESSAGES="uk_UA.KOI8-U"
LC_ALL=

$ ls | sort
Assertion failed: (mblength != (size_t)-1 && mblength != (size_t)-2), function inittables_mb, file /usr/src/gnu/usr.bin/sort/../../../contrib/gnu-sort/src/sort.c, line 706.
Abort (core dumped)

$ ident `which sort`
/usr/bin/sort:
     $FreeBSD: src/lib/csu/i386-elf/crti.S,v 1.7 2005/05/19 07:31:06 dfr Exp $
     $FreeBSD: src/lib/csu/i386-elf/crtn.S,v 1.6 2005/05/19 07:31:06 dfr Exp $
     $FreeBSD: src/lib/csu/common/crtbrand.c,v 1.4 2003/10/17 15:43:13 peter Exp $
     $FreeBSD: src/lib/csu/i386-elf/crt1.c,v 1.14 2005/05/19 07:36:07 dfr Exp $

Fix: 

Set LANG and all LC_ variables to the same value.
How-To-Repeat: [unset all LC_* environment variables]
setenv LANG uk_UA.KOI8-U
setenv LC_CTYPE ja_JP.UTF-8
/usr/bin/sort
Comment 1 Andrey A. Chernov freebsd_committer freebsd_triage 2006-02-21 20:57:27 UTC
Responsible Changed
From-To: freebsd-bugs->tjr

To our multibyte guru
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2007-03-09 00:39:25 UTC
State Changed
From-To: open->feedback

Is this still a problem with recent versions of FreeBSD? 


Comment 3 Mark Linimon freebsd_committer freebsd_triage 2007-03-09 00:39:25 UTC
Responsible Changed
From-To: tjr->linimon

tjr has returned his commit bit for safekeeping.
Comment 4 Yaroslav Kolomiyets 2007-03-12 08:52:13 UTC
ML> Is this still a problem with recent versions of FreeBSD?
Yes, it repeats on "6.2-STABLE #0: Tue Jan 16 15:09:57 EET 2007"

-- 
Best regards,
    Yaroslav Kolomiyets
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2007-03-12 15:27:34 UTC
State Changed
From-To: feedback->open

Submitter has confirmed this as of 6.2R. 


Comment 6 Mark Linimon freebsd_committer freebsd_triage 2007-03-12 15:27:34 UTC
Responsible Changed
From-To: linimon->freebsd-bugs
Comment 7 Gavin Atkinson freebsd_committer freebsd_triage 2009-04-23 13:43:43 UTC
This is still an issue on 8.0-CURRENT r191005 (Apr 13 2009)
Comment 8 O. Hartmann 2011-10-11 13:40:07 UTC
This error/bug is still in FreeBSD 9.0-BETA3 and FreeBSD 10.0-CURRENT.

When enabling VESA and TEKEN_CONS25 in FreeBSD 9.0-BETA3's kernel seems 
to help in some cases.

On both OS I have the error even in a standard LC_ environment.

Oliver
Comment 9 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-06-01 21:00:29 UTC
PR-93566 seems related and has a patch.
GNU sort was replaced with bsdsort, and removed in r241511.

*** This bug has been marked as a duplicate of bug 93566 ***