Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 2014 12:11:38 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Tomohisa Tanaka <tomohisa.tanaka@gmail.com>
Cc:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/188036: mblen(3) in EUC locales causes crash and segmentation fault.
Message-ID:  <205C5DD1-C26B-4F6A-B640-C78E22D0567B@FreeBSD.org>
In-Reply-To: <201403311610.s2VGA3E1055670@freefall.freebsd.org>
References:  <201403311610.s2VGA3E1055670@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I think this is an issue when uselocale() is called with -1 as the =
argument.  setlocale() for an EUC locale works correctly, as does =
newlocale()/uselocale().  However, in your test program, you go from an =
explicit per-thread locale to a generic one and uselocale is not =
correctly clearing the per-thread cache.

This should be fixed in r264038, thank you for such a detailed report!  =
The test case was very helpful in diagnosing and fixing the problem.

David

On 31 Mar 2014, at 17:10, Tomohisa Tanaka <tomohisa.tanaka@gmail.com> =
wrote:

> The following reply was made to PR standards/188036; it has been noted =
by GNATS.
>=20
> From: Tomohisa Tanaka <tomohisa.tanaka@gmail.com>
> To: David Chisnall <theraven@freebsd.org>
> Cc: freebsd-gnats-submit@freebsd.org
> Subject: Re: standards/188036: mblen(3) in EUC locales causes crash =
and
> segmentation fault.
> Date: Tue, 1 Apr 2014 01:01:46 +0900
>=20
> --20cf303f672e1e5ef404f5e92be2
> Content-Type: multipart/alternative; =
boundary=3D20cf303f672e1e5ef004f5e92be0
>=20
> --20cf303f672e1e5ef004f5e92be0
> Content-Type: text/plain; charset=3DISO-8859-1
>=20
> Thank you for your quick reply.
>=20
> Please can you test this and let me know if it fixes it for you?
>=20
>=20
> Yes, but it does not work for me as follows:
>=20
> % gcc -g3 main.c ~/work/freebsd-usr-src/lib/libc/libc.a
> % gdb ./a.out
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and =
you are
> welcome to change it and/or distribute copies of it under certain =
conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for =
details.
> This GDB was configured as "amd64-marcel-freebsd"...
> (gdb) run
> Starting program: /usr/home/syl/work/mblen/a.out
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
>=20
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041823b in _EUC_mbrtowc (pwc=3D0x0, s=3D0x4321b2 "a", n=3D1, =
ps=3D0x63f318)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/euc.c:182
> 182                     want =3D CEI->count[set =3D _euc_set(*s)];
> (gdb) bt
> #0  0x000000000041823b in _EUC_mbrtowc (pwc=3D0x0, s=3D0x4321b2 "a", =
n=3D1,
>     ps=3D0x63f318)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/euc.c:182
> #1  0x0000000000406def in mblen_l (s=3D0x4321b2 "a", n=3D1, =
locale=3D0x63f260)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/mblen.c:51
> #2  0x0000000000406e95 in mblen (s=3D0x4321b2 "a", n=3D1)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/mblen.c:60
> #3  0x0000000000406bb6 in main () at main.c:16
> (gdb)
>=20
>=20
> Actually, I'm not sure how this bug can manifest, unless you've =
somehow
>> built libc with the wrong headers.  In runtype.h (which is included =
in
>> euc.c), we have this:
>> #define _CurrentRuneLocale (__getCurrentRuneLocale())
>> So these two versions should expand to the same thing.
>=20
>=20
> (Your fix causes the same thing for me, so you're right.)
> The libc that I used for How-To-Repeat is not built by me (installed =
by
> installer).
>=20
> % setenv LC_MESSAGES C
> % env LANG=3Dja_JP.eucJP ./a.out
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
> Segmentation fault (core dumped)
> % ldd ./a.out
> ./a.out:
>         libc.so.7 =3D> /lib/libc.so.7 (0x80081a000)
> % env LANG=3DC ls -l /lib/libc.so.7
> -r--r--r--  1 root  wheel  1406888 Sep 27  2013 /lib/libc.so.7
> % md5 /lib/libc.so.7
> MD5 (/lib/libc.so.7) =3D d997dd201ec08270e17383223fd2c40a
>=20
> (I verified /lib/libc.so.7 is not changed from
> =
http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/base.txz)
> I'm sorry, I had not understood this issue enough to make a patch.I
> show another sample as follows:
>=20
> % cat main1.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <locale.h>
> #include <xlocale.h>
> #include <runetype.h>
>=20
> static void
> showVariables(void)
> {
>   printf("_ThreadRuneLocale: %p\n", _ThreadRuneLocale);
>   if (_ThreadRuneLocale !=3D NULL) {
>     printf("_ThreadRuneLocale->__variable: %p\n",
>            _ThreadRuneLocale->__variable);
>   }
>   printf("__getCurrentRuneLocale(): %p\n", __getCurrentRuneLocale());
>   if (__getCurrentRuneLocale() !=3D NULL) {
>     printf("__getCurrentRuneLocale()->__variable: %p\n",
>            __getCurrentRuneLocale()->__variable);
>   }
>   printf("&_DefaultRuneLocale: %p\n", &_DefaultRuneLocale);
>   printf("&_DefaultRuneLocale->__variable: %p\n",
>          (&_DefaultRuneLocale)->__variable);
> }
>=20
> int
> main(void)
> {
>   printf("setlocale: %s\n", setlocale(LC_ALL, ""));
>=20
>   printf("[0]\n");
>   showVariables();
>=20
>   locale_t newLocale =3D newlocale(LC_ALL_MASK, "C", NULL);
>   locale_t oldLocale =3D uselocale(newLocale);
>   /* ... */
>=20
>   printf("[1]\n");
>   showVariables();
>=20
>   uselocale(oldLocale);
>=20
>   printf("[2]\n");
>   showVariables();
>=20
>   printf("%d\n", mblen("a", 1));
>   return 0;
> }
> % gcc -g3 main1.c
> % gdb ./a.out
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and =
you are
> welcome to change it and/or distribute copies of it under certain =
conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for =
details.
> This GDB was configured as "amd64-marcel-freebsd"...
> (gdb) run
> Starting program: /usr/home/syl/work/mblen/a.out
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
> [0]
> _ThreadRuneLocale: 0x0
> __getCurrentRuneLocale(): 0x800d0c000
> __getCurrentRuneLocale()->__variable: 0x800c07040
> &_DefaultRuneLocale: 0x600ee0
> &_DefaultRuneLocale->__variable: 0x0
> [1]
> _ThreadRuneLocale: 0x600ee0
> _ThreadRuneLocale->__variable: 0x0
> __getCurrentRuneLocale(): 0x600ee0
> __getCurrentRuneLocale()->__variable: 0x0
> &_DefaultRuneLocale: 0x600ee0
> &_DefaultRuneLocale->__variable: 0x0
> [2]
> _ThreadRuneLocale: 0x600ee0
> _ThreadRuneLocale->__variable: 0x0
> __getCurrentRuneLocale(): 0x600ee0
> __getCurrentRuneLocale()->__variable: 0x0
> &_DefaultRuneLocale: 0x600ee0
> &_DefaultRuneLocale->__variable: 0x0
>=20
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000800908880 in mbsnrtowcs () from /lib/libc.so.7
> (gdb)
>=20
> After calling 'uselocale(oldLocale)' [2], _ThreadRuneLocale should not
> be 0x600ee0.It is strange that the states [1] and [2] are the same. (I
> hope this helps.)
>=20
> If I can help you in any other way, please let me know.
>=20
>=20
>=20
> 2014-03-31 18:57 GMT+09:00 David Chisnall <theraven@freebsd.org>:
>=20
>> On 31 Mar 2014, at 10:03, David Chisnall <theraven@FreeBSD.org> =
wrote:
>>=20
>>> I think the fix should actually be:
>>>=20
>>> Index: locale/euc.c
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>> --- locale/euc.c      (revision 263226)
>>> +++ locale/euc.c      (working copy)
>>> @@ -134,7 +134,7 @@
>>>      return (ps =3D=3D NULL || ((const _EucState *)ps)->want =3D=3D =
0);
>>> }
>>>=20
>>> -#define      CEI     ((_EucInfo *)(_CurrentRuneLocale->__variable))
>>> +#define      CEI     ((_EucInfo
>> *)(__getCurrentRuneLocale()->__variable))
>>>=20
>>> #define       _SS2    0x008e
>>> #define       _SS3    0x008f
>>>=20
>>>=20
>>>=20
>>> Please can you test this and let me know if it fixes it for you?
>>=20
>> Actually, I'm not sure how this bug can manifest, unless you've =
somehow
>> built libc with the wrong headers.  In runtype.h (which is included =
in
>> euc.c), we have this:
>>=20
>> #define _CurrentRuneLocale (__getCurrentRuneLocale())
>>=20
>> So these two versions should expand to the same thing.
>>=20
>> David
>>=20
>>=20
>=20
>=20
> --=20
> Tomohisa Tanaka
> Tomohisa.Tanaka@gmail.com
>=20
> --20cf303f672e1e5ef004f5e92be0
> Content-Type: text/html; charset=3DISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>=20
> <div dir=3D3D"ltr">Thank you for your quick reply.<br><br><blockquote =
class=3D
> =3D3D"gmail_quote" style=3D3D"margin:0px 0px 0px =
0.8ex;border-left-width:1px;bo=3D
> =
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"=
>=3D
> Please can you test this and let me know if it fixes it for =
you?</blockquot=3D
> e>
> <br>Yes, but it does not work for me as follows:<br><pre =
style=3D3D"color:rgb=3D
> (0,0,0);word-wrap:break-word;white-space:pre-wrap">% gcc -g3 main.c =
~/work/=3D
> freebsd-usr-src/lib/libc/libc.a=3D20
> % gdb ./a.out=3D20
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and =
you ar=3D
> e
> welcome to change it and/or distribute copies of it under certain =
condition=3D
> s.
> Type &quot;show copying&quot; to see the conditions.
> There is absolutely no warranty for GDB.  Type &quot;show =
warranty&quot; fo=3D
> r details.
> This GDB was configured as &quot;amd64-marcel-freebsd&quot;...
> (gdb) run
> Starting program: /usr/home/syl/work/mblen/a.out=3D20
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
>=20
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041823b in _EUC_mbrtowc (pwc=3D3D0x0, s=3D3D0x4321b2 =
&quot;a&quot;, =3D
> n=3D3D1, ps=3D3D0x63f318)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/euc.c:182
> 182                     want =3D3D CEI-&gt;count[set =3D3D =
_euc_set(*s)];
> (gdb) bt
> #0  0x000000000041823b in _EUC_mbrtowc (pwc=3D3D0x0, s=3D3D0x4321b2 =
&quot;a&quo=3D
> t;, n=3D3D1,=3D20
>     ps=3D3D0x63f318)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/euc.c:182
> #1  0x0000000000406def in mblen_l (s=3D3D0x4321b2 &quot;a&quot;, =
n=3D3D1, local=3D
> e=3D3D0x63f260)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/mblen.c:51
> #2  0x0000000000406e95 in mblen (s=3D3D0x4321b2 &quot;a&quot;, n=3D3D1)
>     at /usr/home/syl/work/freebsd-usr-src/lib/libc/locale/mblen.c:60
> #3  0x0000000000406bb6 in main () at main.c:16
> (gdb) </pre><br><blockquote class=3D3D"gmail_quote" =
style=3D3D"margin:0px 0px 0=3D
> px =
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-le=3D=

