Bug 213974

Summary: gpg crashes during kernel build
Product: [Fedora] Fedora Reporter: David Wolinski <wolinski>
Component: gnupgAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: amyagi, ascobie, bigletter, dshaw, helmut.schlattl, herrold, redbugme3210, routergeeks, triage, wacker
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-06 16:41:41 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 David Wolinski 2006-11-04 03:43:31 UTC
Description of problem:

After a fresh install of FC6, a kernel build (using stock i686 configuartion
file) fails when gpg crashes.

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

FC6

How reproducible:

Always

Steps to Reproduce:
1.  Fresh install of FC6 on i686 system
2.  Download kernel-2.6.18-1.2798.fc6.src.rpm
3.  begin i686 kernel build using rpmbuild 
  
Actual results:

Kernel build fails with error:

[snip]
+ for i in '`cat modnames`'
+ sh ./scripts/modsign/modsign.sh
/var/tmp/kernel-2.6.18-1.2798-root/lib/modules/2.6.18-1.2798/kernel/drivers/usb/serial/keyspan.ko
Red
gpg: WARNING: unsafe permissions on homedir `..'
+ mv -f
/var/tmp/kernel-2.6.18-1.2798-root/lib/modules/2.6.18-1.2798/kernel/drivers/usb/serial/keyspan.ko.signed
/var/tmp/kernel-2.6.18-1.2798-root/lib/modules/2.6.18-1.2798/kernel/drivers/usb/serial/keyspan.ko
+ for i in '`cat modnames`'
+ sh ./scripts/modsign/modsign.sh
/var/tmp/kernel-2.6.18-1.2798-root/lib/modules/2.6.18-1.2798/kernel/drivers/usb/serial/sierra.ko
Red
./scripts/modsign/modsign.sh: line 46:  7556 Segmentation fault      (core
dumped) gpg --no-greeting $KEYFLAGS -b $module.out
error: Bad exit status from /var/tmp/rpm-tmp.58972 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.58972 (%build)

Expected results:

Kernel builds to completion.

Additional info:

The following is my attempt at obtaining a backtrace from the core file
generated in the gpg crash.  I can't tell if this is useful.

> gdb -c core.7556
GNU gdb Red Hat Linux (6.3.0.0-1.134.fc5rh)
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 "x86_64-redhat-linux-gnu".
Core was generated by `gpg --no-greeting --no-default-keyring --homedir ..
--secret-keyring ../kernel.'.
Program terminated with signal 11, Segmentation fault.
#0  0x00e8b402 in ?? ()
(gdb) bt
#0  0x00e8b402 in ?? ()
Error accessing memory address 0xbf83f830: No such file or directory.

Comment 1 Daphne Shaw 2006-11-28 16:11:20 UTC
The thing that's really odd here (and bug 217263 which seems to be a
dupe), is that gpg dumped core at all.  One of the first things that
gpg does on startup is to set RLIMIT_CORE to zero.  This suggests that
whatever went wrong, went wrong pretty early in the execution.

Comment 2 Daphne Shaw 2006-11-28 22:48:34 UTC
I've managed to reproduce this, and ended up with a similar
core.  It did not reproduce when using a instrumented copy
of gpg that I compiled, so I finally added an strace to the
modsign.sh script to try and see where things went wrong.

It seems gpg was not successfully executed before the segfault.
The execve() failed:

execve("/usr/bin/gpg", ["gpg", "--no-greeting", "--no-default-keyring",
"--homedir", "..", "--secret-keyring", "../kernel.sec", "--keyring",
"../kernel.pub", "--default-key", "Red", "-b",
"/var/tmp/kernel-2.6.18-1.2798-ro"...], [/* 37 vars */]) = -1 EINVAL (Invalid
argument)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


Comment 3 Dave Jones 2006-12-19 03:55:40 UTC
*** Bug 217263 has been marked as a duplicate of this bug. ***

Comment 4 Kalle Näslund 2007-01-16 03:14:00 UTC
Im seeing this exact behaviour on my two machines that both run FC6

+ for i in '`cat modnames`'
+ sh ./scripts/modsign/modsign.sh /var/tmp/kernel-2.6.18-1.2868-root/lib/modules
                       /2.6.18-1.2868xen/kernel/drivers/usb/misc/idmouse.ko Red
./scripts/modsign/modsign.sh: line 46: 15534 Segmentation fault      gpg --no-gr
                       eeting $KEYFLAGS -b $module.out
error: Bad exit status from /var/tmp/rpm-tmp.24128 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.24128 (%build)

[user@localhost SPECS]#

Comment 5 Victor Ashik 2007-04-20 09:58:38 UTC
We see the same behaviour of gpg during kernel rebuild on RHEL5 without updates.
I got the core, but cannot get backtrace from it: 

gdb /usr/bin/gpg core.7654 
GNU gdb Red Hat Linux (6.5-16.el5rh)
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 "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

Core was generated by `gpg --no-greeting --no-default-keyring --homedir ..
--secret-keyring ../kernel.'.
Program terminated with signal 11, Segmentation fault.
#0  0x001fe402 in ?? ()
(gdb) bt
#0  0x001fe402 in ?? ()
Cannot access memory at address 0xbfa8b540
(gdb)

Comment 6 Daphne Shaw 2007-04-20 13:58:55 UTC
(In reply to comment #5)
> We see the same behaviour of gpg during kernel rebuild on RHEL5 without updates.
> I got the core, but cannot get backtrace from it: 

You won't be able to backtrace from the core using gpg: it's not a gpg core. 
The intermediate process calling execve() to execute gpg is what cored.  gpg
itself was never executed.


Comment 7 Johnny Hughes 2007-05-23 12:14:43 UTC
anyone figure out why this is happening and how to fix it?

I have to use mock and build kernels on an el4 machine for el5.  (that seems to
work OK)

Comment 8 Akemi Yagi 2007-08-28 16:07:28 UTC
Does this share the same root cause as Bug #246623 ?

Comment 9 Bug Zapper 2008-04-04 04:24:22 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 10 Bug Zapper 2008-05-06 16:41:39 UTC
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.