bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with directory trees "confdir-14B---" and "confdir3"


From: Peter Dyballa
Subject: Re: Problems with directory trees "confdir-14B---" and "confdir3"
Date: Sun, 9 Jan 2022 12:10:13 +0100

Hello!

I managed to set up "my" configure to run quite similar to that in MacPorts. Differences are (MacPorts vs. me):

        checking whether getcwd aborts when 4k < cwd_length < 16k... no

vs.

        checking whether getcwd aborts when 4k < cwd_length < 16k... yes

and of course the reports about not being able to remove the "confdir-14B---" and "confdir3" directory trees, i n MacPorts. Looking into the config.log files I see (MacPorts vs. me):

configure:26149: checking whether getcwd aborts when 4k < cwd_length < 16k configure:26285: /usr/bin/gcc-4.2 -std=gnu99 -o conftest -pipe -Os - arch ppc -I/opt/local/include -L/opt/local/lib -Wl,- headerpad_max_install_names -arch ppc conftest.c >&5
        configure:26285: $? = 0
        configure:26285: ./conftest
        configure:26285: $? = 0
        configure:26302: result: no
        configure:26539: checking for flockfile
        
vs.
        
configure:26149: checking whether getcwd aborts when 4k < cwd_length < 16k configure:26285: /usr/bin/gcc-4.2 -std=gnu99 -o conftest -pipe -Os - arch ppc -I/opt/local/include -L/opt/local/lib -Wl,- headerpad_max_install_names -arch ppc conftest.c >&5
        configure:26285: $? = 0
        configure:26285: ./conftest
        configure:26285: $? = 4
        configure: program exited with status 4
        configure: failed program was:
        | /* confdefs.h */
        | #define PACKAGE_NAME "GNU findutils"
        | #define PACKAGE_TARNAME "findutils"
        | #define PACKAGE_VERSION "4.7.0"
        | #define PACKAGE_STRING "GNU findutils 4.7.0"
        | #define PACKAGE_BUGREPORT "bug-findutils@gnu.org"
        | #define PACKAGE_URL "http://www.gnu.org/software/findutils/";
