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

Bug 141141

Summary: segmentation fault inside glibc-2.3.6 triggered by gnupg-1.4.4
Product: Gentoo Linux Reporter: giovanni.bobbio
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED DUPLICATE    
Severity: normal CC: crypto+disabled
Priority: High    
Version: 2006.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description giovanni.bobbio 2006-07-20 02:50:30 UTC
On a fresh install of gnupg:

g.bobbio@kien ~ $ gpg --gen-key
gpg (GnuPG) 1.4.4; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

gpg: directory `/home/g.bobbio/.gnupg' created
gpg: creato un nuovo file di configurazione `/home/g.bobbio/.gnupg/gpg.conf'
gpg: ATTENZIONE: le opzioni in `/home/g.bobbio/.gnupg/gpg.conf' non sono ancora attive durante questa
esecuzione del programma
gpg: portachiavi `/home/g.bobbio/.gnupg/secring.gpg' creato
gpg: portachiavi `/home/g.bobbio/.gnupg/pubring.gpg' creato

gpg: Segmentation fault caught ... exiting
Segmentation fault

Importing my previous .gnupg directory (from the old PC) also results in gpg segfaulting on any action.

Compiling gnupg 1.4.4 and 1.9.21 with empty CFLAGS doesn't help.

Any suggestion on how to go about debugging this?

Emerge --info:
Portage 2.1.1_pre3-r1 (default-linux/x86/no-nptl, gcc-4.1.1/vanilla, glibc-2.3.6-r4, 2.6.17-gentoo-r3-ati i686)
=================================================================
System uname: 2.6.17-gentoo-r3-ati i686 Genuine Intel(R) CPU           T2500  @ 2.00GHz
Gentoo Base System version 1.12.1
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r2
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: [Not Present]
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium-m -pipe -msse3"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O3 -march=pentium-m -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LINGUAS="en it"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acpi addbookmarks alias alsa asf autoreplace bash-completion bitmap-fonts bluetooth bzip2 cddb cdparanoia cdr connectionstatus contactnotes crypt cups dbus dga directfb dri dvd dvdr dvdread ethereal fam firefox foomaticdb gif gmail gnokii gpm hal highlight history imap imlib ipod irda java javascript jp2 jpeg jpeg2k kde kdepim live logitech-mouse mad mailwrapper mjpeg mmx mmxext mp3 mpeg mpeg2 musicbrainz network nls nokia6600 nowlistening nsplugin offensive ogg opengl pam pcmcia pda pdf png pnp qt qt3 qt4 quicktime rdesktop real samba sdl smime sms sse sse2 ssl swat texteffect tiff translator truetype truetype-fonts type1-fonts udev unicode usb utf8 vorbis webpresence wifi win32codecs xcomposite xorg xosd xrandr xv xvid yahoo elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux linguas_en linguas_it userland_GNU video_cards_radeon video_cards_vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-07-20 02:55:22 UTC
Reopen with a backtrace... 

http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 2 giovanni.bobbio 2006-07-20 03:29:45 UTC
Added FEATURES="nostrip", changed CFLAGS to remove -O3 and add -ggdb.
Reemerged gnupg and glibc.
This is what gdb says:
kien ~ # gdb gpg
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) set args --gen-key
(gdb) run
Starting program: /usr/bin/gpg --gen-key
gpg (GnuPG) 1.4.4; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


Program received signal SIGSEGV, Segmentation fault.
ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
35      ../sysdeps/posix/ctermid.c: No such file or directory.
        in ../sysdeps/posix/ctermid.c
(gdb) quit
The program is running.  Exit anyway? (y or n) y
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-07-20 09:01:55 UTC
Add keepwork to your features and redo the backtrace.
Comment 4 giovanni.bobbio 2006-07-20 09:26:41 UTC
With keepwork in FEATURES:

kien ~ # gdb gpg
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) set args --gen-key
(gdb) run
Starting program: /usr/bin/gpg --gen-key
gpg (GnuPG) 1.4.4; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


Program received signal SIGSEGV, Segmentation fault.
ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
35        return strcpy (s, "/dev/tty");
(gdb)
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-07-20 14:01:05 UTC
could you include the full backtrace as well?
gdb command 'bt' after you reach the point you are at so far.
Comment 6 giovanni.bobbio 2006-07-21 00:20:00 UTC
Program received signal SIGSEGV, Segmentation fault.
ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
35        return strcpy (s, "/dev/tty");
(gdb) bt
#0  ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
#1  0x080df59f in tty_get_ttyname () at ttyio.c:103
#2  0x080df666 in init_ttyfp () at ttyio.c:160
#3  0x080df746 in tty_printf (fmt=0xb7e0aaf1 "Per favore scegli che tipo di chiave vuoi:\n") at ttyio.c:231
#4  0x080a79f2 in ask_algo (addmode=0, r_usage=0xbfaa9f0c) at keygen.c:1433
#5  0x080aa0eb in generate_keypair (fname=0x0, card_serialno=0x0, backup_encryption_dir=0x0) at keygen.c:2630
#6  0x08050ca2 in main (argc=0, argv=0xbfaaa2cc) at gpg.c:3488
Comment 7 giovanni.bobbio 2006-07-28 06:03:26 UTC
Any news? I'm stuck without gpg...
Comment 8 giovanni.bobbio 2006-08-21 09:56:41 UTC
It seems this bug has been dealt with in debian, see link.
http://www.mail-archive.com/debian-glibc%40lists.debian.org/msg31283.html
Can Gentoo implement the same solution?
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2006-08-21 12:06:24 UTC
base-system: see the most recent comment from the user, indicating this link from debian: http://www.mail-archive.com/debian-glibc%40lists.debian.org/msg31283.html
where the minimal testcase shows the failure is not in gnupg but inside glibc instead.
Comment 10 SpanKY gentoo-dev 2006-08-21 15:00:50 UTC

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