bug-gnulib
[Top][All Lists]
Advanced

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

Re: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when se


From: Paul Eggert
Subject: Re: bug#32452: 26.1; gnutls_try_handshake maxes out cpu retrying when server is a bit busy
Date: Tue, 1 Mar 2022 18:12:17 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 3/1/22 17:22, Lars Ingebrigtsen wrote:

--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -129,6 +129,7 @@
  #  minmax \
  #  mkostemp \
  #  mktime \
+#  nanosleep \
  #  nproc \
  #  nstrftime \
  #  pathmax \
@@ -2497,6 +2498,16 @@ EXTRA_libgnu_a_SOURCES += mktime.c
  endif
  ## end   gnulib module mktime-internal
+## begin gnulib module nanosleep
+ifeq (,$(OMIT_GNULIB_MODULE_nanosleep))
+
+ifneq (,$(GL_COND_OBJ_NANOSLEEP_CONDITION))
+libgnu_a_SOURCES += nanosleep.c
+endif
+
+endif
+## end   gnulib module nanosleep
+
  ## begin gnulib module nproc
  ifeq (,$(OMIT_GNULIB_MODULE_nproc))

This diff is wrong, as it omits a line "GL_COND_OBJ_NANOSLEEP_CONDITION = @GL_COND_OBJ_NANOSLEEP_CONDITION@".

I ran what should have been something like your commands and got the attached patch. One way forward is for you to simply install the attached patch and move on from there. Or we can continue to look into why things work for me and not for you. I suppose it could be an Autoconf bug on your platform, but it'd be an odd one.

Here's a shell transcript of what I did to get the attached patch, on Fedora 35 x86-64:

  $ git clone master master-tmp
  Cloning into 'master-tmp'...
  done.
  Updating files: 100% (4608/4608), done.
  $ cd master-tmp
  $ git log HEAD^!
commit 689a34e2153ec558dbf406809a5e58489250fe1a (HEAD -> master, origin/master, origin/HEAD)
  Author: Po Lu <luangruo@yahoo.com>
  Date:   Wed Mar 2 09:46:44 2022 +0800

      Dismiss help text when item becomes unactivated on oldXMenu

      * oldXMenu/Activate.c (XMenuActivate): Dismiss help text when
      leaving an item.
  $ (cd ../gnulib && git log HEAD^! )
commit 8c4f4d7a3c28f88b64fce2fb1d0dc0e570d1a482 (HEAD -> master, origin/master, origin/HEAD)
  Author: Paul Eggert <eggert@cs.ucla.edu>
  Date:   Tue Mar 1 10:01:22 2022 -0800

      Create lib/Makefile.am after gnulib-comp.m4

      * gnulib-tool (func_import): Create library makefile after
      creating gnulib-comp.m4.  With --gnu-make, the latter depends on
      the former.  See <https://bugs.gnu.org/32452#109>.
  $ sed -i 's/nproc nstrftime/nanosleep &/' admin/merge-gnulib
  $ admin/merge-gnulib
  Checking whether you have the necessary tools...
  (Read INSTALL.REPO for more details on building Emacs)
  Checking for autoconf (need at least version 2.65) ... ok
  Your system has the required tools.
  Building aclocal.m4 ...
  Running 'autoreconf -fi -I m4' ...
  Configuring local git repository...
  '.git/config' -> '.git/config.~1~'
  git config transfer.fsckObjects 'true'