| #define PACKAGE_BUGREPORT_URL "https://savannah.gnu.org/bugs/?group=findutils "
        | #define PACKAGE "findutils"
        | #define VERSION "4.7.0"
        | #define LEAF_OPTIMISATION 1
        | #define STDC_HEADERS 1
        | #define HAVE_SYS_TYPES_H 1
        | #define HAVE_SYS_STAT_H 1
        | #define HAVE_STDLIB_H 1
        | #define HAVE_STRING_H 1
        | #define HAVE_MEMORY_H 1
        | #define HAVE_STRINGS_H 1
        | #define HAVE_INTTYPES_H 1
        | #define HAVE_STDINT_H 1
        | #define HAVE_UNISTD_H 1
        | #define __EXTENSIONS__ 1
        | #define _ALL_SOURCE 1
        | #define _DARWIN_C_SOURCE 1
        | #define _GNU_SOURCE 1
        | #define _NETBSD_SOURCE 1
        | #define _OPENBSD_SOURCE 1
        | #define _POSIX_PTHREAD_SEMANTICS 1
        | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
        | #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
        | #define __STDC_WANT_IEC_60559_DFP_EXT__ 1
        | #define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
        | #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
        | #define __STDC_WANT_LIB_EXT2__ 1
        | #define __STDC_WANT_MATH_SPEC_FUNCS__ 1
        | #define _TANDEM_SOURCE 1
        | #define _HPUX_ALT_XOPEN_SOCKET_API 1
        | #define HAVE_FSEEKO 1
        | #define _DARWIN_USE_64_BIT_INODE 1
        | #define _DARWIN_USE_64_BIT_INODE 1
        | #define HAVE_ALLOCA_H 1
        | #define HAVE_ALLOCA 1
        | #define HAVE_BTOWC 1
        | #define HAVE_REALPATH 1
        | #define HAVE_FCHDIR 1
        | #define HAVE_FCNTL 1
        | #define HAVE_SYMLINK 1
        | #define HAVE_FNMATCH 1
        | #define HAVE_ISBLANK 1
        | #define HAVE_ISWCTYPE 1
        | #define HAVE_MBSRTOWCS 1
        | #define HAVE_WMEMCHR 1
        | #define HAVE_WMEMCPY 1
        | #define HAVE_FPURGE 1
        | #define HAVE_FSTATFS 1
        | #define HAVE_GETDTABLESIZE 1
        | #define HAVE_GETPROGNAME 1
        | #define HAVE_GETTIMEOFDAY 1
        | #define HAVE_ISWCNTRL 1
        | #define HAVE_ISWBLANK 1
        | #define HAVE_LSTAT 1
        | #define HAVE_MBSINIT 1
        | #define HAVE_MBRTOWC 1
        | #define HAVE_ISASCII 1
        | #define HAVE_MPROTECT 1
        | #define HAVE_TZSET 1
        | #define HAVE_NL_LANGINFO 1
        | #define HAVE_STRERROR_R 1
        | #define HAVE_READLINK 1
        | #define HAVE_FPATHCONF 1
        | #define HAVE_SETENV 1
        | #define HAVE_SNPRINTF 1
        | #define HAVE_STRDUP 1
        | #define HAVE_CATGETS 1
        | #define HAVE_STRTOUMAX 1
        | #define HAVE_LOCALTIME_R 1
        | #define HAVE_TIMEGM 1
        | #define HAVE_PIPE 1
        | #define HAVE_WCRTOMB 1
        | #define HAVE_WCWIDTH 1
        | #define HAVE_FTRUNCATE 1
        | #define HAVE_NEWLOCALE 1
        | #define HAVE_USELOCALE 1
        | #define HAVE_DUPLOCALE 1
        | #define HAVE_FREELOCALE 1
        | #define HAVE_PTHREAD_SIGMASK 1
        | #define HAVE_SIGACTION 1
        | #define HAVE_SIGALTSTACK 1
        | #define HAVE_SIGINTERRUPT 1
        | #define HAVE_SLEEP 1
        | #define HAVE_SHUTDOWN 1
        | #define HAVE_USLEEP 1
        | #define HAVE_WCTOB 1
        | #define HAVE_LANGINFO_CODESET 1
        | #define HAVE_UNISTD_H 1
        | #define HAVE_SYS_PARAM_H 1
        | #define HAVE_SYS_SOCKET_H 1
        | #define HAVE_DIRENT_H 1
        | #define HAVE_FNMATCH_H 1
        | #define HAVE_WCTYPE_H 1
        | #define HAVE_SYS_STAT_H 1
        | #define HAVE_NETDB_H 1
        | #define HAVE_GETOPT_H 1
        | #define HAVE_SYS_CDEFS_H 1
        | #define HAVE_SYS_TIME_H 1
        | #define HAVE_LIMITS_H 1
        | #define HAVE_WCHAR_H 1
        | #define HAVE_STDINT_H 1
        | #define HAVE_INTTYPES_H 1
        | #define HAVE_LANGINFO_H 1
        | #define HAVE_XLOCALE_H 1
        | #define HAVE_MATH_H 1
        | #define HAVE_SYS_MMAN_H 1
        | #define HAVE_SYS_STATVFS_H 1
        | #define HAVE_SYS_TYPES_H 1
        | #define HAVE_STRINGS_H 1
        | #define HAVE_SYS_UIO_H 1
        | #define HAVE_SYS_UTSNAME_H 1
        | #define HAVE_SYS_WAIT_H 1
        | #define HAVE_ARPA_INET_H 1
        | #define HAVE_NETINET_IN_H 1
        | #define HAVE_SEMAPHORE_H 1
        | #define HAVE_SYS_SELECT_H 1
        | #define HAVE_SYS_IOCTL_H 1
        | #define HAVE_DECL_STRERROR_R 1
        | #define HAVE_STRERROR_R 1
        | #define GETGROUPS_T gid_t
        | #define HAVE_DECL_FCHDIR 1
        | #define HAVE_WORKING_O_NOATIME 0
        | #define HAVE_WORKING_O_NOFOLLOW 1
        | #define PROMOTED_MODE_T int
        | #define HAVE_DECL_STRMODE 1
        | #define HAVE_MBSTATE_T 1
        | #define _USE_STD_STAT 1
        | #define HAVE_DECL_FSEEKO 1
        | #define FUNC_FFLUSH_STDIN 0
        | #define HAVE_DECL_FTELLO 1
        | #define HAVE_DECL_GETCWD 1
        | #define HAVE_DECL_GETDELIM 0
        | #define HAVE_DECL_GETDTABLESIZE 1
        | #define HAVE_DECL_GETLINE 0
        | #define HAVE_GETOPT_H 1
        | #define HAVE_GETOPT_LONG_ONLY 1
        | #define restrict /**/
        | #define HAVE_WINT_T 1
        | #define HAVE_UNSIGNED_LONG_LONG_INT 1
        | #define HAVE_LONG_LONG_INT 1
        | #define BITSIZEOF_PTRDIFF_T 32
        | #define BITSIZEOF_SIZE_T 32
        | #define BITSIZEOF_SIG_ATOMIC_T 32
        | #define BITSIZEOF_WCHAR_T 32
        | #define BITSIZEOF_WINT_T 32
        | #define HAVE_SIGNED_SIG_ATOMIC_T 1
        | #define HAVE_SIGNED_WCHAR_T 1
        | #define HAVE_SIGNED_WINT_T 1
        | #define PTRDIFF_T_SUFFIX
        | #define SIZE_T_SUFFIX ul
        | #define SIG_ATOMIC_T_SUFFIX
        | #define WCHAR_T_SUFFIX
        | #define WINT_T_SUFFIX
        | #define HAVE_INTTYPES_H 1
        | #define WORDS_BIGENDIAN 1
        | #define DBL_EXPBIT0_WORD 0
        | #define DBL_EXPBIT0_BIT 20
        | #define FLT_EXPBIT0_WORD 0
        | #define FLT_EXPBIT0_BIT 23
        | #define HAVE_TOWLOWER 1
        | #define HAVE_WCHAR_T 1
        | #define USE_POSIX_THREADS 1
        | #define HAVE_STDLIB_H 1
        | #define MALLOC_0_IS_NONNULL 1
        | #define MAP_ANONYMOUS MAP_ANON
        | #define HAVE_MAP_ANONYMOUS 1
        | #define HAVE_DECL_MEMRCHR 0
        | #define HAVE_MINMAX_IN_SYS_PARAM_H 1
        | #define TIME_T_IS_SIGNED 1
        | #define HAVE_DECL_ALARM 1
        | #define HAVE_DECL_TRUNC 1
        | #define HAVE_STRUCT_TM_TM_ZONE 1
        | #define HAVE_TM_ZONE 1
        | #define HAVE_TM_GMTOFF 1
        | #define HAVE__BOOL 1
        | #define HAVE_COMPOUND_LITERALS 1
        | #define REPLACE_STRERROR_0 1
        | #define HAVE_DECL_STRERROR_R 1
        | #define HAVE_LONG_FILE_NAMES 1
        | #define HAVE_DECL_SETENV 1
        | #define HAVE_SEARCH_H 1
        | #define HAVE_TSEARCH 1
        | #define HAVE_DECL_SNPRINTF 1
        | #define HAVE_STRCASESTR 1
        | #define HAVE_DECL_STRDUP 1
        | #define HAVE_DECL_STRNDUP 0
        | #define HAVE_DECL_STRNLEN 0
        | #define HAVE_DECL_STRTOUMAX 1
        | #define HAVE_SHUTDOWN 1
        | #define HAVE_STRUCT_SOCKADDR_STORAGE 1
        | #define HAVE_SA_FAMILY_T 1
        | #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
        | #define HAVE_DECL_UNSETENV 1
        | #define HAVE_INTTYPES_H_WITH_UINTMAX 1
        | #define HAVE_STDINT_H_WITH_UINTMAX 1
        | #define HAVE_INTMAX_T 1
        | #define HAVE_SNPRINTF 1
        | #define HAVE_WCSLEN 1
        | #define HAVE_MBRTOWC 1
        | #define HAVE_WCRTOMB 1
        | #define HAVE_DECL__SNPRINTF 0
        | #define HAVE_SNPRINTF_RETVAL_C99 1
        | #define HAVE_IPV4 1
        | #define HAVE_IPV6 1
        | #define HAVE_LC_MESSAGES 1
        | #define HAVE_WORKING_USELOCALE 1
        | #define HAVE_CFPREFERENCESCOPYAPPVALUE 1
        | #define HAVE_CFLOCALECOPYCURRENT 1
        | #define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1
        | #define HAVE_SIGSET_T 1
        | #define HAVE_ALLOCA 1
        | #define GNULIB_AREADLINKAT 1
        | #define GNULIB_TEST_BTOWC 1
        | #define HAVE___BUILTIN_EXPECT 1
        | #define GNULIB_CANONICALIZE 1
        | #define GNULIB_TEST_CANONICALIZE 1
        | #define GNULIB_TEST_CANONICALIZE_FILE_NAME 1
        | #define GNULIB_TEST_CHDIR 1
        | #define GNULIB_TEST_CLOEXEC 1
        | #define GNULIB_TEST_CLOSE 1
        | #define GNULIB_CLOSE_STREAM 1
        | #define HAVE_CLOSEDIR 1
        | #define GNULIB_TEST_CLOSEDIR 1
        | #define D_INO_IN_DIRENT 1
        | #define HAVE_STRUCT_DIRENT_D_TYPE 1
        | #define GNULIB_DIRENT_SAFER 1
        | #define HAVE_DECL_DIRFD 1
        | #define GNULIB_TEST_DIRFD 1
        | #define GNULIB_DIRNAME 1
        | #define GNULIB_TEST_DUP 1
        | #define HAVE_DUP2 1
        | #define GNULIB_TEST_DUP2 1
        | #define GNULIB_TEST_ENVIRON 1
        | #define HAVE_LIBGEN_H 1
        | #define HAVE_GETGROUPS 1
        | #define GNULIB_TEST_EUIDACCESS 1
        | #define HAVE_ACCESS 1
        | #define GNULIB_FACCESSAT 1
        | #define GNULIB_TEST_FACCESSAT 1
        | #define GNULIB_TEST_FCHDIR 1
        | #define GNULIB_TEST_FCNTL 1
        | #define GNULIB_FCNTL_SAFER 1
        | #define GNULIB_FD_SAFER_FLAG 1
        | #define HAVE_DECL_FDOPENDIR 0
        | #define GNULIB_TEST_FDOPENDIR 1
        | #define GNULIB_FDOPENDIR 1
        | #define FUNC_FFLUSH_STDIN 0
        | #define GNULIB_FFLUSH 1
        | #define GNULIB_TEST_FFLUSH 1
        | #define HAVE_STRUCT_STAT_ST_BLOCKS 1
        | #define HAVE_ST_BLOCKS 1
        | #define FLEXIBLE_ARRAY_MEMBER /**/
        | #define HAVE_DECL_ISBLANK 1
        | #define GNULIB_TEST_FNMATCH 1
        | #define HAVE_DECL_ISBLANK 1
        | #define GNULIB_FNMATCH_GNU 1
        | #define GNULIB_TEST_FOPEN 1
        | #define GNULIB_FOPEN_SAFER 1
        | #define HAVE_DECL_FPURGE 1
        | #define GNULIB_TEST_FPURGE 1
        | #define GNULIB_TEST_FSEEK 1
        | #define FUNC_FFLUSH_STDIN 0
        | #define GNULIB_TEST_FSEEKO 1
        | #define GNULIB_TEST_FSTAT 1
        | #define GNULIB_TEST_FSTATAT 1
        | #define GNULIB_TEST_FTELL 1
        | #define GNULIB_TEST_FTELLO 1
        | #define fts_open rpl_fts_open
        | #define fts_close rpl_fts_close
        | #define fts_read rpl_fts_read
        | #define fts_set rpl_fts_set
        | #define fts_children rpl_fts_children
        | #define fts_cross_check rpl_fts_cross_check
        | #define HAVE_GETPAGESIZE 1
        | /* end confdefs.h.  */
        |
        | #include <errno.h>
        | #include <stdlib.h>
        | #if HAVE_UNISTD_H
        | # include <unistd.h>
        | #else /* on Windows with MSVC */
        | # include <direct.h>
        | #endif
        | #include <string.h>
        | #include <sys/stat.h>
        |
        |
        | /* Arrange to define PATH_MAX, like "pathmax.h" does. */
        | #if HAVE_UNISTD_H
        | # include <unistd.h>
        | #endif
        | #include <limits.h>
