[Opendnssec-user] Re: signer / softHSM issues?

Havard Eidnes he at uninett.no
Sat Dec 5 19:52:12 UTC 2015


> 2) It seems ods-signer can get into a state where one of its
>    threads is more or less busy-spinning consuming CPU.

Attaching gdb to an apparently-spinng ods-signerd gives:

hugin# gdb ./signer/src/ods-signerd
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd...done.
(gdb) l main
85       * Main. start engine and run it.
86       *
87       */
88      int
89      main(int argc, char* argv[])
90      {
91          int c;
92          int options_index = 0;
93          int info = 0;
94          int single_run = 0;
(gdb) attach 19594
Attaching to program: /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd, process 19594
Reading symbols from /usr/pkg/lib/libldns.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libldns.so.1
Reading symbols from /usr/pkg/lib/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libxml2.so.2
Reading symbols from /usr/lib/liblzma.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/liblzma.so.1
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libm.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libm.so.0
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/lib/libcrypto.so.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.8
Reading symbols from /usr/lib/libpthread.so.1...(no debugging symbols found)...done.
[New LWP 377]
[New LWP 376]
[New LWP 375]
[New LWP 374]
[New LWP 373]
[New LWP 372]
[New LWP 12]
[New LWP 11]
[New LWP 10]
[New LWP 9]
[New LWP 8]
[New LWP 7]
[New LWP 4]
[New LWP 3]
[New LWP 2]
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /usr/pkg/lib/softhsm/libsofthsm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/softhsm/libsofthsm.so
Reading symbols from /usr/pkg/lib/libbotan-1.8.13.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libbotan-1.8.13.so
Reading symbols from /usr/lib/libsqlite3.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libsqlite3.so.1
Reading symbols from /usr/lib/libstdc++.so.7...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libstdc++.so.7
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...done.
Loaded symbols for /usr/libexec/ld.elf_so
[Switching to LWP 12]
0x000000000008ffd6 in ?? ()
(gdb) i thread
  Id   Target Id         Frame 
  16   LWP 2             0x00007f7ff603943a in _sys___select50 ()
   from /usr/lib/libc.so.12
  15   LWP 3             0x00007f7ff603943a in _sys___select50 ()
   from /usr/lib/libc.so.12
  14   LWP 4             0x00007f7ff603943a in _sys___select50 ()
   from /usr/lib/libc.so.12
  13   LWP 7             0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  12   LWP 8             0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  11   LWP 9             0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  10   LWP 10            0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  9    LWP 11            0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
* 8    LWP 12            0x000000000008ffd6 in ?? ()
  7    LWP 372           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  6    LWP 373           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  5    LWP 374           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  4    LWP 375           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  3    LWP 376           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  2    LWP 377           0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
  1    LWP 1             0x00007f7ff6075e7a in ___lwp_park50 ()
   from /usr/lib/libc.so.12
(gdb) where
#0  0x000000000008ffd6 in ?? ()
#1  0x00007f7ff452b1fc in Botan::(anonymous namespace)::Directory_Walker::add_directory(std::string const&) () from /usr/pkg/lib/libbotan-1.8.13.so
#2  0x00007f7ff452b7c9 in Botan::(anonymous namespace)::Directory_Walker::next_fd() () from /usr/pkg/lib/libbotan-1.8.13.so
#3  0x00007f7ff452b353 in Botan::FTW_EntropySource::poll(Botan::Entropy_Accumulator&) () from /usr/pkg/lib/libbotan-1.8.13.so
#4  0x00007f7ff45fccf9 in Botan::HMAC_RNG::reseed_with_input(unsigned int, unsigned char const*, unsigned int) () from /usr/pkg/lib/libbotan-1.8.13.so
#5  0x00007f7ff45ff9f8 in Botan::ANSI_X931_RNG::reseed(unsigned int) ()
   from /usr/pkg/lib/libbotan-1.8.13.so
#6  0x00007f7ff45fbed1 in Botan::AutoSeeded_RNG::AutoSeeded_RNG(unsigned int)
    () from /usr/pkg/lib/libbotan-1.8.13.so
#7  0x00007f7ff4a12a4f in SoftSession::SoftSession(unsigned long, SoftSlot*, char*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#8  0x00007f7ff4a113f8 in SoftHSMInternal::openSession(unsigned long, unsigned long, void*, unsigned long (*)(unsigned long, unsigned long, void*), unsigned long*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#9  0x000000000043796a in hsm_session_clone (ctx=0x7f7ff7b3b800, 
    session=<optimized out>) at libhsm.c:622
