[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: some failing tests
From: |
Bruno Haible |
Subject: |
Re: some failing tests |
Date: |
Sat, 20 Oct 2007 15:00:20 +0200 |
User-agent: |
KMail/1.5.4 |
Hello Ralf,
Thanks for this testing! x86_64 platforms are important nowadays.
> ../../gltests/test-ceilf2.c:125: assertion failed
> /bin/sh: line 4: 6728 Aborted (core dumped) EXEEXT='' [...]
> srcdir='../../gltests' [...] ${dir}$tst
> FAIL: test-ceilf2
>
> ../../gltests/test-floorf2.c:125: assertion failed
> /bin/sh: line 4: 6843 Aborted (core dumped) EXEEXT='' [...]
> srcdir='../../gltests' [...] ${dir}$tst
> FAIL: test-floorf2
Fixed. The test unintentionally relied on excess precision, whereas the
x86_64 (or the code emitted by gcc for this CPU) rounds as it should.
> ../../gltests/unistdio/test-u16-printf1.h:29: assertion failed
> /bin/sh: line 4: 7356 Aborted (core dumped) [...]
> LOCALE_FR='none' LOCALE_TR_UTF8='none' srcdir='../../gltests'
> LOCALE_TR_UTF8='none' LOCALE_FR_UTF8='none' LOCALE_TR_UTF8='none'
> LOCALE_ZH_CN='none' LOCALE_ZH_CN='none' LOCALE_FR_UTF8='none'
> LOCALE_TR_UTF8='none' LOCALE_FR_UTF8='none' LOCALE_TR_UTF8='none'
> LOCALE_ZH_CN='none' LOCALE_FR_UTF8='none' LOCALE_FR_UTF8='none'
> LOCALE_ZH_CN='none' LOCALE_FR='none' LOCALE_FR_UTF8='none' LOCALE_FR='none'
> LOCALE_FR_UTF8='none' LOCALE_FR='none' LOCALE_FR_UTF8='none' LOCALE_FR='none'
> LOCALE_FR_UTF8='none' LOCALE_FR='none' LOCALE_FR_UTF8='none' EXEEXT=''
> ${dir}$tst
> FAIL: test-u16-vsprintf1
>
> Some debugging shows me that in u16_vasnprintf, around vasnprintf.c:3433,
> this is triggered:
> if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
> goto overflow;
Fixed as shown below. Thanks!
> Furthermore, I get this output, which I guess is either undesired or
> should be hidden from the user:
>
> ./test-yesno: error closing file: Bad file descriptor
> PASS: test-yesno.sh
Eric?
Bruno
2007-10-20 Bruno Haible <address@hidden>
* lib/vasnprintf.c (VASNPRINTF): Don't report overflow if the available
length is INT_MAX and sizeof (DCHAR_T) > sizeof (TCHAR_T).
Reported by Ralf Wildenhues <address@hidden>.
*** lib/vasnprintf.c.orig 2007-10-20 14:52:26.000000000 +0200
--- lib/vasnprintf.c 2007-10-20 14:47:57.000000000 +0200
***************
*** 3442,3448 ****
/* SNPRINTF can fail if its second argument is
> INT_MAX. */
if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
! goto overflow;
maxlen = maxlen * TCHARS_PER_DCHAR;
# define SNPRINTF_BUF(arg) \
switch (prefix_count) \
--- 3442,3448 ----
/* SNPRINTF can fail if its second argument is
> INT_MAX. */
if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
! maxlen = INT_MAX / TCHARS_PER_DCHAR;
maxlen = maxlen * TCHARS_PER_DCHAR;
# define SNPRINTF_BUF(arg) \
switch (prefix_count) \
***************
*** 3663,3679 ****
/* Handle overflow of the allocated buffer. */
if (count >= maxlen)
{
! /* Need at least count * sizeof (TCHAR_T) bytes. But
! allocate proportionally, to avoid looping eternally
! if snprintf() reports a too small count. */
! size_t n =
! xmax (xsum (length,
! (count + TCHARS_PER_DCHAR - 1)
! / TCHARS_PER_DCHAR),
! xtimes (allocated, 2));
! ENSURE_ALLOCATION (n);
! continue;
}
#endif
--- 3663,3688 ----
/* Handle overflow of the allocated buffer. */
if (count >= maxlen)
{
! /* If maxlen already has attained its allowed maximum,
! allocating more memory will not increase maxlen.
! Instead of looping, bail out. */
! if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
! goto overflow;
! else
! {
! /* Need at least count * sizeof (TCHAR_T) bytes.
! But allocate proportionally, to avoid looping
! eternally if snprintf() reports a too small
! count. */
! size_t n =
! xmax (xsum (length,
! (count + TCHARS_PER_DCHAR - 1)
! / TCHARS_PER_DCHAR),
! xtimes (allocated, 2));
! ENSURE_ALLOCATION (n);
! continue;
! }
}
#endif