Subject: bug#15527: Failing test spencer1-locale for grep 2.14 on Solaris

From: Jim Meyering <[email-masked]>
Date: Wed, 16 Oct 2013 07:50:48 -0700

On Wed, Oct 16, 2013 at 6:49 AM, Dagobert Michelsen <[email-masked]> wrote:
> Cool, thanks for digging this out! Can you please tell me which
> invocation of wcscoll fails? I would then open a call at Oracle
> about the issue.

Sure.  Here's a snippet from my debugging session.
This shows that \002 collates *after* \003 in that locale:
You can see I couldn't believe my eyes, so printed the offending
wcscoll expression twice :-)

2770        /* Build the table for single byte characters.  */
2771        for (wc = 0; wc < SBC_MAX; ++wc)
2772          {
2773            cmp_buf[2] = wc;
2774            if (wcscoll (cmp_buf, cmp_buf + 2) <= 0
2775                && wcscoll (cmp_buf + 2, cmp_buf + 4) <= 0)
2776              bitset_set (sbcset, wc);
2777          }
2778      }
(gdb) p wcscoll (cmp_buf + 2, cmp_buf + 4)
$27 = 3
(gdb) p cmp_buf+2
$28 = 0xffbff2f8 L"\002"
(gdb) p cmp_buf+4
$29 = 0xffbff300 L"\003"
(gdb) p wcscoll (cmp_buf + 2, cmp_buf + 4)
$30 = 3