#10 hsm_ctx_clone (ctx=0x7f7ff7b3b800) at libhsm.c:754
#11 hsm_create_context () at libhsm.c:2142
#12 0x0000000000422a88 in zone_prepare_keys (zone=0x7f7ff2e14a00)
    at signer/zone.c:439
#13 0x0000000000411abd in worker_perform_task (worker=0x7f7ff4d59400)
    at daemon/worker.c:413
#14 worker_work (worker=0x7f7ff4d59400) at daemon/worker.c:604
#15 worker_start (worker=0x7f7ff4d59400) at daemon/worker.c:766
#16 0x000000000040e186 in worker_thread_start (arg=<optimized out>)
    at daemon/engine.c:371
#17 0x00007f7ff560b3ae in ?? () from /usr/lib/libpthread.so.1
#18 0x00007f7ff6075e90 in ___lwp_park50 () from /usr/lib/libc.so.12
#19 0x00007f7fe2800000 in ?? ()
#20 0x00007f7ff7ff1940 in ?? ()
#21 0x0000000111110001 in ?? ()
#22 0x0000000033330003 in ?? ()
#23 0x0000000000000000 in ?? ()
(gdb) 

The other threads seems to be "idling", so this seems to be the
area where it's consuming inordinate amounts of CPU time.

Detaching and re-attaching always points to somewhere deep inside
the Botan library:

(gdb) detach
Detaching from program: /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd, process 19594
(gdb) attach 19594
Attaching to program: /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd, process 19594
Reading symbols from /usr/pkg/sbin/ods-signerd...(no debugging symbols found)...done.
Reading symbols from /usr/pkg/lib/libldns.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libldns.so.1
Reading symbols from /usr/pkg/lib/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libxml2.so.2
Reading symbols from /usr/lib/liblzma.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/liblzma.so.1
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libm.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libm.so.0
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/lib/libcrypto.so.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.8
Reading symbols from /usr/lib/libpthread.so.1...(no debugging symbols found)...done.
[New LWP 377]
[New LWP 376]
[New LWP 375]
[New LWP 374]
[New LWP 373]
[New LWP 372]
[New LWP 12]
[New LWP 11]
[New LWP 10]
[New LWP 9]
[New LWP 8]
[New LWP 7]
[New LWP 4]
[New LWP 3]
[New LWP 2]
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /usr/pkg/lib/softhsm/libsofthsm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/softhsm/libsofthsm.so
Reading symbols from /usr/pkg/lib/libbotan-1.8.13.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libbotan-1.8.13.so
Reading symbols from /usr/lib/libsqlite3.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libsqlite3.so.1
Reading symbols from /usr/lib/libstdc++.so.7...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libstdc++.so.7
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...done.
Loaded symbols for /usr/libexec/ld.elf_so
[Switching to LWP 12]
0x000000000008ffd6 in ?? ()
(gdb) where
#0  0x000000000008ffd6 in ?? ()
#1  0x00007f7ff452b1fc in Botan::(anonymous namespace)::Directory_Walker::add_directory(std::string const&) () from /usr/pkg/lib/libbotan-1.8.13.so
#2  0x00007f7ff452b7c9 in Botan::(anonymous namespace)::Directory_Walker::next_fd() () from /usr/pkg/lib/libbotan-1.8.13.so
#3  0x00007f7ff452b353 in Botan::FTW_EntropySource::poll(Botan::Entropy_Accumulator&) () from /usr/pkg/lib/libbotan-1.8.13.so
#4  0x00007f7ff45fccf9 in Botan::HMAC_RNG::reseed_with_input(unsigned int, unsigned char const*, unsigned int) () from /usr/pkg/lib/libbotan-1.8.13.so
#5  0x00007f7ff45ff9f8 in Botan::ANSI_X931_RNG::reseed(unsigned int) ()
   from /usr/pkg/lib/libbotan-1.8.13.so
#6  0x00007f7ff45fbed1 in Botan::AutoSeeded_RNG::AutoSeeded_RNG(unsigned int)
    () from /usr/pkg/lib/libbotan-1.8.13.so
