Description of problem: Customer has found cases where they have set LANG and LC_TIME to locales with different encodings causing sort to crash. Issue also described and fixed in the following RHEL6 and Fedora bugs : segfault with LC_TIME different from other multibyte locales https://bugzilla.redhat.com/show_bug.cgi?id=649224 sort assertion failure if LC_CTYPE does not match LC_TIME https://bugzilla.redhat.com/show_bug.cgi?id=647938 Version-Release number of selected component (if applicable): coreutils-5.97-23.el5_6.4 How reproducible: Always Steps to Reproduce: # env LANG=en_US.UTF-8 LC_TIME=de_DE sort sort: sort.c:701: inittables_mb: Assertion `mblength != (size_t)-1 && mblength != (size_t)-2' failed. Aborted (core dumped) # gdb sort core.2730 GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"... Reading symbols from /lib64/libc.so.6...done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Core was generated by `sort'. Program terminated with signal 6, Aborted. [New process 2730] #0 0x0000003a32630265 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x0000003a32630265 in raise () from /lib64/libc.so.6 #1 0x0000003a32631d10 in abort () from /lib64/libc.so.6 #2 0x0000003a326296e6 in __assert_fail () from /lib64/libc.so.6 #3 0x0000000000404334 in inittables_mb () at sort.c:701 #4 0x0000000000405cc5 in main (argc=1, argv=0x7fffe241df98) at sort.c:2734 Actual results: sort: sort.c:701: inittables_mb: Assertion `mblength != (size_t)-1 && mblength != (size_t)-2' failed. Aborted (core dumped) Expected results: No abort. Additional info:
ok, will fix that in RHEL-5 too in next coreutils update ...
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: When values of LC_TIME and LC_CTYPE variables differed, the sort utility sometimes terminated due to an assertion failure. This bug has been fixed and the sort utility no longer crashes in the described scenario.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1074.html