Thomas Eberhardt
2016-Jul-15 13:55 UTC
stable/11 Problems with Unicode character and ls(1) sorting
% uname -a FreeBSD clarence.ocp.lan 11.0-BETA1 FreeBSD 11.0-BETA1 #0 r302457: Sat Jul 9 10:41:40 CEST 2016 thomas at clarence.ocp.lan:/usr/obj/usr/src/sys/GENERIC amd64 % locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_ALL % mkdir x % touch x/?on1 % ls x ?on1 % touch x/?on2 % ls -f x . .. ?on1 ?on2 % ls -f x | hd 00000000 2e 0a 2e 2e 0a c3 86 6f 6e 31 0a c3 86 6f 6e 32 |.......on1...on2| 00000010 0a |.| 00000011 % ls x [hangs and consumes 100% CPU] ^C % gdb /bin/ls [?] (gdb) run x Starting program: /bin/ls x [hangs] ^C Program received signal SIGINT, Interrupt. 0x0000000800ffa9dd in _collate_lookup (table=<value optimized out>, t=<value optimized out>, len=<value optimized out>, pri=<value optimized out>, which=<value optimized out>, state=<value optimized out>) at /usr/src/lib/libc/locale/collate.c:340 340 *pri = table->char_pri_table[*t].pri[which]; Current language: auto; currently minimal (gdb) bt #0 0x0000000800ffa9dd in _collate_lookup (table=<value optimized out>, t=<value optimized out>, len=<value optimized out>, pri=<value optimized out>, which=<value optimized out>, state=<value optimized out>) at /usr/src/lib/libc/locale/collate.c:340 #1 0x0000000800fdc38a in wcscoll_l (ws1=<value optimized out>, ws2=<value optimized out>, locale=<value optimized out>) at /usr/src/lib/libc/string/wcscoll.c:158 #2 0x0000000800fd9071 in strcoll_l (s=<value optimized out>, s2=<value optimized out>, locale=0x80124f338) at /usr/src/lib/libc/string/strcoll.c:101 #3 0x0000000800fee253 in qsort (a=<value optimized out>, n=<value optimized out>, es=<value optimized out>, cmp=0x800f28530 <fts_compar>) at /usr/src/lib/libc/stdlib/qsort.c:130 #4 0x0000000800f27397 in fts_sort (sp=<value optimized out>, head=<value optimized out>, nitems=<value optimized out>) at /usr/src/lib/libc/gen/fts.c:995 #5 0x0000000800f2848e in fts_children (sp=<value optimized out>, instr=Error accessing memory address 0x2: Bad address. ) at /usr/src/lib/libc/gen/fts.c:570 #6 0x00000000004030df in traverse (argc=<value optimized out>, argv=<value optimized out>, options=<value optimized out>) at /usr/src/bin/ls/ls.c:576 #7 0x0000000000402eeb in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/bin/ls/ls.c:498 #8 0x00000000004020cf in _start () #9 0x0000000800629000 in ?? () #10 0x0000000000000000 in ?? () (gdb) br strcoll.c:101 Breakpoint 1 at 0x800fd9063: file /usr/src/lib/libc/string/strcoll.c, line 101. (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /bin/ls x [?] Breakpoint 1, strcoll_l (s=<value optimized out>, s2=<value optimized out>, locale=0x80124f338) at /usr/src/lib/libc/string/strcoll.c:101 101 ret = wcscoll_l(w1, w2, locale); (gdb) n [wcscoll_l never returns] Does anybody know what?s going on? This is on a ZFS filesystem if that matters. Regards, Thomas Eberhardt
Jung-uk Kim
2016-Jul-15 15:38 UTC
stable/11 Problems with Unicode character and ls(1) sorting
On 07/15/16 09:55 AM, Thomas Eberhardt wrote:> % uname -a > FreeBSD clarence.ocp.lan 11.0-BETA1 FreeBSD 11.0-BETA1 #0 r302457: Sat Jul 9 10:41:40 CEST 2016 thomas at clarence.ocp.lan:/usr/obj/usr/src/sys/GENERIC amd64 > > % locale > LANG=en_US.UTF-8 > LC_CTYPE="en_US.UTF-8" > LC_COLLATE="en_US.UTF-8" > LC_TIME="en_US.UTF-8" > LC_NUMERIC="en_US.UTF-8" > LC_MONETARY="en_US.UTF-8" > LC_MESSAGES="en_US.UTF-8" > LC_ALL> > % mkdir x > % touch x/?on1 > % ls x > ?on1 > % touch x/?on2 > % ls -f x > . .. ?on1 ?on2 > % ls -f x | hd > 00000000 2e 0a 2e 2e 0a c3 86 6f 6e 31 0a c3 86 6f 6e 32 |.......on1...on2| > 00000010 0a |.| > 00000011 > % ls x > [hangs and consumes 100% CPU] > ^C > > % gdb /bin/ls > [?] > (gdb) run x > Starting program: /bin/ls x > [hangs] > ^C > Program received signal SIGINT, Interrupt. > 0x0000000800ffa9dd in _collate_lookup (table=<value optimized out>, t=<value optimized out>, > len=<value optimized out>, pri=<value optimized out>, which=<value optimized out>, state=<value optimized out>) > at /usr/src/lib/libc/locale/collate.c:340 > 340 *pri = table->char_pri_table[*t].pri[which]; > Current language: auto; currently minimal > (gdb) bt > #0 0x0000000800ffa9dd in _collate_lookup (table=<value optimized out>, t=<value optimized out>, > len=<value optimized out>, pri=<value optimized out>, which=<value optimized out>, state=<value optimized out>) > at /usr/src/lib/libc/locale/collate.c:340 > #1 0x0000000800fdc38a in wcscoll_l (ws1=<value optimized out>, ws2=<value optimized out>, > locale=<value optimized out>) at /usr/src/lib/libc/string/wcscoll.c:158 > #2 0x0000000800fd9071 in strcoll_l (s=<value optimized out>, s2=<value optimized out>, locale=0x80124f338) > at /usr/src/lib/libc/string/strcoll.c:101 > #3 0x0000000800fee253 in qsort (a=<value optimized out>, n=<value optimized out>, es=<value optimized out>, > cmp=0x800f28530 <fts_compar>) at /usr/src/lib/libc/stdlib/qsort.c:130 > #4 0x0000000800f27397 in fts_sort (sp=<value optimized out>, head=<value optimized out>, nitems=<value optimized out>) > at /usr/src/lib/libc/gen/fts.c:995 > #5 0x0000000800f2848e in fts_children (sp=<value optimized out>, instr=Error accessing memory address 0x2: Bad address. > ) at /usr/src/lib/libc/gen/fts.c:570 > #6 0x00000000004030df in traverse (argc=<value optimized out>, argv=<value optimized out>, > options=<value optimized out>) at /usr/src/bin/ls/ls.c:576 > #7 0x0000000000402eeb in main (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/bin/ls/ls.c:498 > #8 0x00000000004020cf in _start () > #9 0x0000000800629000 in ?? () > #10 0x0000000000000000 in ?? () > (gdb) br strcoll.c:101 > Breakpoint 1 at 0x800fd9063: file /usr/src/lib/libc/string/strcoll.c, line 101. > (gdb) run > The program being debugged has been started already. > Start it from the beginning? (y or n) y > Starting program: /bin/ls x > [?] > > Breakpoint 1, strcoll_l (s=<value optimized out>, s2=<value optimized out>, locale=0x80124f338) > at /usr/src/lib/libc/string/strcoll.c:101 > 101 ret = wcscoll_l(w1, w2, locale); > (gdb) n > [wcscoll_l never returns] > > > Does anybody know what?s going on? This is on a ZFS filesystem if that matters.Yes, it is a known problem and bapt is working on it. If you're in hurry, reverting r302324 will fix the regression for now. https://svnweb.freebsd.org/changeset/base/302324 FYI, this problem is tracked as PR211135. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211135 Jung-uk Kim -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20160715/4ec0ea51/attachment.sig>