Bug 4196 - Claws Mail keeps crashing. Error log suggests spgpme.c:100 as a culprit.
Summary: Claws Mail keeps crashing. Error log suggests spgpme.c:100 as a culprit.
Status: RESOLVED INVALID
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Privacy/PGP (show other bugs)
Version: 3.17.3
Hardware: PC Linux
: P3 critical
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2019-04-10 13:50 UTC by Blubberbub
Modified: 2019-05-13 08:55 UTC (History)
0 users

See Also:


Attachments

Description Blubberbub 2019-04-10 13:50:04 UTC
Recently my Claws Mail started to crash after a few minutes of active usage. I cannot nail it down to any specific action that causes a crash, because it happens so often.

I'm on ArchLinux and i *think* the problem got worse when the package got updated from 3.17.3-1 to 3.17.3-2 but the changes made seem very unrelated to anything? (Changes: https://git.archlinux.org/svntogit/packages.git/commit/?h=packages/claws-mail&id=1d104639efe7a0a9601011a7789823745b89ec23). 

`sgpgme.c:110:err code 0` seems to always be one of the last lines in the `--debug` output.

Tail of the log showing the crash with gdb according to https://www.claws-mail.org/faq/index.php/Debugging_Claws (on 3.17.3-2):

```
imap.c:1581:message 50542 has been already fully cached.
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
    message/rfc822 (offset:0 length:48405 encoding: 6)
        multipart/signed (offset:4747 length:43658 encoding: 6)
            multipart/alternative (offset:4883 length:32865 encoding: 6)
                text/plain (offset:5016 length:11768 encoding: 3)
                text/html (offset:16916 length:20785 encoding: 3)
            application/pkcs7-signature (offset:37942 length:10416 encoding: 4)
procheader.c:174:generic_get_one_field: empty line
mimeview.c:509:signed mail
sgpgme.c:100:status == NULL
sgpgme.c:100:status == NULL
mimeview.c:829:text/calendar
sgpgme.c:100:status == NULL
sgpgme.c:100:status == NULL
sgpgme.c:100:status == NULL
procheader.c:197:generic_get_one_field: empty line
textview.c:715:TIMING textview_add_part : 0s000ms
textview.c:681:TIMING textview_add_part : 0s000ms
textview.c:681:TIMING textview_add_part : 0s000ms
textview.c:1207:Viewing text content of type: plain (length: 10926)
textview.c:831:TIMING textview_add_part : 0s046ms
textview.c:848:TIMING recursive_add_parts : 0s046ms
textview.c:894:TIMING recursive_add_parts : 0s046ms
textview.c:831:TIMING textview_add_part : 0s000ms
textview.c:848:TIMING recursive_add_parts : 0s000ms
textview.c:894:TIMING recursive_add_parts : 0s046ms
textview.c:894:TIMING recursive_add_parts : 0s047ms
textview.c:654:TIMING textview_show_part : 0s047ms
sgpgme.c:100:status == NULL
mimeview.c:1267:creating thread
[New Thread 0x7fffe93b3700 (LWP 25716)]
mimeview.c:1176:checking...
smime.c:223:Checking S/MIME signature
[New Thread 0x7fffe8bb2700 (LWP 25717)]
mimeview.c:1212:waiting a while
summaryview.c:3817:TIMING summary_display_msg_full : 0s058ms
sgpgme.c:465:data 0x7fffe93b17b8 (37942 10416)
[Detaching after fork from child process 25718]
mimeview.c:1132:mimeview_check_sig_thread_cb
sgpgme.c:110:err code 0
[Thread 0x7fffe93b3700 (LWP 25716) exited]

Thread 7 "claws-mail" received signal SIG32, Real-time event 32.
[Switching to Thread 0x7fffe8bb2700 (LWP 25717)]
0x00007ffff757f850 in nanosleep () from /usr/lib/libpthread.so.0
(gdb) thread apply all bt

Thread 7 (Thread 0x7fffe8bb2700 (LWP 25717)):
#0  0x00007ffff757f850 in nanosleep () at /usr/lib/libpthread.so.0
#1  0x00007ffff68be571 in g_usleep () at /usr/lib/libglib-2.0.so.0
#2  0x000055555575cc8d in  ()
#3  0x00007ffff7575a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff6295b23 in clone () at /usr/lib/libc.so.6

Thread 5 (Thread 0x7fffeb018700 (LWP 25699)):
#0  0x00007ffff628ac21 in poll () at /usr/lib/libc.so.6
#1  0x00007fffeb5e1673 in  () at /usr/lib/libpulse.so.0
#2  0x00007fffeb5d2990 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
#3  0x00007fffeb5d2fe0 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#4  0x00007fffeb5d3091 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#5  0x00007fffeb5e15ae in  () at /usr/lib/libpulse.so.0
#6  0x00007fffeb3809fc in  () at /usr/lib/pulseaudio/libpulsecommon-12.2.so
#7  0x00007ffff7575a9d in start_thread () at /usr/lib/libpthread.so.0
#8  0x00007ffff6295b23 in clone () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffebfff700 (LWP 25698)):
#0  0x00007ffff757bafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff653d1dc in mailsem_internal_wait () at /usr/lib/libetpan.so.20
#2  0x000055555590253d in  ()
#3  0x00007ffff7575a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff6295b23 in clone () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7ffff0a59700 (LWP 25697)):
#0  0x00007ffff628ac21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff68f5690 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff68f66d2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff6a90568 in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007ffff68d0c21 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7575a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff6295b23 in clone () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7ffff125a700 (LWP 25696)):
#0  0x00007ffff628ac21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff68f5690 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff68f577e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff68f57d2 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff68d0c21 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7575a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff6295b23 in clone () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7ffff1f1ed00 (LWP 25692)):
#0  0x00007ffff6262742 in fork () at /usr/lib/libc.so.6
#1  0x00007fffea2207b6 in  () at /usr/lib/libgpgme.so.11
#2  0x00007fffea226555 in  () at /usr/lib/libgpgme.so.11
#3  0x00007fffea2106c3 in  () at /usr/lib/libgpgme.so.11
#4  0x00007fffea225804 in gpgme_ctx_set_engine_info () at /usr/lib/libgpgme.so.11
#5  0x00007fffea2080c5 in gpgme_get_key () at /usr/lib/libgpgme.so.11
#6  0x00007fffea7f8556 in sgpgme_sigstat_info_short () at /usr/lib/claws-mail/plugins/pgpcore.so
#7  0x00007ffff0183e16 in  () at /usr/lib/claws-mail/plugins/smime.so
#8  0x00005555557ecc94 in privacy_mimeinfo_sig_info_short ()
#9  0x000055555575c5aa in  ()
#10 0x000055555575cad4 in  ()
#11 0x00007ffff68f2e53 in  () at /usr/lib/libglib-2.0.so.0
#12 0x00007ffff68f3661 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff68f5739 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff68f66d2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff7a74df3 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#16 0x000055555571ea5e in main ()
(gdb)
```

