From ae9e937241bed564572618e5affe9af4b6a87d27 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 29 Jul 2005 23:40:08 +0000 Subject: Updated to fedora-glibc-2_3-20050729T2336 --- ChangeLog | 26 ++++++++++++ configure | 83 ++++++++++++++++++++++++++++++++++++++- fedora/branch.mk | 4 +- misc/Makefile | 13 +++++- misc/error.c | 34 +++++++++++++--- misc/tst-error1.c | 26 ++++++++++++ nptl/ChangeLog | 2 + nscd/grpcache.c | 2 +- sysdeps/ieee754/flt-32/e_atan2f.c | 2 +- sysdeps/s390/fpu/libm-test-ulps | 15 +++---- sysdeps/x86_64/fpu/libm-test-ulps | 15 +++---- 11 files changed, 192 insertions(+), 30 deletions(-) create mode 100644 misc/tst-error1.c diff --git a/ChangeLog b/ChangeLog index d215767101..5cec35b4e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2005-07-20 Ulrich Drepper + + [BZ #1138] + * sysdeps/x86_64/fpu/libm-test-ulps: Adjust expected atan2f results. + * sysdeps/powerpc/fpu/libm-test-ulps: Likewise. + * sysdeps/s390/fpu/libm-test-ulps: Likewise. + +2005-07-20 Bob Wilson + Darin Petkov + + [BZ #1138] + * sysdeps/ieee754/flt-32/e_atan2f.c (pi_lo): Correct exponent value. + +2005-07-19 Ulrich Drepper + + [BZ #1137] + * misc/Makefile: Add rules to build and run tst-error1. + * misc/tst-error1.c: New file. + * misc/error.c: Fix memory leak and possibly endless loop. + +2005-07-18 Ulrich Drepper + + [BZ #1113] + * nscd/grpcache.c (cache_addgr): Use correct maximum for group ID + length. Patch by Ivan Gyurdiev . + 2005-07-15 Andreas Jaeger [BZ #1079] diff --git a/configure b/configure index 93fff2a64d..c06de4f6a4 100755 --- a/configure +++ b/configure @@ -313,7 +313,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini libc_cv_cpp_asm_debuginfo no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES linux_doors mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -6775,6 +6775,86 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_SELINUX 1 _ACEOF + + # See if we have the libaudit library + echo "$as_me:$LINENO: checking for audit_log_avc in -laudit" >&5 +echo $ECHO_N "checking for audit_log_avc in -laudit... $ECHO_C" >&6 +if test "${ac_cv_lib_audit_audit_log_avc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-laudit $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char audit_log_avc (); +int +main () +{ +audit_log_avc (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_audit_audit_log_avc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_audit_audit_log_avc=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_audit_audit_log_avc" >&5 +echo "${ECHO_T}$ac_cv_lib_audit_audit_log_avc" >&6 +if test $ac_cv_lib_audit_audit_log_avc = yes; then + have_libaudit=yes +else + have_libaudit=no +fi + + if test "x$have_libaudit" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBAUDIT 1 +_ACEOF + + fi + fi @@ -8394,6 +8474,7 @@ s,@libc_cv_cpp_asm_debuginfo@,$libc_cv_cpp_asm_debuginfo,;t t s,@no_whole_archive@,$no_whole_archive,;t t s,@exceptions@,$exceptions,;t t s,@LIBGD@,$LIBGD,;t t +s,@have_libaudit@,$have_libaudit,;t t s,@have_selinux@,$have_selinux,;t t s,@EGREP@,$EGREP,;t t s,@sizeof_long_double@,$sizeof_long_double,;t t diff --git a/fedora/branch.mk b/fedora/branch.mk index 04bafb09c6..960d775026 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora-2_3 glibc-base := glibc-2_3-branch DIST_BRANCH := FC-3 COLLECTION := dist-fc3-updates-candidate -fedora-2_3-sync-date := 2005-07-18 08:04 UTC -fedora-2_3-sync-tag := fedora-glibc-2_3-20050718T0804 +fedora-2_3-sync-date := 2005-07-29 23:36 UTC +fedora-2_3-sync-tag := fedora-glibc-2_3-20050729T2336 diff --git a/misc/Makefile b/misc/Makefile index 862eb1b800..b4c106c0cb 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -65,6 +65,8 @@ routines := brk sbrk sstk ioctl \ distribute := device-nrs.h +generated := tst-error1.mtrace tst-error1-mem + include ../Makeconfig aux := init-misc @@ -73,7 +75,11 @@ install-lib := libbsd-compat.a libg.a endif gpl2lgpl := error.c error.h -tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch +tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \ + tst-error1 +ifeq (no,$(cross-compiling)) +tests: $(objpfx)tst-error1-mem +endif CFLAGS-tsearch.c = $(uses-callbacks) CFLAGS-lsearch.c = $(uses-callbacks) @@ -106,3 +112,8 @@ endif ifeq ($(build-bounded),yes) $(objpfx)tst-tsearch-bp: $(common-objpfx)math/libm_b.a endif + +tst-error1-ENV = MALLOC_TRACE=$(objpfx)tst-error1.mtrace +tst-error1-ARGS = $(objpfx)tst-error1.out +$(objpfx)tst-error1-mem: $(objpfx)tst-error1.out + $(common-objpfx)malloc/mtrace $(objpfx)tst-error1.mtrace > $@ diff --git a/misc/error.c b/misc/error.c index 2501583366..b608913fae 100644 --- a/misc/error.c +++ b/misc/error.c @@ -74,6 +74,7 @@ unsigned int error_message_count; # define program_name program_invocation_name # include +# include # include /* In GNU libc we want do not want to use the common name `error' directly. @@ -182,14 +183,15 @@ error_tail (int status, int errnum, const char *message, va_list args) mbstate_t st; size_t res; const char *tmp; + bool use_malloc = false; - do + while (1) { - if (len < ALLOCA_LIMIT) + if (__libc_use_alloca (len * sizeof (wchar_t))) wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); else { - if (wmessage != NULL && len / 2 < ALLOCA_LIMIT) + if (!use_malloc) wmessage = NULL; wchar_t *p = (wchar_t *) realloc (wmessage, @@ -201,18 +203,38 @@ error_tail (int status, int errnum, const char *message, va_list args) return; } wmessage = p; + use_malloc = true; } memset (&st, '\0', sizeof (st)); tmp = message; + + res = mbsrtowcs (wmessage, &tmp, len, &st); + if (res != len) + break; + + if (__builtin_expect (len >= SIZE_MAX / 2, 0)) + { + /* This really should not happen if everything is fine. */ + res = (size_t) -1; + break; + } + + len *= 2; } - while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len); if (res == (size_t) -1) - /* The string cannot be converted. */ - wmessage = (wchar_t *) L"???"; + { + /* The string cannot be converted. */ + if (use_malloc) + free (wmessage); + wmessage = (wchar_t *) L"???"; + } __vfwprintf (stderr, wmessage, args); + + if (use_malloc) + free (wmessage); } else # endif diff --git a/misc/tst-error1.c b/misc/tst-error1.c new file mode 100644 index 0000000000..e84843ed2f --- /dev/null +++ b/misc/tst-error1.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +static int +do_test (int argc, char *argv[]) +{ + mtrace (); + (void) freopen (argc == 1 ? "/dev/stdout" : argv[1], "a", stderr); + /* Orient the stream. */ + fwprintf (stderr, L"hello world\n"); + char buf[20000]; + static const char str[] = "hello world! "; + for (int i = 0; i < 1000; ++i) + memcpy (&buf[i * (sizeof (str) - 1)], str, sizeof (str)); + error (0, 0, str); + error (0, 0, buf); + error (0, 0, buf); + error (0, 0, str); + return 0; +} + +#define TEST_FUNCTION do_test (argc, argv) +#include "../test-skeleton.c" diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 13ae7372bc..db8057a48e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -19,6 +19,7 @@ 2005-04-27 Ulrich Drepper + [BZ #1075] * tst-cancel17.c (do_test): Add arbitrary factor to make sure aio_write blocks. @@ -31,6 +32,7 @@ 2005-03-23 Ulrich Drepper + [BZ #1112] * pthread_create.c (__pthread_create_2_1): Rename syscall error variable to scerr. diff --git a/nscd/grpcache.c b/nscd/grpcache.c index 7b6e223f17..b6ea26b654 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.c @@ -167,7 +167,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, char *gr_name; char *cp; const size_t key_len = strlen (key); - const size_t buf_len = 3 + sizeof (grp->gr_gid) + key_len + 1; + const size_t buf_len = 3 * sizeof (grp->gr_gid) + key_len + 1; char *buf = alloca (buf_len); ssize_t n; size_t cnt; diff --git a/sysdeps/ieee754/flt-32/e_atan2f.c b/sysdeps/ieee754/flt-32/e_atan2f.c index 8b3398c0a3..c0cafb16b8 100644 --- a/sysdeps/ieee754/flt-32/e_atan2f.c +++ b/sysdeps/ieee754/flt-32/e_atan2f.c @@ -30,7 +30,7 @@ zero = 0.0, pi_o_4 = 7.8539818525e-01, /* 0x3f490fdb */ pi_o_2 = 1.5707963705e+00, /* 0x3fc90fdb */ pi = 3.1415927410e+00, /* 0x40490fdb */ -pi_lo = -8.7422776573e-07; /* 0xb3bbbd2e */ +pi_lo = -8.7422776573e-08; /* 0xb3bbbd2e */ #ifdef __STDC__ float __ieee754_atan2f(float y, float x) diff --git a/sysdeps/s390/fpu/libm-test-ulps b/sysdeps/s390/fpu/libm-test-ulps index cfade822a3..552ad4afae 100644 --- a/sysdeps/s390/fpu/libm-test-ulps +++ b/sysdeps/s390/fpu/libm-test-ulps @@ -2,17 +2,14 @@ # atan2 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 +float: 1 +ifloat: 1 Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 +float: 1 +ifloat: 1 Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": float: 1 ifloat: 1 -Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112": -float: 6 -ifloat: 6 # atanh Test "atanh (0.75) == 0.972955074527656652552676371721589865": @@ -664,8 +661,8 @@ idouble: 1 # Maximal error of functions: Function: "atan2": -float: 6 -ifloat: 6 +float: 1 +ifloat: 1 Function: "atanh": float: 1 diff --git a/sysdeps/x86_64/fpu/libm-test-ulps b/sysdeps/x86_64/fpu/libm-test-ulps index b3ce8bfeee..425549dd0e 100644 --- a/sysdeps/x86_64/fpu/libm-test-ulps +++ b/sysdeps/x86_64/fpu/libm-test-ulps @@ -24,17 +24,14 @@ ldouble: 1 # atan2 Test "atan2 (-0.75, -1.0) == -2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 +float: 1 +ifloat: 1 Test "atan2 (0.75, -1.0) == 2.49809154479650885165983415456218025": -float: 3 -ifloat: 3 +float: 1 +ifloat: 1 Test "atan2 (1.390625, 0.9296875) == 0.981498387184244311516296577615519772": float: 1 ifloat: 1 -Test "atan2 (-0.00756827042671106339, -.001792735857538728036) == -1.80338464113663849327153994379639112": -float: 6 -ifloat: 6 # atanh Test "atanh (0.75) == 0.972955074527656652552676371721589865": @@ -953,8 +950,8 @@ ildouble: 1 ldouble: 1 Function: "atan2": -float: 6 -ifloat: 6 +float: 1 +ifloat: 1 Function: "atanh": float: 1 -- cgit v1.2.3