This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible bug in wcsxfrm() with included testcase


On Tue, 2003-07-22 at 11:08, Art Haas wrote:
> On Tue, Jul 22, 2003 at 04:35:42PM +0200, Jakub Jelinek wrote:
> > On Tue, Jul 22, 2003 at 09:28:52AM -0500, Art Haas wrote:
> > > I've run the amended testcase again and still see the crash. Would you
> > > try it again?
> > 
> > I see no crashes with it (both with glibc from yesterday and ~ a month
> > old glibc), but the testcase depends on a) what locale this is run
> > b) the content of /tmp
> > If this should be a self-contained testcase, it should use a specific
> > locale instead of "" and should not depend on content of some directory.
> > 
> 
> I was using '/tmp' just as an example. The choice of directories aside,
> the setlocale(LC_COLLATE, "") is taken from the glib/gunicollate.c code.
> I don't have an LC_COLLATE environment variable defined in my environment,
> but I just tried running this program like so:
> 
> $ LC_COLLATE=en_US EF_PROTECT_BELOW=1 ef ./wcsxfrm_test /tmp
> 
> and it ran without problems, so my possible bug report is wrong. Thanks
> for looking at this.

setlocale(LC_COLLATE, "") says to take the LC_COLLATE value from the
current value in your environment; first it will look at the LC_ALL
environment variable, then the LC_COLLATE environment variable,
then at LANG, then uses "C" if that's not set.

So, if it works with LC_COLLATE=en_US then look at your LANG environment
variable, and you'll find the offending locale.

You can then change the test case to setlocale (LC_COLLATE, "blah");

What Jakub was saying about /tmp is that you are getting a test set
of strings from whatever filenames are in /tmp, which is different on
your system then on anybody else's. It would be better to simply have
an array in the test case with the strings, or to read them from
stdin out of a file provided with the test case.

Regards,
						Owen



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]