#7  0x00007f7ff4a12a4f in SoftSession::SoftSession(unsigned long, SoftSlot*, char*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#8  0x00007f7ff4a113f8 in SoftHSMInternal::openSession(unsigned long, unsigned long, void*, unsigned long (*)(unsigned long, unsigned long, void*), unsigned long*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#9  0x000000000043796a in ?? ()
#10 0x0000000000422a88 in ?? ()
#11 0x0000000000411abd in ?? ()
#12 0x000000000040e186 in ?? ()
#13 0x00007f7ff560b3ae in ?? () from /usr/lib/libpthread.so.1
#14 0x00007f7ff6075e90 in ___lwp_park50 () from /usr/lib/libc.so.12
#15 0x00007f7fe2800000 in ?? ()
#16 0x00007f7ff7ff1940 in ?? ()
#17 0x0000000111110001 in ?? ()
#18 0x0000000033330003 in ?? ()
#19 0x0000000000000000 in ?? ()
(gdb) detach
Detaching from program: /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd, process 19594
(gdb) attach 19594
Attaching to program: /usr/pkgsrc/security/opendnssec/work/opendnssec-1.4.7/signer/src/ods-signerd, process 19594
Reading symbols from /usr/pkg/sbin/ods-signerd...(no debugging symbols found)...done.
Reading symbols from /usr/pkg/lib/libldns.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libldns.so.1
Reading symbols from /usr/pkg/lib/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libxml2.so.2
Reading symbols from /usr/lib/liblzma.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/liblzma.so.1
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libm.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libm.so.0
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/lib/libcrypto.so.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.8
Reading symbols from /usr/lib/libpthread.so.1...(no debugging symbols found)...done.
[New LWP 377]
[New LWP 376]
[New LWP 375]
[New LWP 374]
[New LWP 373]
[New LWP 372]
[New LWP 12]
[New LWP 11]
[New LWP 10]
[New LWP 9]
[New LWP 8]
[New LWP 7]
[New LWP 4]
[New LWP 3]
[New LWP 2]
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /usr/pkg/lib/softhsm/libsofthsm.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/softhsm/libsofthsm.so
Reading symbols from /usr/pkg/lib/libbotan-1.8.13.so...(no debugging symbols found)...done.
Loaded symbols for /usr/pkg/lib/libbotan-1.8.13.so
Reading symbols from /usr/lib/libsqlite3.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libsqlite3.so.1
Reading symbols from /usr/lib/libstdc++.so.7...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libstdc++.so.7
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...done.
Loaded symbols for /usr/libexec/ld.elf_so
[Switching to LWP 12]
0x000000000008ffd6 in ?? ()
(gdb) where
#0  0x000000000008ffd6 in ?? ()
#1  0x00007f7ff452b1fc in Botan::(anonymous namespace)::Directory_Walker::add_directory(std::string const&) () from /usr/pkg/lib/libbotan-1.8.13.so
#2  0x00007f7ff452b7c9 in Botan::(anonymous namespace)::Directory_Walker::next_fd() () from /usr/pkg/lib/libbotan-1.8.13.so
#3  0x00007f7ff452b353 in Botan::FTW_EntropySource::poll(Botan::Entropy_Accumulator&) () from /usr/pkg/lib/libbotan-1.8.13.so
#4  0x00007f7ff45fccf9 in Botan::HMAC_RNG::reseed_with_input(unsigned int, unsigned char const*, unsigned int) () from /usr/pkg/lib/libbotan-1.8.13.so
#5  0x00007f7ff45ff9f8 in Botan::ANSI_X931_RNG::reseed(unsigned int) ()
   from /usr/pkg/lib/libbotan-1.8.13.so
#6  0x00007f7ff45fbed1 in Botan::AutoSeeded_RNG::AutoSeeded_RNG(unsigned int)
    () from /usr/pkg/lib/libbotan-1.8.13.so
#7  0x00007f7ff4a12a4f in SoftSession::SoftSession(unsigned long, SoftSlot*, char*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#8  0x00007f7ff4a113f8 in SoftHSMInternal::openSession(unsigned long, unsigned long, void*, unsigned long (*)(unsigned long, unsigned long, void*), unsigned long*) () from /usr/pkg/lib/softhsm/libsofthsm.so
#9  0x000000000043796a in ?? ()
#10 0x0000000000422a88 in ?? ()
#11 0x0000000000411abd in ?? ()
#12 0x000000000040e186 in ?? ()
#13 0x00007f7ff560b3ae in ?? () from /usr/lib/libpthread.so.1
#14 0x00007f7ff6075e90 in ___lwp_park50 () from /usr/lib/libc.so.12
#15 0x00007f7fe2800000 in ?? ()
#16 0x00007f7ff7ff1940 in ?? ()
#17 0x0000000111110001 in ?? ()
#18 0x0000000033330003 in ?? ()
#19 0x0000000000000000 in ?? ()
(gdb)

Anyone have any ideas what might be going on here?
(The version of botan installed is 1.8.14, which might be ... a
bit old.)

Regards,

- Håvard



More information about the Opendnssec-user mailing list