FS#38560 - [dirmngr] segfalut in libpth causes e-mail signature validation/e-mail signing to fail

Attached to Project: Arch Linux
Opened by Nicky726 (Nicky726) - Friday, 17 January 2014, 19:14 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 13 August 2014, 12:21 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 16
Private No

Details

Description:

After recent upgrade, which updated pth to 2.0.7-5, e-mail signature validation/e-mail signing in KMail no longer works. KMail complains on dirmngr unavailability, and in dmesg, following line appears repeatedly:
[ 368.672079] dirmngr[4781]: segfault at 580 ip 00007f0d449a9901 sp 00007fffbd4b98f0 error 4 in libpth.so.20.0.27[7f0d449a0000+12000]


Additional info:
* package version(s):
pth: 2.0.7-5
dirmngr 1.1.1-2
gpgme 1.4.3-1
* config and/or log files etc.


Steps to reproduce:
Try to sign e-mail in KMail, observe error: Could not compose message: No dirmngr. See segfault line in dmesg.
I can reproduce on three simmilarly configured PCs.

If more logs or details are needed, please specify which, i'll provide them.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Wednesday, 13 August 2014, 12:21 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.1.1-3
Comment by Carsten Feuls (CarstenF) - Monday, 20 January 2014, 13:10 GMT
I have also a Problem with dirmngr but not with e-mail signature.
My Problem is that I try to install archlinux on usb drive but my problem is that in the change rooted environement I got the following problem
terminal input: updatedb
and then I got the follwing message
bash: /usr/bin/updatedb: Datei oder Verzeichnis nicht gefunden
but this file exists.
On the hosts system I got in the Kernel Messages the following Message
[18034.956891] dirmngr[12152]: segfault at 580 ip 00007f6c7a854881 sp 00007fffa3b44420 error 4 in libpth.so.20.0.27[7f6c7a84b000+12000]

both systems the host and the installed system on usb drive is ArchLinux
On both system are these packages installed
core/pth 2.0.7-5
core/dirmngr 1.1.1-2


I have found also this thread in another forum
http://www.gossamer-threads.com/lists/gnupg/users/64691?page=last

