wcsxfrm broken?
Andreas Jaeger
aj@suse.de
Mon Aug 6 06:59:00 GMT 2001
The appended program gives a segmentation fault on 64-bit plattforms
I(I tested ia64 and alpha):
brouwer:/tmp # ./a.out
setlocale returns th_TH.TIS-620
mbstowcs returned: 1
Segmentation fault
The segmenation fault occurs in findidx (locale/weightwc.h:44). It
seems that the weight table is corrupt.
This still fails with today's CVS sources - which build fine otherwise
on ia64 and Athlon machines.
Any ideas/suggestions?
Andreas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define _GNU_SOURCE 1
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <wctype.h>
#include <wchar.h>
int main(int argc, char** argv)
{
char *c;
int n;
wchar_t w_s2t[100];
wchar_t w_s2[50];
char *s2 = "ã";
size_t ret;
c=setlocale(LC_ALL, "th_TH.TIS-620");
printf("setlocale returns %s\n", c == NULL ? "NULL" : c);
ret = mbstowcs(w_s2, s2, 50);
printf ("mbstowcs returned: %zd\n", ret);
n = wcsxfrm(w_s2t, w_s2, 0);
printf("wcsxfrm returns %d\n", n);
return 0;
}
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
More information about the Libc-hacker
mailing list