| #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
        | # include <sys/param.h>
        | #endif
        | #if !defined PATH_MAX && defined MAXPATHLEN
        | # define PATH_MAX MAXPATHLEN
        | #endif
        | #ifdef __hpux
        | # undef PATH_MAX
        | # define PATH_MAX 1024
        | #endif
        | #if defined _WIN32 && ! defined __CYGWIN__
        | # undef PATH_MAX
        | # define PATH_MAX 260
        | #endif
        |
        |
        | /* Don't get link errors because mkdir is redefined to rpl_mkdir.  */
        | #undef mkdir
        |
        | #ifndef S_IRWXU
        | # define S_IRWXU 0700
        | #endif
        |
| /* FIXME: skip the run-test altogether on systems without getpagesize. */
        | #if ! HAVE_GETPAGESIZE
        | # define getpagesize() 0
        | #endif
        |
| /* This size is chosen to be larger than PATH_MAX (4k), yet smaller than | the 16kB pagesize on ia64 linux. Those conditions make the code below | trigger a bug in glibc's getcwd implementation before 2.4.90-10. */
        | #define TARGET_LEN (5 * 1024)
        |
        | int
        | main ()
        | {
        |   char *cwd;
        |   size_t initial_cwd_len;
        |   int fail = 0;
        |
        |   /* The bug is triggered when PATH_MAX < getpagesize (), so skip
| this relatively expensive and invasive test if that's not true. */
        | #ifdef PATH_MAX
        |   int bug_possible = PATH_MAX < getpagesize ();
        | #else
        |   int bug_possible = 0;
        | #endif
        |   if (! bug_possible)
        |     return 0;
        |
        |   cwd = getcwd (NULL, 0);
        |   if (cwd == NULL)
        |     return 2;
        |
        |   initial_cwd_len = strlen (cwd);
        |   free (cwd);
        |
        |   if (1)
        |     {
        |       static char const dir_name[] = "confdir-14B---";
        |       size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
        |                               / sizeof dir_name);
        |       size_t d;
        |       for (d = 0; d < desired_depth; d++)
        |         {
        |           if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
        |             {
        |               if (! (errno == ERANGE || errno == ENAMETOOLONG
        |                      || errno == ENOENT))
        |                 fail = 3; /* Unable to construct deep hierarchy.  */
        |               break;
        |             }
        |         }
        |
        |       /* If libc has the bug in question, this invocation of getcwd
        |          results in a failed assertion.  */
        |       cwd = getcwd (NULL, 0);
        |       if (cwd == NULL)
| fail = 4; /* getcwd didn't assert, but it failed for a long name
        |                      where the answer could have been learned.  */
        |       free (cwd);
        |
        |       /* Call rmdir first, in case the above chdir failed.  */
        |       rmdir (dir_name);
        |       while (0 < d--)
        |         {
        |           if (chdir ("..") < 0)
        |             {
        |               fail = 5;
        |               break;
        |             }
        |           rmdir (dir_name);
        |         }
        |     }
        |
        |   return fail;
        | }
        |
        configure:26302: result: yes
        configure:26539: checking for flockfile

Finally configure states (MacPorts vs. me):

        gl_cv_func_getcwd_abort_bug=no
        […]
        REPLACE_GETCWD='0'

vs.

        gl_cv_func_getcwd_abort_bug=yes
        […]
        REPLACE_GETCWD='1'

so that my configure includes 'getcwd.o getcwd-lgpl.o' to gl_LIBOBJS and 'getcwd.lo getcwd-lgpl.lo' to gl_LTLIBOBJS.

The config.log files are saved and also the configure output.

--
Greetings

  Pete

"Indentation?! I will show you how to indent when I indent your skull!"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]