Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 475608

Summary: app-crypt/gnupg-2.0.20 segfaults during en/decryption
Product: Gentoo Linux Reporter: Peter Ulrich <ad_grobi>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Peter Ulrich 2013-07-03 09:19:31 UTC
Hi,

it did not work using thunderbird, so I tried the console...
Any help is appreciated.

Prior to this post I have
selected gcc 4.6
eix-sync
emerge -euDNav system
emerge -euDNav world
revdep-rebuild
etc-update
etc.
So the system should be quite up-to-date.

Cheers.

===== steps to reproduce ===== 
# echo "xyz" > text.txt
# gpg -r XXX --encrypt -o test.txt.crypt test.txt 
gpg: (..): There is no assurance this key belongs to the named user

(*the key of XXX*)

It is NOT certain that the key belongs to the person named
in the user ID.  If you *really* know what you are doing,
you may answer the next question with yes.

Use this key anyway? (y/N) y
File `test.txt.crypt' exists. Overwrite? (y/N) y

gpg: signal Segmentation fault caught ... exiting
Segmentation fault

===== debugging attempts ===== 
strace-output: (key-loading etc. has been done before, first line shows that the file is loaded)
read(10, "xyz\n", 8192)                 = 4
access("/dev/random", R_OK)             = 0
access("/dev/urandom", R_OK)            = 0
open("/home/sven/.gnupg/random_seed", O_RDONLY) = 11
fcntl64(11, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
fstat64(11, {st_mode=S_IFREG|0600, st_size=600, ...}) = 0
read(11, "&j\310\322\252\356\300\247\242x\376m\241 \246\227-)\3222\0\223)}\305\241P\36\245\246\325\370"..., 600) = 600
close(11)                               = 0
time(NULL)                              = 1372842842
times({tms_utime=0, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 712109
open("/dev/urandom", O_RDONLY)          = 11
fcntl64(11, F_GETFD)                    = 0
fcntl64(11, F_SETFD, FD_CLOEXEC)        = 0
select(12, [11], NULL, NULL, {0, 100000}) = 1 (in [11], left {0, 99999})
read(11, "\327\351\325vl~\25S|\207\370\340\302\0\2\246", 16) = 16
gettimeofday({1372842842, 471066}, NULL) = 0
getrusage(RUSAGE_SELF, {ru_utime={0, 0}, ru_stime={0, 0}, ...}) = 0
time(NULL)                              = 1372842842
times({tms_utime=0, tms_stime=0, tms_cutime=0, tms_cstime=0}) = 712109
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
munmap(0xb7755000, 32768)               = 0
write(2, "\n", 1
)                       = 1
write(2, "gpg", 3gpg)                      = 3
write(2, ": signal ", 9: signal )                = 9
write(2, "Segmentation fault", 18Segmentation fault)      = 18
write(2, " caught ... exiting\n", 20 caught ... exiting
)   = 20
rt_sigaction(SIGSEGV, {SIG_DFL, [], 0}, NULL, 8) = 0
tgkill(21643, 21643, SIGSEGV)           = 0
sigreturn() (mask [])                   = 10
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_TKILL, si_pid=21643, si_uid=1000} ---
+++ killed by SIGSEGV +++
Segmentation fault

===== version info ===== 
$ gpg --version
gpg (GnuPG) 2.0.20
libgcrypt 1.5.0
Copyright (C) 2013 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.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

[ebuild   R    ] app-crypt/gnupg-2.0.20  USE="bzip2 ldap nls readline usb -adns -doc -mta (-selinux) -smartcard -static" 0 kB

===== System info ===== 
emerge --info
$ emerge --info
Portage 2.1.12.2 (default/linux/x86/13.0/desktop, gcc-4.6.3, glibc-2.15-r3, 3.5.7-gentoo i686)
=================================================================
System uname: Linux-3.5.7-gentoo-i686-Intel-R-_Core-TM-_i7-3720QM_CPU_@_2.60GHz-with-gentoo-2.2
KiB Mem:     3347392 total,   1268636 free
KiB Swap:    4194300 total,   4194300 free
Timestamp of tree: Tue, 02 Jul 2013 07:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="rsync://ftp.halifax.rwth-aachen.de/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv ipv6 jpeg lcms ldap libnotify lock mad mng modules mp3 mp4 mpeg mudflap ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support readline sdl session spell ssl startup-notification svg tcpd thunder tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 x86 xcb xml xv xvid zlib" ABI_X86="32" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Tim Harder gentoo-dev 2013-07-03 09:56:57 UTC
I'm guessing you're using the latest stable version of libgcrypt which can exhibit alignment issues with AES-NI support. I'll open a stablization bug for libgcrypt-1.5.2-r1 in a day or two as well.

*** This bug has been marked as a duplicate of bug 427284 ***
Comment 2 Peter Ulrich 2013-07-03 10:34:56 UTC
(In reply to Tim Harder from comment #1)
> I'm guessing you're using the latest stable version of libgcrypt which can
> exhibit alignment issues with AES-NI support. I'll open a stablization bug
> for libgcrypt-1.5.2-r1 in a day or two as well.
> 
> *** This bug has been marked as a duplicate of bug 427284 ***

Yes. It is fixed in 1.5.0-r4 for me.
Thanks!