Do you have any idea, what might cause this to happen or do you have any idea what i can try to change in my setup, so its usable again?

I put the severity on "critical", but that might be a little understated, because its basically unusable.
Comment 1 Andrej Kacian 2019-04-10 14:15:34 UTC
Can you try one more backtrace, this time with GDB ignoring the harmless SIG32 signal? You can do that with GDB command "handle SIG32 nostop" before starting Claws Mail within GDB.

See for example https://gnobal.net/591/what-is-sig32-during-a-gdb-debug-session for a more detailed explanation about SIG32.
Comment 2 Blubberbub 2019-04-10 14:24:26 UTC
There is a "SIGSEGV" Shortly after the SIG32:


```
imap.c:1581:message 50571 has been already fully cached.
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
procheader.c:174:generic_get_one_field: empty line
    message/rfc822 (offset:0 length:8675 encoding: 6)
        multipart/signed (offset:923 length:7752 encoding: 6)
            text/plain (offset:1088 length:101 encoding: 3)
            application/pkcs7-signature (offset:1432 length:7199 encoding: 4)
procheader.c:174:generic_get_one_field: empty line
mimeview.c:509:signed mail
sgpgme.c:100:status == NULL
mimeview.c:829:text/calendar
sgpgme.c:100:status == NULL
sgpgme.c:100:status == NULL
procheader.c:197:generic_get_one_field: empty line
textview.c:715:TIMING textview_add_part : 0s000ms
textview.c:681:TIMING textview_add_part : 0s000ms
textview.c:1207:Viewing text content of type: plain (length: 93)
textview.c:831:TIMING textview_add_part : 0s015ms
textview.c:848:TIMING recursive_add_parts : 0s015ms
textview.c:831:TIMING textview_add_part : 0s000ms
textview.c:848:TIMING recursive_add_parts : 0s000ms
textview.c:894:TIMING recursive_add_parts : 0s015ms
textview.c:894:TIMING recursive_add_parts : 0s015ms
textview.c:654:TIMING textview_show_part : 0s016ms
sgpgme.c:100:status == NULL
mimeview.c:1267:creating thread
[New Thread 0x7fffe8bc4700 (LWP 1735)]
mimeview.c:1176:checking...
smime.c:223:Checking S/MIME signature
[New Thread 0x7fffe93c5700 (LWP 1736)]
sgpgme.c:465:data 0x7fffe8bc27b8 (1432 7199)
[Detaching after fork from child process 1737]
mimeview.c:1212:waiting a while
summaryview.c:3817:TIMING summary_display_msg_full : 0s034ms
[Thread 0x7fffe8bc4700 (LWP 1735) exited]
mimeview.c:1132:mimeview_check_sig_thread_cb
sgpgme.c:110:err code 0

Thread 13 "claws-mail" received signal SIG32, Real-time event 32.
[Detaching after fork from child process 1740]
[Thread 0x7fffe93c5700 (LWP 1736) exited]

Thread 1 "claws-mail" received signal SIGSEGV, Segmentation fault.
0x0000555556cd8200 in ?? ()
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe9bc6700 (LWP 1593)):
#0  0x00007ffff628bc21 in poll () at /usr/lib/libc.so.6
#1  0x00007fffea213673 in  () at /usr/lib/libpulse.so.0
#2  0x00007fffea204990 in pa_mainloop_poll () at /usr/lib/libpulse.so.0
#3  0x00007fffea204fe0 in pa_mainloop_iterate () at /usr/lib/libpulse.so.0
#4  0x00007fffea205091 in pa_mainloop_run () at /usr/lib/libpulse.so.0
#5  0x00007fffea2135ae in  () at /usr/lib/libpulse.so.0
#6  0x00007fffe9fb29fc in  () at /usr/lib/pulseaudio/libpulsecommon-12.2.so
#7  0x00007ffff7576a9d in start_thread () at /usr/lib/libpthread.so.0
#8  0x00007ffff6296b23 in clone () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7fffebfff700 (LWP 1580)):
#0  0x00007ffff628bc21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff68f6690 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff68f76d2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff6a91568 in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007ffff68d1c21 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7576a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff6296b23 in clone () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7ffff0947700 (LWP 1579)):
#0  0x00007ffff628bc21 in poll () at /usr/lib/libc.so.6
#1  0x00007ffff68f6690 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff68f677e in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff68f67d2 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff68d1c21 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7576a9d in start_thread () at /usr/lib/libpthread.so.0
#6  0x00007ffff6296b23 in clone () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7ffff12eb700 (LWP 1578)):
#0  0x00007ffff757cafc in pthread_cond_wait@@GLIBC_2.3.2 () at /usr/lib/libpthread.so.0
#1  0x00007ffff653e1dc in mailsem_internal_wait () at /usr/lib/libetpan.so.20
#2  0x000055555590253d in  ()
#3  0x00007ffff7576a9d in start_thread () at /usr/lib/libpthread.so.0
#4  0x00007ffff6296b23 in clone () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7ffff1f1fd00 (LWP 1573)):
#0  0x0000555556cd8200 in  ()
#1  0x00007fffeb32da92 in  () at /usr/lib/libgpgme.so.11
#2  0x00007fffeb336142 in  () at /usr/lib/libgpgme.so.11
#3  0x00007fffeb33c626 in  () at /usr/lib/libgpgme.so.11
#4  0x00007fffeb3266c3 in  () at /usr/lib/libgpgme.so.11
#5  0x00007fffeb33b804 in gpgme_ctx_set_engine_info () at /usr/lib/libgpgme.so.11
#6  0x00007fffeb31e0c5 in gpgme_get_key () at /usr/lib/libgpgme.so.11
#7  0x00007ffff013c556 in sgpgme_sigstat_info_short () at /usr/lib/claws-mail/plugins/pgpcore.so
#8  0x00007ffff0abce16 in  () at /usr/lib/claws-mail/plugins/smime.so
#9  0x00005555557ecc94 in privacy_mimeinfo_sig_info_short ()
#10 0x000055555575c5aa in  ()
#11 0x000055555575cad4 in  ()
#12 0x00007ffff68f3e53 in  () at /usr/lib/libglib-2.0.so.0
#13 0x00007ffff68f4661 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff68f6739 in  () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff68f76d2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff7a75df3 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0
#17 0x000055555571ea5e in main ()
(gdb) 
```
Comment 3 Andrej Kacian 2019-04-10 14:47:36 UTC
That is slightly more helpful, and points to a crash somewhere deep within libgpgme library. What other packages did you upgrade before this crash started happening? Was libgpgme one of them? Or perhaps libc itself?

