Building =app-crypt/gnupg-2.0.22 with =dev-libs/libgcrypt-1.6.0 fail with the following error : [ebuild R ] app-crypt/gnupg-2.0.22 USE="bzip2 readline -adns -doc -ldap -mta -nls (-selinux) -smartcard -static -usb" 0 kB [...] make[3]: Entering directory '/var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests/openpgp' echo '#!/bin/sh' >./gpg_dearmor echo "../../g10/gpg2 --homedir . --no-options --no-greeting \ --no-secmem-warning --batch --dearmor" >>./gpg_dearmor chmod 755 ./gpg_dearmor ./gpg_dearmor > ./pubring.gpg < ./pubring.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./secring.gpg < ./secring.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./plain-1 < ./plain-1o.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./plain-2 < ./plain-2o.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./plain-3 < ./plain-3o.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./pubring.pkr < ./pubring.pkr.asc gpg: WARNING: unsafe permissions on homedir `.' ./gpg_dearmor > ./secring.skr < ./secring.skr.asc gpg: WARNING: unsafe permissions on homedir `.' ../../tools/mk-tdata 500 >data-500 ../../tools/mk-tdata 9000 >data-9000 ../../tools/mk-tdata 32000 >data-32000 ../../tools/mk-tdata 80000 >data-80000 cat ./../../doc/HACKING \ ./../../doc/DETAILS \ ./../../doc/gpg.texi >plain-large ../../g10/gpg2 --homedir . --quiet --yes --no-permission-warning --import ./pubdemo.asc gpg: signal Segmentation fault caught ... exiting Makefile:640: recipe for target 'prepared.stamp' failed make[3]: *** [prepared.stamp] Segmentation fault make[3]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests/openpgp' Makefile:461: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests' Makefile:515: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22' Makefile:434: recipe for target 'all' failed make: *** [all] Error 2 * ERROR: app-crypt/gnupg-2.0.22::gentoo failed (compile phase): * emake failed Reproducible: Always
Created attachment 368764 [details] build.log
Created attachment 368766 [details] emerge --info
Need your help to figure out what's wrong... run the test under gdb. cd /var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests/openpgp gdb ../../g10/gpg2 (gdb) set args --homedir . --quiet --yes --no-permission-warning --import ./pubdemo.asc (gdb) run <expect segnmetnation> (gdb) bt Thanks!
(In reply to Alon Bar-Lev from comment #3) > Need your help to figure out what's wrong... run the test under gdb. > > cd /var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests/openpgp > gdb ../../g10/gpg2 > (gdb) set args --homedir . --quiet --yes --no-permission-warning --import > ./pubdemo.asc > (gdb) run > <expect segnmetnation> > (gdb) bt > > Thanks! Sadly I can't reproduce this with dev-libs/libgcrypt-1.5.3. Only append with >=dev-libs/libgcrypt-1.6.0 Can't be linked to current mask ? # Patrick Lauer <patrick@gentoo.org> (07 Feb 2014) # Reliably makes cryptsetup segfault, breaking boot is not acceptable =dev-libs/libgcrypt-1.6.1
Anyway, I build dev-libs/libgcrypt-1.6.1 and here is the gdb result with CFLAGS='-g -ggdb' FEATURES=nostrip : /var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/tests/openpgp # gdb ../../g10/gpg2 GNU gdb (Gentoo 7.7 vanilla) 7.7 Copyright (C) 2014 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-pc-linux-gnux32". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://bugs.gentoo.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ../../g10/gpg2...(no debugging symbols found)...done. (gdb) run --homedir . --quiet --yes --no-permission-warning --import ./pubdemo.asc Starting program: /var/tmp/portage/app-crypt/gnupg-2.0.22/work/gnupg-2.0.22/g10/gpg2 --homedir . --quiet --yes --no-permission-warning --import ./pubdemo.asc warning: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER: Input/output error warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? Program received signal SIGSEGV, Segmentation fault. 0xf73274ea in _gcry_mpi_free_limb_space (a=0x56812600, nlimbs=1972393536) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpiutil.c:142 142 /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpiutil.c: No such file or directory. (gdb) bt #0 0xf73274ea in _gcry_mpi_free_limb_space (a=0x56812600, nlimbs=1972393536) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpiutil.c:142 #1 0xf73277c1 in _gcry_mpi_free (a=0x568125e0) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpiutil.c:219 #2 0xf731c443 in _gcry_mpi_sub (w=0x568125a0, u=0x568124c0, v=0x56812540) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpi-add.c:219 #3 0xf731ef35 in _gcry_mpi_invm (x=0x56811eb0, a=0x56811e30, n=0x56811e70) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/mpi/mpi-inv.c:246 #4 0xf72e8738 in verify (r=0x56811d90, s=0x56811e30, input=0x568113f0, pkey=0xffffc630) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/cipher/dsa.c:669 #5 0xf72e9bf9 in dsa_verify (s_sig=0x56811ce0, s_data=0x56811ca0, s_keyparms=0x56812110) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/cipher/dsa.c:1102 #6 0xf7260d2f in _gcry_pk_verify (s_sig=0x56811ce0, s_hash=0x56811ca0, s_pkey=0x56811a60) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/cipher/pubkey.c:462 #7 0xf7246d63 in gcry_pk_verify (sigval=0x56811ce0, data=0x56811ca0, pkey=0x56811a60) at /var/tmp/portage/dev-libs/libgcrypt-1.6.1/work/libgcrypt-1.6.1/src/visibility.c:981 #8 0x5658cab4 in pk_verify () #9 0x565878f4 in do_check () #10 0x5658865a in check_key_signature2 () #11 0x56588896 in check_key_signature () #12 0x565a6266 in import_one.isra () #13 0x565a7d54 in import () #14 0x565a8768 in import_keys_internal () #15 0x565a88d0 in import_keys () #16 0x5656165f in main () (gdb)
yes, look like libgcrypt issue and not gnupg, only exposed per gnupg tests. I suggest we wait for the next libgcrypt release as it has too many issues pending anyway.
*** Bug 506672 has been marked as a duplicate of this bug. ***
This is not happening with dev-libs/libgcrypt-1.6.1-r1
Hello, It looks like I had the same bug, which I reported too (sorry, I didn't see yours) here bug 512762, and even with dev-libs/libgcrypt-1.6.1-r1 I had the segmentation fault. We figured it was related to this regression, bug 427726, see bug 512762 comment 11.
This is still happening with dev-libs/libgcrypt-1.6.1-r1
Fixed since dev-libs/libgcrypt-1.6.1-r2
*** This bug has been marked as a duplicate of bug 512762 ***