> ft-style:solid;padding-left:1ex">Actually, I&#39;m not sure how this =
bug ca=3D
> n manifest, unless you&#39;ve somehow built libc with the wrong =
headers. =3D
> =3DA0In runtype.h (which is included in euc.c), we have this:<br>
> #define _CurrentRuneLocale (__getCurrentRuneLocale())<br>So these two =
versi=3D
> ons should expand to the same =
thing.</blockquote><div><br></div><div>(Your =3D
> fix causes the same thing for me, so you&#39;re right.)</div><div>The =
libc =3D
> that I used for How-To-Repeat is not built by me (installed by =
installer).<=3D
> /div>
> <pre =
style=3D3D"color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">%=3D=

>  setenv LC_MESSAGES C
> % env LANG=3D3Dja_JP.eucJP ./a.out
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
> Segmentation fault (core dumped)
> % ldd ./a.out
> ./a.out:
>         libc.so.7 =3D3D&gt; /lib/libc.so.7 (0x80081a000)
> % env LANG=3D3DC ls -l /lib/libc.so.7=3D20
> -r--r--r--  1 root  wheel  1406888 Sep 27  2013 /lib/libc.so.7
> % md5 /lib/libc.so.7
> MD5 (/lib/libc.so.7) =3D3D d997dd201ec08270e17383223fd2c40a</pre><pre =
style=3D
> =3D3D"word-wrap:break-word"><font face=3D3D"arial"><span =
style=3D3D"white-space:n=3D
> ormal">(I verified /lib/libc.so.7 is not changed =
from<br></span></font><spa=3D
> n style=3D3D"color:rgb(0,0,0);font-family:arial;white-space:pre-wrap"><a=
 href=3D
> =
=3D3D"http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/base.t=
xz"=3D
>> =
http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.2-RELEASE/base.txz</a>=
=3D
> )
> </span><span =
style=3D3D"color:rgb(0,0,0);font-family:arial;white-space:pre-wr=3D
> ap">
> I&#39;m sorry, I had not understood this issue enough to make a patch.
> </span><span =
style=3D3D"color:rgb(0,0,0);font-family:arial;white-space:pre-wr=3D
> ap">I show another sample as follows:</span></pre><pre =
style=3D3D"word-wrap:b=3D
> reak-word"><pre =
style=3D3D"color:rgb(0,0,0);word-wrap:break-word;white-space:=3D
> pre-wrap">
> % cat main1.c
> #include &lt;stdio.h&gt;
> #include &lt;stdlib.h&gt;
> #include &lt;locale.h&gt;
> #include &lt;xlocale.h&gt;
> #include &lt;runetype.h&gt;
>=20
> static void
> showVariables(void)
> {
>   printf(&quot;_ThreadRuneLocale: %p\n&quot;, _ThreadRuneLocale);
>   if (_ThreadRuneLocale !=3D3D NULL) {
>     printf(&quot;_ThreadRuneLocale-&gt;__variable: %p\n&quot;,
>            _ThreadRuneLocale-&gt;__variable);
>   }
>   printf(&quot;__getCurrentRuneLocale(): %p\n&quot;, =
__getCurrentRuneLocale=3D
> ());
>   if (__getCurrentRuneLocale() !=3D3D NULL) {
>     printf(&quot;__getCurrentRuneLocale()-&gt;__variable: %p\n&quot;,
>            __getCurrentRuneLocale()-&gt;__variable);
>   }
>   printf(&quot;&amp;_DefaultRuneLocale: %p\n&quot;, =
&amp;_DefaultRuneLocale=3D
> );
>   printf(&quot;&amp;_DefaultRuneLocale-&gt;__variable: %p\n&quot;,
>          (&amp;_DefaultRuneLocale)-&gt;__variable);
> }
>=20
> int
> main(void)
> {
>   printf(&quot;setlocale: %s\n&quot;, setlocale(LC_ALL, =
&quot;&quot;));
>=20
>   printf(&quot;[0]\n&quot;);
>   showVariables();
>=20
>   locale_t newLocale =3D3D newlocale(LC_ALL_MASK, &quot;C&quot;, =
NULL);
>   locale_t oldLocale =3D3D uselocale(newLocale);
>   /* ... */
>=20
>   printf(&quot;[1]\n&quot;);
>   showVariables();
>=20
>   uselocale(oldLocale);
>=20
>   printf(&quot;[2]\n&quot;);
>   showVariables();
>=20
>   printf(&quot;%d\n&quot;, mblen(&quot;a&quot;, 1));
>   return 0;
> }
> % gcc -g3 main1.c
> % gdb ./a.out
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and =
you ar=3D
> e
> welcome to change it and/or distribute copies of it under certain =
condition=3D
> s.
> Type &quot;show copying&quot; to see the conditions.
> There is absolutely no warranty for GDB.  Type &quot;show =
warranty&quot; fo=3D
> r details.
> This GDB was configured as &quot;amd64-marcel-freebsd&quot;...
> (gdb) run
> Starting program: /usr/home/syl/work/mblen/a.out=3D20
> setlocale: =
ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/ja_JP.eucJP/C
> [0]
> _ThreadRuneLocale: 0x0
> __getCurrentRuneLocale(): 0x800d0c000
> __getCurrentRuneLocale()-&gt;__variable: 0x800c07040
> &amp;_DefaultRuneLocale: 0x600ee0
> &amp;_DefaultRuneLocale-&gt;__variable: 0x0
> [1]
> _ThreadRuneLocale: 0x600ee0
> _ThreadRuneLocale-&gt;__variable: 0x0
> __getCurrentRuneLocale(): 0x600ee0
> __getCurrentRuneLocale()-&gt;__variable: 0x0
> &amp;_DefaultRuneLocale: 0x600ee0
> &amp;_DefaultRuneLocale-&gt;__variable: 0x0
> [2]
> _ThreadRuneLocale: 0x600ee0
> _ThreadRuneLocale-&gt;__variable: 0x0
> __getCurrentRuneLocale(): 0x600ee0
> __getCurrentRuneLocale()-&gt;__variable: 0x0
> &amp;_DefaultRuneLocale: 0x600ee0
> &amp;_DefaultRuneLocale-&gt;__variable: 0x0
>=20
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000800908880 in mbsnrtowcs () from /lib/libc.so.7
> (gdb) <span style=3D3D"font-family:arial"> </span></pre><pre =
style=3D3D"word-wr=3D
> ap:break-word"><pre style=3D3D"word-wrap:break-word"><span =
style=3D3D"white-spa=3D
> ce:pre-wrap;color:rgb(0,0,0);font-family:arial">After calling =
&#39;uselocal=3D
> e(oldLocale)&#39; [2], _ThreadRuneLocale </span><span =
style=3D3D"white-space:=3D
> pre-wrap;color:rgb(0,0,0);font-family:arial">should not be 0x600ee0.
> </span><span style=3D3D"color:rgb(0,0,0)"><font face=3D3D"arial"><span =
style=3D3D=3D
> "white-space:pre-wrap">It is strange that the states [1] and [2] are =
the sa=3D
> me. (I hope this helps.)</span></font></span></pre><pre =
style=3D3D"word-wrap:=3D
> break-word">
> <span style=3D3D"color:rgb(0,0,0);font-family:Arial,&#39;Arial =
New&#39;,&#39;=3D
> \00ff2d\00ff33 \00ff30 =
\0030b4\0030b7\0030c3\0030af&#39;,sans-serif;font-si=3D
> ze:13px;white-space:normal">If I can help you in any other way, please =
let =3D
> me know.</span></pre>
> <pre =
style=3D3D"color:rgb(34,34,34);white-space:pre-wrap;word-wrap:break-word=3D=

