Bug 2689 - segfault when trying to view info about pgp/smime sign
: segfault when trying to view info about pgp/smime sign
Status: RESOLVED FIXED
Product: Claws Mail
Classification: Unclassified
Component: Plugins
: 3.8.1
: PC Linux
: P3 normal
Assigned To: users
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-02 12:19 CEST by Alexander Tsoy
Modified: 2012-10-05 20:05 CEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Tsoy 2012-07-02 12:19:03 CEST
When I open any signed message (pgp or smime) and press "View full information" button I get segfault. I hit this bug only if Claws Mail is compiled with "-O2", no problems with "-O0".

OS: Gentoo Hardened (maybe this is relevant)

Trace:

$ LANG=C gdb /usr/bin/claws-mail ./Mail/local/admin-notify/cron/core
GNU gdb (Gentoo 7.3.1 p2) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/bin/claws-mail...done.
[New LWP 2141]
[New LWP 2142]
[New LWP 2143]
[New LWP 2144]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by `claws-mail'.
Program terminated with signal 11, Segmentation fault.
#0  0x00006d9823d4bf12 in vfprintf () from /lib64/libc.so.6
(gdb) thread apply all bt

Thread 4 (Thread 0x6d9811b02700 (LWP 2144)):
#0  0x00006d9823dcd53b in poll () from /lib64/libc.so.6
#1  0x00006d982461cc7b in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00006d982461d498 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
#3  0x00006d98232fcf29 in ?? () from /usr/lib64/libgio-2.0.so.0
#4  0x00006d9824646af9 in ?? () from /usr/lib64/libglib-2.0.so.0
#5  0x00006d9824d65b04 in start_thread () from /lib64/libpthread.so.0
#6  0x00006d9823dd55cd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x6d9813399700 (LWP 2143)):
#0  0x00006d9824d6995b in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00006d98249037b9 in ?? () from /usr/lib64/libgthread-2.0.so.0
#2  0x00006d98245ed475 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00006d98245edee2 in g_async_queue_timed_pop () from /usr/lib64/libglib-2.0.so.0
#4  0x00006d9824649101 in ?? () from /usr/lib64/libglib-2.0.so.0
#5  0x00006d9824646af9 in ?? () from /usr/lib64/libglib-2.0.so.0
#6  0x00006d9824d65b04 in start_thread () from /lib64/libpthread.so.0
#7  0x00006d9823dd55cd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x6d981bc99700 (LWP 2142)):
#0  0x00006d9824d695dc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00006d98240b95e6 in mailsem_internal_wait () from /usr/lib64/libetpan.so.16
#2  0x00000007af672159 in thread_run (data=0x7b1de4f70)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/etpan/etpan-thread-manager.c:324
#3  0x00006d9824d65b04 in start_thread () from /lib64/libpthread.so.0
#4  0x00006d9823dd55cd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x6d981d39f8e0 (LWP 2141)):
#0  0x00006d9823d4bf12 in vfprintf () from /lib64/libc.so.6
#1  0x00006d9823de999c in __vasprintf_chk () from /lib64/libc.so.6
#2  0x00006d982466565b in g_vasprintf () from /usr/lib64/libglib-2.0.so.0
#3  0x00006d982464253a in g_string_append_vprintf () from /usr/lib64/libglib-2.0.so.0
#4  0x00006d982464277b in g_string_append_printf () from /usr/lib64/libglib-2.0.so.0
#5  0x00006d980bbd9c73 in sgpgme_sigstat_info_full (ctx=0x7b232b910, status=<optimized out>)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/plugins/pgpcore/sgpgme.c:329
#6  0x00000007af5bae77 in privacy_mimeinfo_sig_info_full (mimeinfo=0x7b23cfce0)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/privacy.c:277
#7  0x00000007af552d09 in display_full_info_cb (widget=<optimized out>, user_data=0x7b1ce9320)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/mimeview.c:1348
#8  0x00000007af5629d1 in noticeview_button_pressed (button=<optimized out>, noticeview=<optimized out>)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/noticeview.c:201
#9  noticeview_icon_pressed (noticeview=<optimized out>, widget=<optimized out>, evt=<optimized out>)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/noticeview.c:209
#10 noticeview_icon_pressed (widget=<optimized out>, evt=<optimized out>, noticeview=<optimized out>)
    at /var/tmp/portage/mail-client/claws-mail-3.8.1/work/claws-mail-3.8.1/src/noticeview.c:205
#11 0x00006d9826a5b4ec in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#12 0x00006d9824b181d2 in g_closure_invoke () from /usr/lib64/libgobject-2.0.so.0
#13 0x00006d9824b2bbb8 in ?? () from /usr/lib64/libgobject-2.0.so.0
#14 0x00006d9824b34a4f in g_signal_emit_valist () from /usr/lib64/libgobject-2.0.so.0
#15 0x00006d9824b34e3c in g_signal_emit () from /usr/lib64/libgobject-2.0.so.0
#16 0x00006d9826b8dabd in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#17 0x00006d9826a59687 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
#18 0x00006d9826a599fc in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
#19 0x00006d98266ad78f in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#20 0x00006d982461c787 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#21 0x00006d982461cef7 in ?? () from /usr/lib64/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
Comment 1 Ricardo Mones 2012-07-02 13:00:28 CEST
I think this patch should fix it, could you try applying?

-----
diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 136b90f..348aa38 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -326,7 +326,7 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verif
                                j++;
                                user = user->next;
                        }
-                       g_string_append_printf(siginfo,
+                       g_string_append(siginfo,
                                _("Primary key fingerprint:"));
                        const char* primary_fpr = NULL;
                        if (key && key->subkeys && key->subkeys->fpr)
-----
Comment 2 Alexander Tsoy 2012-07-02 13:52:18 CEST
Yes! It seems that this patch fixed this issue.
Comment 3 users 2012-07-10 16:11:34 CEST
Changes related to this bug have been committed.
Please check latest CVS and update the bug accordingly.
You can also get the patch from:
http://www.claws-mail.org/tracker/

2012-07-10 [mones]	3.8.1cvs12

	* src/plugins/pgpcore/sgpgme.c
		Fix bug 2689, 'segfault when trying to view info
                about pgp/smime sign'
Comment 4 Kyrill Detinov 2012-07-15 19:01:58 CEST
*** Bug 2600 has been marked as a duplicate of this bug. ***
Comment 5 Paul 2012-10-05 20:05:43 CEST
*** Bug 2748 has been marked as a duplicate of this bug. ***