[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: 64bit issue in libraries/liblunicode/ucdata/ucdata.c causes slapd to dump core (ITS#1960)

I've committed a quick hack which should resolve the
problem on most systems.  However, the code is inheritly
non-portable.  The code should assume the *.dat files
are platform specific, not worry about byte ordering
(except for a safety check), and have all writes use
one type (int or long).  Don't have time to re-write
it presently, patch welcomed.


At 01:22 PM 2002-07-17, rhafer@suse.de wrote:
>Full_Name: Ralf Haferkamp
>Version: HEAD
>OS: LInux on IA64
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (
>At the top of the file the following struct is defined:
>typedef struct {
>    unsigned short bom;
>    unsigned short cnt;
>    union {
>        unsigned long bytes;
>        unsigned short len[2];
>    } size;
>} _ucheader_t;
>The type "long" is however 8 bytes long on (most) 64Bit Archs. So the union
>"size" make some trouble, when you access it through the len[] array.
>One workaround could be to change the "long" to "uint32_t" which is available on
>Linux but I am not sure how portable this is. Is there a "uint32_t" on BSD?
>If I make this change slapd seems to work flawlessly. All test cases succeed.