git config diff.cpp.xfuncname '!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])
  ^((::[[:space:]]*)?[A-Za-z_][A-Za-z_0-9]*[[:space:]]*\(.*)$
  ^((#define[[:space:]]|DEFUN).*)$'
git config diff.elisp.xfuncname '^\([^[:space:]]*def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
  git config diff.m4.xfuncname '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git config diff.make.xfuncname '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)' git config diff.shell.xfuncname '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)' git config diff.texinfo.xfuncname '^@node[[:space:]]+([^,[:space:]][^,]+)'
  Installing git hooks...
  'build-aux/git-hooks/commit-msg' -> '.git/hooks/commit-msg'
  'build-aux/git-hooks/pre-commit' -> '.git/hooks/pre-commit'
'build-aux/git-hooks/prepare-commit-msg' -> '.git/hooks/prepare-commit-msg'
  '.git/hooks/applypatch-msg.sample' -> '.git/hooks/applypatch-msg'
  '.git/hooks/pre-applypatch.sample' -> '.git/hooks/pre-applypatch'
  You can now run './configure'.
  Module list with included dependencies (indented):
      absolute-header
      acl-permissions
    alloca-opt
      allocator
      at-internal
      attribute
    binary-io
      builtin-expect
    byteswap
    c-ctype
    c-strcase
      c99
    canonicalize-lgpl
    careadlinkat
      clock-time
      cloexec
    close-stream
    copy-file-range
    count-leading-zeros
    count-one-bits
    count-trailing-zeros
    crypto/md5
    crypto/md5-buffer
    crypto/sha1-buffer
    crypto/sha256-buffer
    crypto/sha512-buffer
    d-type
    diffseq
      dirent
      dirfd
    double-slash-root
    dtoastr
    dtotimespec
    dup2
      dynarray
      eloop-threshold
    environ
      errno
      euidaccess
    execinfo
    explicit_bzero
      extensions
      extern-inline
    faccessat
    fchmodat
    fcntl
    fcntl-h
    fdopendir
    file-has-acl
    filemode
    filename
    filevercmp
    flexmember
      fpending
    fpieee
    free-posix
    fstatat
    fsusage
    fsync
    futimens
      gen-header
      getdtablesize
      getgroups
    getloadavg
    getopt-gnu
      getopt-posix
    getrandom
      gettext-h
    gettime
    gettimeofday
    gitlog-to-changelog
      group-member
      idx
    ieee754-h
    ignore-value
      include_next
    intprops
      inttypes-incomplete
    largefile
      lchmod
      libc-config
    libgmp
      limits-h
    lstat
      malloc-gnu
      malloc-posix
    manywarnings
    memmem-simple
    mempcpy
    memrchr
    minmax
    mkostemp
    mktime
      mktime-internal
      multiarch
    nanosleep
      nocrash
    nproc
    nstrftime
      open
      openat-h
    pathmax
    pipe2
    pselect
    pthread_sigmask
    qcopy-acl
      rawmemchr
    readlink
    readlinkat
      realloc-gnu
      realloc-posix
    regex
      root-uid
      scratch_buffer
    sig2str
    sigdescr_np
      signal-h
      snippet/_Noreturn
      snippet/arg-nonnull
      snippet/c++defs
      snippet/warn-on-use
    socklen
      ssize_t
    stat-time
    std-gnu11
    stdalign
    stddef
      stdint
    stdio
      stdlib
    stpcpy
      string
    strnlen
    strtoimax
      strtoll
    symlink
      sys_random
      sys_select
    sys_stat
    sys_time
      sys_types
    tempname
    time
    time_r
    time_rz
    timegm
    timer-time
      timespec
    timespec-add
    timespec-sub
      u64
      unistd
    unlocked-io
      unlocked-io-internal
    update-copyright
      utimens
    utimensat
      vararrays
      verify
    vla
    warnings
      xalloc-oversized
  File list:
    build-aux/gitlog-to-changelog
    build-aux/update-copyright
    lib/_Noreturn.h
    lib/acl-errno-valid.c
    lib/acl-internal.c
    lib/acl-internal.h
    lib/acl.h
    lib/acl_entries.c
    lib/alloca.in.h
    lib/allocator.c
    lib/allocator.h
    lib/arg-nonnull.h
    lib/at-func.c
    lib/attribute.h
    lib/binary-io.c
    lib/binary-io.h
    lib/byteswap.in.h
    lib/c++defs.h
    lib/c-ctype.c
    lib/c-ctype.h
    lib/c-strcase.h
    lib/c-strcasecmp.c
    lib/c-strncasecmp.c
    lib/canonicalize-lgpl.c
    lib/careadlinkat.c
    lib/careadlinkat.h
    lib/cdefs.h
    lib/cloexec.c
    lib/cloexec.h
    lib/close-stream.c
    lib/close-stream.h
    lib/copy-file-range.c
    lib/count-leading-zeros.c
    lib/count-leading-zeros.h
    lib/count-one-bits.c
    lib/count-one-bits.h
    lib/count-trailing-zeros.c
    lib/count-trailing-zeros.h
    lib/diffseq.h
    lib/dirent.in.h
    lib/dirfd.c
    lib/dtoastr.c
    lib/dtotimespec.c
    lib/dup2.c
    lib/dynarray.h
    lib/eloop-threshold.h
    lib/errno.in.h
    lib/euidaccess.c
    lib/execinfo.c
    lib/execinfo.in.h
    lib/explicit_bzero.c
    lib/faccessat.c
    lib/fchmodat.c
    lib/fcntl.c
    lib/fcntl.in.h
    lib/fdopendir.c
    lib/file-has-acl.c
    lib/filemode.c
    lib/filemode.h
    lib/filename.h
    lib/filevercmp.c
    lib/filevercmp.h
    lib/flexmember.h
    lib/fpending.c
    lib/fpending.h
    lib/free.c
    lib/fstatat.c
    lib/fsusage.c
    lib/fsusage.h
    lib/fsync.c
    lib/ftoastr.c
    lib/ftoastr.h
    lib/futimens.c
    lib/get-permissions.c
    lib/getdtablesize.c
    lib/getgroups.c
    lib/getloadavg.c
    lib/getopt-cdefs.in.h
    lib/getopt-core.h
    lib/getopt-ext.h
    lib/getopt-pfx-core.h
    lib/getopt-pfx-ext.h
    lib/getopt.c
    lib/getopt.in.h
    lib/getopt1.c
    lib/getopt_int.h
    lib/getrandom.c
    lib/gettext.h
    lib/gettime.c
    lib/gettimeofday.c
    lib/gl_openssl.h
    lib/group-member.c
    lib/idx.h
    lib/ieee754.in.h
    lib/ignore-value.h
    lib/intprops.h
    lib/inttypes.in.h
    lib/lchmod.c
    lib/libc-config.h
    lib/limits.in.h
    lib/lstat.c
    lib/malloc.c
    lib/malloc/dynarray-skeleton.c
    lib/malloc/dynarray.h
    lib/malloc/dynarray_at_failure.c
    lib/malloc/dynarray_emplace_enlarge.c
    lib/malloc/dynarray_finalize.c
    lib/malloc/dynarray_resize.c
    lib/malloc/dynarray_resize_clear.c
    lib/malloc/scratch_buffer.h
    lib/malloc/scratch_buffer_dupfree.c
    lib/malloc/scratch_buffer_grow.c
    lib/malloc/scratch_buffer_grow_preserve.c
    lib/malloc/scratch_buffer_set_array_size.c
    lib/md5-stream.c
    lib/md5.c
    lib/md5.h
    lib/memmem.c
    lib/mempcpy.c
    lib/memrchr.c
    lib/mini-gmp-gnulib.c
    lib/mini-gmp.c
    lib/mini-gmp.h
    lib/minmax.h
    lib/mkostemp.c
    lib/mktime-internal.h
    lib/mktime.c
    lib/nanosleep.c
    lib/nproc.c
    lib/nproc.h
    lib/nstrftime.c
    lib/open.c
    lib/openat-priv.h
    lib/openat-proc.c
    lib/openat.h
    lib/pathmax.h
    lib/pipe2.c
    lib/pselect.c
    lib/pthread_sigmask.c
    lib/qcopy-acl.c
    lib/rawmemchr.c
    lib/rawmemchr.valgrind
    lib/readlink.c
    lib/readlinkat.c
    lib/realloc.c
    lib/regcomp.c
    lib/regex.c
    lib/regex.h
    lib/regex_internal.c
    lib/regex_internal.h
    lib/regexec.c
    lib/root-uid.h
    lib/scratch_buffer.h
    lib/set-permissions.c
    lib/sha1.c
    lib/sha1.h
    lib/sha256.c
    lib/sha256.h
    lib/sha512.c
    lib/sha512.h
    lib/sig2str.c
    lib/sig2str.h
    lib/sigdescr_np.c
    lib/signal.in.h
    lib/stat-time.c
    lib/stat-time.h
    lib/stdalign.in.h
    lib/stddef.in.h
    lib/stdint.in.h
    lib/stdio-impl.h
    lib/stdio-read.c
    lib/stdio-write.c
    lib/stdio.in.h
    lib/stdlib.in.h
    lib/stpcpy.c
    lib/str-two-way.h
    lib/strftime.h
    lib/string.in.h
    lib/strnlen.c
    lib/strtoimax.c
    lib/strtol.c
    lib/strtoll.c
    lib/symlink.c
    lib/sys_random.in.h
    lib/sys_select.in.h
    lib/sys_stat.in.h
    lib/sys_time.in.h
    lib/sys_types.in.h
    lib/tempname.c
    lib/tempname.h
    lib/time-internal.h
    lib/time.in.h
    lib/time_r.c
    lib/time_rz.c
    lib/timegm.c
    lib/timespec-add.c
    lib/timespec-sub.c
    lib/timespec.c
    lib/timespec.h
    lib/u64.c
    lib/u64.h
    lib/unistd.c
    lib/unistd.in.h
    lib/unlocked-io.h
    lib/utimens.c
    lib/utimens.h
    lib/utimensat.c
    lib/verify.h
    lib/vla.h
    lib/warn-on-use.h
    lib/xalloc-oversized.h
    m4/00gnulib.m4
    m4/__inline.m4
    m4/absolute-header.m4
    m4/acl.m4
    m4/alloca.m4
    m4/builtin-expect.m4
    m4/byteswap.m4
    m4/canonicalize.m4
    m4/clock_time.m4
    m4/copy-file-range.m4
    m4/d-type.m4
    m4/dirent_h.m4
    m4/dirfd.m4
    m4/double-slash-root.m4
    m4/dup2.m4
    m4/eealloc.m4
    m4/environ.m4
    m4/errno_h.m4
    m4/euidaccess.m4
    m4/execinfo.m4
    m4/explicit_bzero.m4
    m4/extensions.m4
    m4/extern-inline.m4
    m4/faccessat.m4
    m4/fchmodat.m4
    m4/fcntl-o.m4
    m4/fcntl.m4
    m4/fcntl_h.m4
    m4/fdopendir.m4
    m4/filemode.m4
    m4/flexmember.m4
    m4/fpending.m4
    m4/fpieee.m4
    m4/free.m4
    m4/fstatat.m4
    m4/fsusage.m4
    m4/fsync.m4
    m4/futimens.m4
    m4/getdtablesize.m4
    m4/getgroups.m4
    m4/getloadavg.m4
    m4/getopt.m4
    m4/getrandom.m4
    m4/gettime.m4
    m4/gettimeofday.m4
    m4/gl-openssl.m4
    m4/gnulib-common.m4
    m4/group-member.m4
    m4/ieee754-h.m4
    m4/include_next.m4
    m4/inttypes.m4
    m4/largefile.m4
    m4/lchmod.m4
    m4/libgmp.m4
    m4/limits-h.m4
    m4/lstat.m4
    m4/malloc.m4
    m4/manywarnings-c++.m4
    m4/manywarnings.m4
    m4/mbstate_t.m4
    m4/md5.m4
    m4/memmem.m4
    m4/mempcpy.m4
    m4/memrchr.m4
    m4/minmax.m4
    m4/mkostemp.m4
    m4/mktime.m4
    m4/mode_t.m4
    m4/multiarch.m4
    m4/nanosleep.m4
    m4/nocrash.m4
    m4/nproc.m4
    m4/nstrftime.m4
    m4/off_t.m4
    m4/open-cloexec.m4
    m4/open-slash.m4
    m4/open.m4
    m4/pathmax.m4
    m4/pid_t.m4
    m4/pipe2.m4
    m4/pselect.m4
    m4/pthread_sigmask.m4
    m4/rawmemchr.m4
    m4/readlink.m4
    m4/readlinkat.m4
    m4/realloc.m4
    m4/regex.m4
    m4/sha1.m4
    m4/sha256.m4
    m4/sha512.m4
    m4/sig2str.m4
    m4/sigdescr_np.m4
    m4/signal_h.m4
    m4/socklen.m4
    m4/ssize_t.m4
    m4/stat-time.m4
    m4/std-gnu11.m4
    m4/stdalign.m4
    m4/stddef_h.m4
    m4/stdint.m4
    m4/stdio_h.m4
    m4/stdlib_h.m4
    m4/stpcpy.m4
    m4/string_h.m4
    m4/strnlen.m4
    m4/strtoimax.m4
    m4/strtoll.m4
    m4/symlink.m4
    m4/sys_random_h.m4
    m4/sys_select_h.m4
    m4/sys_socket_h.m4
    m4/sys_stat_h.m4
    m4/sys_time_h.m4
    m4/sys_types_h.m4
    m4/tempname.m4
    m4/time_h.m4
    m4/time_r.m4
    m4/time_rz.m4
    m4/timegm.m4
    m4/timer_time.m4
    m4/timespec.m4
    m4/tm_gmtoff.m4
    m4/unistd_h.m4
    m4/unlocked-io.m4
    m4/utimens.m4
    m4/utimensat.m4
    m4/utimes.m4
    m4/vararrays.m4
    m4/warn-on-use.m4
    m4/warnings.m4
    m4/wchar_t.m4
    m4/wint_t.m4
    m4/year2038.m4
    m4/zzgnulib.m4
  Copying file lib/gl_openssl.h
  Copying file lib/nanosleep.c
  Copying file lib/stdio-read.c
  Copying file lib/stdio-write.c
  Copying file m4/fcntl-o.m4
  Copying file m4/gl-openssl.m4
  Copying file m4/gnulib-tool.m4
  Copying file m4/manywarnings-c++.m4
  Copying file m4/nanosleep.m4
  Copying file m4/warn-on-use.m4
  Copying file m4/wint_t.m4
  Creating m4/gnulib-cache.m4
  Updating m4/gnulib-comp.m4 (backup in m4/gnulib-comp.m4~)
  Updating lib/gnulib.mk.in (backup in lib/gnulib.mk.in~)
  Finished.

  You may need to add #include directives for the following .h files.
    #include <alloca.h>
    #include <byteswap.h>
    #include <dirent.h>
    #include <execinfo.h>
    #include <fcntl.h>
    #include <getopt.h>
    #include <gmp.h>
    #include <ieee754.h>
    #include <inttypes.h>
    #include <regex.h>
    #include <signal.h>
    #include <stdalign.h>
    #include <stddef.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <sys/random.h>
    #include <sys/select.h>
    #include <sys/stat.h>
    #include <sys/time.h>
    #include <time.h>
    #include <unistd.h>
    #include "acl.h"
    #include "binary-io.h"
    #include "c-ctype.h"
    #include "c-strcase.h"
    #include "careadlinkat.h"
    #include "close-stream.h"
    #include "count-leading-zeros.h"
    #include "count-one-bits.h"
    #include "count-trailing-zeros.h"
    #include "diffseq.h"
    #include "filemode.h"
    #include "filename.h"
    #include "filevercmp.h"
    #include "fsusage.h"
    #include "ftoastr.h"
    #include "ignore-value.h"
    #include "intprops.h"
    #include "md5.h"
    #include "minmax.h"
    #include "nproc.h"
    #include "pathmax.h"
    #include "sha1.h"
    #include "sha256.h"
    #include "sha512.h"
    #include "sig2str.h"
    #include "stat-time.h"
    #include "strftime.h"
    #include "tempname.h"
    #include "timespec.h"
    #include "unlocked-io.h"
    #include <sys/types.h>
    #if HAVE_SYS_SOCKET_H
    # include <sys/socket.h>
    #elif HAVE_WS2TCPIP_H
    # include <ws2tcpip.h>
    #endif

  You may need to use the following Makefile variables when linking.
  Use them in <program>_LDADD when linking a program, or
  in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library.
    $(GETLOADAVG_LIBS)
    $(LIBTHREAD)
    $(LIB_ACL)
    $(LIB_CLOCK_GETTIME)
    $(LIB_CRYPTO)
    $(LIB_EACCESS)
    $(LIB_EXECINFO)
    $(LIB_GETRANDOM)
    $(LIB_HAS_ACL)
    $(LIB_MBRTOWC)
    $(LIB_NANOSLEEP)
    $(LIB_PTHREAD_SIGMASK)
    $(LIB_SELECT)
    $(LIB_TIMER_TIME)
    $(LTLIBGMP) when linking with libtool, $(LIBGMP) otherwise
    $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise

  Don't forget to
    - "include gnulib.mk.in" from within "lib/Makefile.am",
    - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am
      or add an AC_CONFIG_MACRO_DIRS([m4]) invocation in ./configure.ac,
    - mention "m4/gnulib-cache.m4" in EXTRA_DIST in Makefile.am,
    - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
    - invoke gl_INIT in ./configure.ac.
  Checking whether you have the necessary tools...
  (Read INSTALL.REPO for more details on building Emacs)
  Checking for autoconf (need at least version 2.65) ... ok
  Your system has the required tools.
  Building aclocal.m4 ...
  Running 'autoreconf -fi -I m4' ...
  You can now run './configure'.
  $ git status
  On branch master
  Your branch is up to date with 'origin/master'.

  Changes not staged for commit:
    (use "git add <file>..." to update what will be committed)
    (use "git restore <file>..." to discard changes in working directory)
          modified:   admin/merge-gnulib
          modified:   lib/gnulib.mk.in
          modified:   m4/gnulib-comp.m4

  Untracked files:
    (use "git add <file>..." to include in what will be committed)
          lib/nanosleep.c
          m4/nanosleep.m4
          merge-gnulib.diff

  no changes added to commit (use "git add" and/or "git commit -a")
  $ git checkout -b for-larsi
  Switched to a new branch 'for-larsi'
$ git add lib/nanosleep.c m4/nanosleep.m4 admin/merge-gnulib lib/gnulib.mk.in m4/gnulib-comp.m4
  $ git commit -m'Add Gnulib nanosleep module'
  [for-larsi 2020d4fc91] Add Gnulib nanosleep module
   5 files changed, 355 insertions(+), 1 deletion(-)
   create mode 100644 lib/nanosleep.c
   create mode 100644 m4/nanosleep.m4
  $ git format-patch -1
  0001-Add-Gnulib-nanosleep-module.patch
  $

Attachment: 0001-Add-Gnulib-nanosleep-module.patch
Description: Text Data


reply via email to

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