Technical article 109304

Why does the sort command cause a core dump on large files under OpenServer 5?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

When I try to sort a large file with the command:

# sort -y -n -t| +1 -2 +5 -6 +31 +32 <filename>
sort core dumps.

Solution

Complex sort commands on large files, such as the above, are known to work reliably only if the LANG environment variable is set to the default US value of C_C.C.

Hence, if the particular needs of your locale(M) can be accomodated by reassigning the value of C_C.C to LANG, make this change in the file "/etc/default/lang"; that is, make sure the first two lines read:

LANG=C_C.C
export LANG;

From the Xinuos technical article database, record 109304. Reproduced with permission. The original is at www.sco.com/ta/109304, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.