|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56674 GNUPG Operations cause Apache to segfault
Submitted: 2005-11-25 08:37 UTC Modified: 2005-11-25 11:25 UTC
From: karl at karlaustin dot com Assigned:
Status: Closed Package: gnupg (PECL)
PHP Version: Irrelevant OS: CentOS 3 & 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 40 = ?
Subscribe to this entry?

 [2005-11-25 08:37 UTC] karl at karlaustin dot com
Operations such as trying to import a key to the keyring cause Apache (1.3) to segfault. Operations trying to use an existing key on the keyring fail (Says it can't find the key). I have tried this on CentOS 3.6 with PHP 4.3.11 and CentOS 4.2 with PHP 5.0.5 and it happens with both when used via Apache - However, all opperations work perfectly when ran from a command line PHP.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-25 09:36 UTC]
Thank you for your bugreport.
The segfault occurs, when the keyring/ directory is not writeable. This is now fixed in CVS.
Please note, that the httpd is normaly running under a different user, so it?s homedirectory is another one. You can specify the gnupg-directory with the GNUPGHOME environment variable.
Please take a look at the notes available at regarding this.
 [2005-11-25 09:47 UTC] karl at karlaustin dot com
 [2005-11-25 09:48 UTC] karl at karlaustin dot com
Ugh, bloomin browser, sorry about the non message there.

Should have said:


The keyring directory and files are writable by the user httpd, and are in the .gnupg directory of the httpd users home dir, as this was one of the first things I double checked.


 [2005-11-25 09:56 UTC]
In this case please generate a backtrace.
Informations on how to do this, are available at

gdb /usr/sbin/httpd
run -X
- request webpage with browser here -

Please use the updated gnupg.c from CVS (
 [2005-11-25 10:42 UTC] karl at karlaustin dot com

Will have to setup another machine here to test on as I'm unable to install the debug symbols and gdb etc. on this current machine. Will test on my own dev box tonight.

 [2005-11-25 11:25 UTC] karl at karlaustin dot com
Just tried the new gnupg.c and that stops the segfaults, but it still doesn't actually make it work. It looks like the problem was that it was not looking in the default GPGHOME for the httpd user i.e. ~/.gnupg as if I use putenv() to set the GPGHOME it does now work.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Feb 25 12:01:27 2024 UTC