The Claws Mail code that leads to this crash hasn't changed in several years, so I doubt there is anything we can do to prevent it, as all the signs point to a problem outside of Claws Mail.
Comment 4 Blubberbub 2019-04-10 15:10:38 UTC
Ok.
Thank you for the fast responses and sorry for bothering you with that 'probably not caused by claws-mail'-problem.

I checked and it looks like gpgme was updated fairly recently (See https://git.archlinux.org/svntogit/packages.git/log/trunk?h=packages/gpgme ).

I downgraded that package to 1.12.0-2 now and will see if the problem persists with the older version (until now it looks like it does not!).

Not really sure how i can report this to gpgme, though.
Comment 5 Paul 2019-04-29 11:24:41 UTC
Tested gpgme 1.13.0 with claws-mail here, and it works fine.
Comment 6 Blubberbub 2019-05-13 08:55:30 UTC
I recently made a fresh install of my OS on a new Laptop and i could reproduce the problem on that machine, too. (I copied the ~/.claws-mail config folder, though).

Maybe you are not receiving enough signed mails to reproduce the problem? I tend to get a lot of them...

I opened a bug report in gpgme and they think they found and fixed the error, but the fix is not released yet: https://dev.gnupg.org/T4456

Note You need to log in before you can comment on or make changes to this bug.