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]

Re: regex.c is not 64bit clean


On Wed, Feb 07, 2001 at 09:31:18PM +0900, Isamu Hasegawa wrote:
> "H . J . Lu" <hjl@valinux.com> wrote:
> > regex still doesn't work on my ia64. It failed at test
> 
> At last, I noticed that I had an invalid assumption.
> Though wctype_t is defined as unsigned long int, I thought
> the size of wctype_t is not larger than the size of wchar_t.
> 
> I think following patch will fix the problem.
> (I can't test on ia64, so if there are still some problems,
>  please let me know.)
> In addition this patch is against
> regex.c(rev 1.87) + the patch I sent some time ago.
> 

It is still not 64bit clean. I got

foo(24064): unaligned access to 0x6000000000010b9c, ip=0x4000000000013d80
foo(24064): unaligned access to 0x6000000000010ba4, ip=0x400000000001c870
foo(24064): unaligned access to 0x6000000000010ba4, ip=0x400000000001c870
foo(24064): unaligned access to 0x6000000000010ba4, ip=0x400000000001c870

The problems are

1. At line 2829

	*((wctype_t*)(laststart + 6)) = wt;

wctype_t needs 8byte alignment and laststart is a pointer to
wchar_t which has 4byte alignment.

2. At line 6006

	wctype_t wctype = *((wctype_t*)workp);

wctype_t needs 8byte alignment and workp is a pointer to
wchar_t which has 4byte alignment.

One way to get around it is to use memmove. But I'd like to see
a better fix.


H.J.

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