Bug 176842

Summary: gnupg segfaults on gpg --edit
Product: [Fedora] Fedora Reporter: Maxim Britov <maxim.britov>
Component: gnupgAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-04 04:12:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maxim Britov 2006-01-03 17:18:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051216 Fedora/1.5-3 Firefox/1.5

Description of problem:
Both rpm and svn versions gnupg segfaults on gpg --edit. This for .rpm:

$ LANG=en_US.UTF-8 gdb /usr/bin/gpg
GNU gdb Red Hat Linux (6.3.0.0-1.94rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run --edit 0x6f3db1fb
Starting program: /usr/bin/gpg --edit 0x6f3db1fb
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
gpg (GnuPG) 1.4.2; Copyright (C) 2005 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) bt
#0  ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
#1  0x755f9430 in tty_get_ttyname () at ttyio.c:103
#2  0x755f94e7 in init_ttyfp () at ttyio.c:160
#3  0x755f9818 in tty_printf (fmt=0x75612b8e "Secret key is available.\n") at ttyio.c:223
#4  0x755b4141 in keyedit_menu (username=0x75639c10 "0x6f3db1fb", locusr=0x0, commands=0x0, quiet=0, seckey_check=1) at keyedit.c:1577
#5  0x755622a5 in main (argc=Cannot access memory at address 0x0) at g10.c:3224
(gdb) frame 0
#0  ctermid (s=0x0) at ../sysdeps/posix/ctermid.c:35
35        return strcpy (s, "/dev/tty");
(gdb) frame 1
#1  0x755f9430 in tty_get_ttyname () at ttyio.c:103
103           s = ctermid (NULL);
(gdb) frame 2
#2  0x755f94e7 in init_ttyfp () at ttyio.c:160
160         ttyfp = batchmode? stderr : fopen( tty_get_ttyname (), "r+");
(gdb) frame 3
#3  0x755f9818 in tty_printf (fmt=0x75612b8e "Secret key is available.\n") at ttyio.c:223
223             init_ttyfp();
(gdb) frame 4
#4  0x755b4141 in keyedit_menu (username=0x75639c10 "0x6f3db1fb", locusr=0x0, commands=0x0, quiet=0, seckey_check=1) at keyedit.c:1577
1577              tty_printf(_("Secret key is available.\n"));
(gdb) frame 5
#5  0x755622a5 in main (argc=Cannot access memory at address 0x0) at g10.c:3224
3224                keyedit_menu(username, locusr, NULL, 0, 1 );


Version-Release number of selected component (if applicable):
gnupg-1.4.2-3.1

How reproducible:
Always

Steps to Reproduce:
1.gpg --edit somekey or uid  

Additional info:

Comment 1 Nalin Dahyabhai 2006-01-04 04:12:58 UTC

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