> "></pre></pre></pre></div><div class=3D3D"gmail_extra"><br><br><div =
class=3D3D"=3D
> gmail_quote">2014-03-31 18:57 GMT+09:00 David Chisnall <span =
dir=3D3D"ltr">&l=3D
> t;<a href=3D3D"mailto:theraven@freebsd.org" =
target=3D3D"_blank">theraven@freebs=3D
> d.org</a>&gt;</span>:<br>
> <blockquote class=3D3D"gmail_quote" style=3D3D"margin:0 0 0 =
.8ex;border-left:1p=3D
> x #ccc solid;padding-left:1ex"><div class=3D3D"">On 31 Mar 2014, at =
10:03, Da=3D
> vid Chisnall &lt;theraven@FreeBSD.org&gt; wrote:<br>
> <br>
> &gt; I think the fix should actually be:<br>
> &gt;<br>
> &gt; Index: locale/euc.c<br>
> &gt; =
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
> =
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3=
D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D<br>
> &gt; --- locale/euc.c =3DA0 =3DA0 =3DA0(revision 263226)<br>
> &gt; +++ locale/euc.c =3DA0 =3DA0 =3DA0(working copy)<br>
> &gt; @@ -134,7 +134,7 @@<br>
> &gt; =3DA0 =3DA0 =3DA0 return (ps =3D3D=3D3D NULL || ((const _EucState =
*)ps)-&gt;want=3D
>  =3D3D=3D3D 0);<br>
> &gt; }<br>
> &gt;<br>
> &gt; -#define =3DA0 =3DA0 =3DA0CEI =3DA0 =3DA0 ((_EucInfo =
*)(_CurrentRuneLocale-&gt;_=3D
> _variable))<br>
> &gt; +#define =3DA0 =3DA0 =3DA0CEI =3DA0 =3DA0 ((_EucInfo =
*)(__getCurrentRuneLocale()=3D
> -&gt;__variable))<br>
> &gt;<br>
> &gt; #define =3DA0 =3DA0 =3DA0 _SS2 =3DA0 =3DA00x008e<br>
> &gt; #define =3DA0 =3DA0 =3DA0 _SS3 =3DA0 =3DA00x008f<br>
> &gt;<br>
> &gt;<br>
> &gt;<br>
> &gt; Please can you test this and let me know if it fixes it for =
you?<br>
> <br>
> </div>Actually, I&#39;m not sure how this bug can manifest, unless =
you&#39;=3D
> ve somehow built libc with the wrong headers. =3DA0In runtype.h (which =
is inc=3D
> luded in euc.c), we have this:<br>
> <br>
> #define _CurrentRuneLocale (__getCurrentRuneLocale())<br>
> <br>
> So these two versions should expand to the same thing.<br>
> <span class=3D3D"HOEnZb"><font color=3D3D"#888888"><br>
> David<br>
> <br>
> </font></span></blockquote></div><br><br =
clear=3D3D"all"><div><br></div>-- <b=3D
> r>Tomohisa Tanaka<br><a =
href=3D3D"mailto:Tomohisa.Tanaka@gmail.com">Tomohisa.=3D
> Tanaka@gmail.com</a>
> </div>
>=20
> --20cf303f672e1e5ef004f5e92be0--
> --20cf303f672e1e5ef404f5e92be2
> Content-Type: text/plain; charset=3DUS-ASCII; name=3D"report1.txt"
> Content-Disposition: attachment; filename=3D"report1.txt"
> Content-Transfer-Encoding: base64
> X-Attachment-Id: f_htfxye6m0
>=20
> =
JSBnY2MgLWczIG1haW4uYyB+L3dvcmsvZnJlZWJzZC11c3Itc3JjL2xpYi9saWJjL2xpYmMuYQ=
ol
> =
IGdkYiAuL2Eub3V0CkdOVSBnZGIgNi4xLjEgW0ZyZWVC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CA9IENFSS0+Y291bnRbc2V0ID0gX2V1Y1=
9z
> ZXQoKnMpXTsKKGdkYikgCg=3D=3D
> --20cf303f672e1e5ef404f5e92be2
> Content-Type: text/plain; charset=3DUS-ASCII; name=3D"report2.txt"
> Content-Disposition: attachment; filename=3D"report2.txt"
> Content-Transfer-Encoding: base64
> X-Attachment-Id: f_htfxyj7g1
>=20
> =
JSBjYXQgbWFpbjEuYwojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgojaW=
5j
> =
bHVkZSA8bG9jYWxlLmg+CiNpbmNsdWRlIDx4bG9jYWxlLmg+CiNpbmNsdWRlIDxydW5ldHlwZS=
5o
> =
PgoKc3RhdGljIHZvaWQKc2hvd1ZhcmlhYmxlcyh2b2lkKQp7CiAgcHJpbnRmKCJfVGhyZWFkUn=
Vu
> =
ZUxvY2FsZTogJXBcbiIsIF9UaHJlYWRSdW5lTG9jYWxlKTsKICBpZiAoX1RocmVhZFJ1bmVMb2=
Nh
> =
bGUgIT0gTlVMTCkgewogICAgcHJpbnRmKCJfVGhyZWFkUnVuZUxvY2FsZS0+X192YXJpYWJsZT=
og
> =
JXBcbiIsCiAgICAgICAgICAgX1RocmVhZFJ1bmVMb2NhbGUtPl9fdmFyaWFibGUpOwogIH0KIC=
Bw
> =
cmludGYoIl9fZ2V0Q3VycmVudFJ1bmVMb2NhbGUoKTogJXBcbiIsIF9fZ2V0Q3VycmVudFJ1bm=
VM
> =
b2NhbGUoKSk7CiAgaWYgKF9fZ2V0Q3VycmVudFJ1bmVMb2NhbGUoKSAhPSBOVUxMKSB7CiAgIC=
Bw
> =
cmludGYoIl9fZ2V0Q3VycmVudFJ1bmVMb2NhbGUoKS0+X192YXJpYWJsZTogJXBcbiIsCiAgIC=
Ag
> =
ICAgICAgX19nZXRDdXJyZW50UnVuZUxvY2FsZSgpLT5fX3ZhcmlhYmxlKTsKICB9CiAgcHJpbn=
Rm
> =
KCImX0RlZmF1bHRSdW5lTG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
> =
XQpfVGhyZWFkUnVuZUxvY2FsZTogMHg2MDBlZTAKX1RocmVhZFJ1bmVMb2NhbGUtPl9fdmFyaW=
Fi
> =
bGU6IDB4MApfX2dldEN1cnJlbnRSdW5lTG9jYWxlKCk6IDB4NjAwZWUwCl9fZ2V0Q3VycmVudF=
J1
> =
bmVMb2NhbGUoKS0+X192YXJpYWJsZTogMHgwCiZfRGVmYXVsdFJ1bmVMb2NhbGU6IDB4NjAwZW=
Uw
> =
CiZfRGVmYXVsdFJ1bmVMb2NhbGUtPl9fdmFyaWFibGU6IDB4MAoKUHJvZ3JhbSByZWNlaXZlZC=
Bz
> =
aWduYWwgU0lHU0VHViwgU2VnbWVudGF0aW9uIGZhdWx0LgoweDAwMDAwMDA4MDA5MDg4ODAgaW=
4g
> bWJzbnJ0b3djcyAoKSBmcm9tIC9saWIvbGliYy5zby43CihnZGIpIAo=3D
> --20cf303f672e1e5ef404f5e92be2--
> _______________________________________________
> freebsd-standards@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-standards
> To unsubscribe, send any mail to =
"freebsd-standards-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?205C5DD1-C26B-4F6A-B640-C78E22D0567B>