there is also a problem with gnupg, pth, dirmngr
Comment by Nicky726 (Nicky726) - Wednesday, 22 January 2014, 22:41 GMT
So, the incriminated upgrade included also upgrade of libgcrypt from 1.5.3-1 to 1.6.0-1 and rebuilt of gnupg from 2.0.22-1 to 2.0.22-2.
Downgrading dirmngr and pth makes no difference, downgrading also gnupg makes KMail not to verify emails at all. To downgrade libgcrypt I didn't dare, since it is dependency for cryptsetup and I do not currently have a spare system at hand, in case it messes up disk encryption. I will give it a run during the weekend.
Also current rebuilt of libgcrypt 1.6.0-2 seems to make no difference.
Comment by Nicky726 (Nicky726) - Friday, 24 January 2014, 10:19 GMT
After the downgrade of libgcrypt to 1.5.3 and downgrade/rebuild of related packages pth, dirmngr, gnupg and gpgme, email signing/signature verification works again. So the libgcrypt seems to be the culprit.
Comment by Nicky726 (Nicky726) - Friday, 24 January 2014, 10:41 GMT
There seems to be related bug report [https://bugs.g10code.com/gnupg/issue1590] with a working patch for dirmngr.
Comment by Sven Willenberger (svenw) - Monday, 27 January 2014, 16:56 GMT
I have attached the patch available from the link Nicky indicated above.

From ABS, using the patch and rebuilding dirmngr fixes the issue (I use S/MIME with claws mail and that functionality has been restored).
Comment by Moviuro (Moviuro) - Friday, 21 March 2014, 11:19 GMT
Cannot reproduce (never could) but I have very often some core dumps [http://paste.ubuntu.com/7130055]
I use KMail / Kontact with Kleopatra, never had any issues with mail signature/encryption/validation.
It is just an annoyance to me as it floods my logs.
Comment by Mat (rhqq) - Monday, 24 March 2014, 11:22 GMT
Same here

[ 42.832895] dirmngr[1073]: segfault at 580 ip 00007f5f75368881 sp 00007fff95ddfc50 error 4 in libpth.so.20.0.27[7f5f7535f000+12000]
[ 2437.875780] dirmngr[1618]: segfault at 580 ip 00007f84ceb46881 sp 00007fff7c4b2ea0 error 4 in libpth.so.20.0.27[7f84ceb3d000+12000]
[ 3088.545879] dirmngr[1947]: segfault at 580 ip 00007f6a58994881 sp 00007fffb76f64f0 error 4 in libpth.so.20.0.27[7f6a5898b000+12000]

Linux zomgz 3.13.6-1-ARCH #1 SMP PREEMPT Fri Mar 7 22:47:48 CET 2014 x86_64 GNU/Linux

pth 2.0.7-5
dirmngr 1.1.1-2

No visible effects of that, only dmesg entries present.
Comment by Alexander Minges (athemis) - Wednesday, 26 March 2014, 18:58 GMT
After patching dirmngr, signing with S/MIME in Kmail works for me again.
Comment by sergio (sergio) - Tuesday, 03 June 2014, 12:31 GMT
Any chance of having this patch integrated into our repo ?
Comment by Milian Wolff (milianw) - Monday, 16 June 2014, 09:30 GMT
I'd also like to see this included, as it affects me severely.
Comment by Samir Nassar (snassar) - Wednesday, 30 July 2014, 12:56 GMT
To fix this problem, I ended up building my own dirmngr package with the patch included. Now dirmngr works. I came to this bug through looking for solutions to issue described in this bug: https://bugs.kde.org/show_bug.cgi?id=337900

It would be nice to get this bug acknowledged by the maintainer, otherwise I'm happy to file a new one, and get dirmngr fixed. The patch mentioned above works.
Comment by Mauro Vale (zutaporco) - Sunday, 03 August 2014, 22:18 GMT
Hi, I can confirm this bug too, it is a show stopper for Kmail with S/Mime.

Applying the above patch fixes the problem
Comment by Sebastian Herbst (moh) - Sunday, 03 August 2014, 22:38 GMT
I can confirm this bug, too. Dirmngr crashes, and so S/MIME does not work in Kmail. As I don't know, how to apply patch patch in a clean way, I cannot confirm the fix.
Comment by Mauro Vale (zutaporco) - Monday, 04 August 2014, 22:11 GMT
For anyone trying to patch dirmngr:

1 - use abs (https://wiki.archlinux.org/index.php/Arch_Build_System):
$ sudo abs core

2 - Copy dirmmngr to your home folder:
$ sudo cp -vrfp /var/abs/core/dirmngr ~/

3 - Change folder/files permission to your user (replace user with your username):
$ sudo chow -R user:user ~/dirmngr

4 - Download above patch and put it inside the dirmngr folder
$ cd dirmngr
$ curl https://bugs.archlinux.org/task/38560?getfile=11445 > dirmngr-pth-fix.patch

5 - Edit PKGBUILD file:
$ vim PKGBUILD

Add to the line source the patch:
source=(ftp://ftp.gnupg.org/gcrypt/$pkgname/$pkgname-$pkgver.tar.bz2 dirmngr-pth-fix.patch)

Save the file and the run updpkgsums:
$ updpkgsums

6 - Edit again PKGBUILD and replace build() with the following:

build() {
cd $srcdir/$pkgname-$pkgver
cd src
patch -Np1 -i ../../dirmngr-pth-fix.patch
cd ..
# FIX for https://bugzilla.redhat.com/565131
# not sure how best to turn this into something more upstreamable
# patch configure to try this combo first? -- Rex
# https://bugs.archlinux.org/task/28606
export LDAPLIBS="-lldap -llber"
./configure --prefix=/usr --libexecdir=/usr/lib
make
}


Save the file and run makepkg -s:

$ makepkg -s

7 - Finally install the new package:

$ sudo pacman -U dirmngr-1.1.1-2-x86_64.pkg.tar.xz

Enjoy your patched file :P




Loading...