Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499338 - =app-crypt/gnupg-2.0.25 on x32 - src_compile(): gpg: signal Segmentation fault caught ... exiting
Summary: =app-crypt/gnupg-2.0.25 on x32 - src_compile(): gpg: signal Segmentation faul...
Status: RESOLVED DUPLICATE of bug 512762
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
: 506672 (view as bug list)
Depends on:
Blocks: x32
  Show dependency tree
Reported: 2014-01-26 11:26 UTC by Bertrand Jacquin
Modified: 2014-07-29 18:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log (build.log,130.83 KB, text/plain)
2014-01-26 11:26 UTC, Bertrand Jacquin
emerge --info (info.log,16.19 KB, text/plain)
2014-01-26 11:27 UTC, Bertrand Jacquin

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Jacquin 2014-01-26 11:26:06 UTC
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
Comment 1 Bertrand Jacquin 2014-01-26 11:26:37 UTC
Created attachment 368764 [details]
Comment 2 Bertrand Jacquin 2014-01-26 11:27:10 UTC
Created attachment 368766 [details]
emerge --info
Comment 3 Alon Bar-Lev (RETIRED) gentoo-dev 2014-02-15 20:00:40 UTC
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

Comment 4 Bertrand Jacquin 2014-02-16 17:44:15 UTC
(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 <> (07 Feb 2014)
# Reliably makes cryptsetup segfault, breaking boot is not acceptable
Comment 5 Bertrand Jacquin 2014-02-16 17:56:36 UTC
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 <>
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:
Find the GDB manual and other documentation resources online at:
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
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 ()
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2014-03-08 22:00:05 UTC
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.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-04 14:30:34 UTC
*** Bug 506672 has been marked as a duplicate of this bug. ***
Comment 8 Bertrand Jacquin 2014-05-15 23:38:35 UTC
This is not happening with dev-libs/libgcrypt-1.6.1-r1
Comment 9 Thibaud CANALE 2014-07-27 13:37:47 UTC

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.
Comment 10 Bertrand Jacquin 2014-07-28 22:20:36 UTC
This is still happening with dev-libs/libgcrypt-1.6.1-r1
Comment 11 Bertrand Jacquin 2014-07-29 18:10:38 UTC
Fixed since dev-libs/libgcrypt-1.6.1-r2
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2014-07-29 18:20:13 UTC

*** This bug has been marked as a duplicate of bug 512762 ***