Bug 1091053

Summary: Error in GnuTLS initialization: Failed to acquire random data.
Product: [Fedora] Fedora Reporter: Brian Lane <bcl>
Component: gnutlsAssignee: Nikos Mavrogiannopoulos <nmavrogi>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: danw, jorton, mclasen, nmavrogi, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-30 07:36:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brian Lane 2014-04-24 17:53:49 UTC
While runing lorax against the current rawhide repo I am seeing this in the output:

(443/672) [100%] installing glib-networking-2.40.1-1.fc21.x86_64
2014-04-24 17:47:20,445: glib-networking.x86_64 0:2.40.1-1.fc21 - u scriptlet output:
Error in GnuTLS initialization: Failed to acquire random data.
/var/tmp/rpm-tmp.alWmmS: line 1: 26825 Segmentation fault      (core dumped) gio-querymodules-64 /usr/lib64/gio/modules
warning: %post(glib-networking-2.40.1-1.fc21.x86_64) scriptlet failed, exit status 139

glib-networking.x86_64 0:2.40.1-1.fc21 - u scriptlet output:
Error in GnuTLS initialization: Failed to acquire random data.
/var/tmp/rpm-tmp.alWmmS: line 1: 26825 Segmentation fault      (core dumped) gio-querymodules-64 /usr/lib64/gio/modules
warning: %post(glib-networking-2.40.1-1.fc21.x86_64) scriptlet failed, exit status 139

2014-04-24 17:47:20,445: RPM transaction error: Non-fatal POSTIN scriptlet failure in rpm package glib-networking-2.40.1-1.fc21.x86_64
RPM transaction error: Non-fatal POSTIN scriptlet failure in rpm package glib-networking-2.40.1-1.fc21.x86_64

Comment 1 Dan Winship 2014-04-24 19:55:21 UTC
(In reply to Brian C. Lane from comment #0)
> (443/672) [100%] installing glib-networking-2.40.1-1.fc21.x86_64
> 2014-04-24 17:47:20,445: glib-networking.x86_64 0:2.40.1-1.fc21 - u
> scriptlet output:
> Error in GnuTLS initialization: Failed to acquire random data.
> /var/tmp/rpm-tmp.alWmmS: line 1: 26825 Segmentation fault      (core dumped)
> gio-querymodules-64 /usr/lib64/gio/modules

gnutls_global_init() really shouldn't fail... There is something messed up with your machine or with some package in rawhide (perhaps gnutls) or with something lorax is doing, whatever lorax is.

Presumably the segfault comes from us calling some gnutls function after gnutls_global_init() fails. glib-networking doesn't check the return value of gnutls_global_init(), but that wouldn't help in this case anyway it turns out (though that's probably a gnutls bug...).

OTOH, running gio-querymodules on libgiognutls.so doesn't actually require using gnutls, so we could fix this by not calling gnutls_global_init() until a GTlsBackend is created. But you'd still crash the next time you try to run a gnutls-using program, presumably

Comment 2 Brian Lane 2014-04-24 22:14:17 UTC
lorax builds the boot.iso using a yum chroot, so it really isn't running in the context of a running system. This is a new failure though, it didn't happen with f20.

Comment 3 Dan Winship 2014-04-25 14:38:42 UTC
ah, actually, this is entirely gnutls's fault: glib-networking doesn't call any gnutls functions when loaded by gio-querymodules. But gnutls runs gnutls_global_init() from a constructor, and gnutls_global_deinit() from a destructor, but it runs deinit() even if init() failed, and presumably at some point in there it's freeing something it never allocated.

Comment 4 Nikos Mavrogiannopoulos 2014-04-28 08:38:36 UTC
Was the crash related to p11-kit? If yes, that would be solved by the new 3.3.1 build. Otherwise please provide a backtrace or a valgrind trace.

Comment 5 Brian Lane 2014-04-30 18:37:40 UTC
Looks like the version of p11-kit being used is p11-kit-0.20.2-2.fc21.x86_64.rpm

Comment 6 Nikos Mavrogiannopoulos 2014-05-30 07:36:33 UTC
This should not be applicable in rawhide any more. Please re-open if this isn't the case.