Bug 3778 - Claws-mail core dumps when trying to view a HTML email
Summary: Claws-mail core dumps when trying to view a HTML email
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Plugins/Fancy (show other bugs)
Version: 3.15.0
Hardware: PC FreeBSD
: P3 critical
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2017-03-04 16:15 UTC by Michael Hughes
Modified: 2017-03-16 18:56 UTC (History)
0 users

See Also:


Attachments
Back trace from core dump (2.25 KB, text/plain)
2017-03-04 16:15 UTC, Michael Hughes
no flags Details
truss of version that doesn't work (95.08 KB, text/plain)
2017-03-11 02:14 UTC, Michael Hughes
no flags Details
truss of version that does work (95.08 KB, text/plain)
2017-03-11 02:15 UTC, Michael Hughes
no flags Details
truss of version that doesn't work (219.61 KB, text/plain)
2017-03-11 02:21 UTC, Michael Hughes
no flags Details

Description Michael Hughes 2017-03-04 16:15:41 UTC
Created attachment 1722 [details]
Back trace from core dump

When updating from version 3.14.1-167-g8e02f3 to version 3.14.1-220-ga3050f the Fancy plugin makes Claws-mail core dump when trying to view a HTML formatted email.

System Information
GTK+ 2.24.29 / GLib 2.46.2
Locale: C (charset: US-ASCII)
Operating System: FreeBSD 9.3-RELEASE-p39 (amd64)
Comment 1 Michael Hughes 2017-03-04 16:20:02 UTC
webkit-gtk2-2.4.11_5
Comment 2 Paul 2017-03-06 18:37:48 UTC
This happens only one message in particular?

It doesn't seem to be related to any changes in claws-mail between 3.14.1-167 and 3.14.1-220. The only change to the fancy plugin is this, apparently inconsequential, change: 
http://git.claws-mail.org/?p=claws.git;a=commit;h=8d14c43a29b4d51bfd36cda6ac9e023d4bc87f9e
Comment 3 Michael Hughes 2017-03-07 01:05:07 UTC
It seems to be any HTML formatted message, most of the messages have images in them.  I will have to see if I can find one that doesn't have an image and see if it core dumps on text only HTML formatted messages.
Comment 4 Michael Hughes 2017-03-07 03:54:41 UTC
All text HTML messages render without a problem, but anything with an image in it makes Claws-mail core dump.
Comment 5 Michael Hughes 2017-03-11 02:14:44 UTC
Created attachment 1730 [details]
truss of version that doesn't work
Comment 6 Michael Hughes 2017-03-11 02:15:22 UTC
Created attachment 1731 [details]
truss of version that does work
Comment 7 Michael Hughes 2017-03-11 02:21:14 UTC
Created attachment 1732 [details]
truss of version that doesn't work
Comment 8 Michael Hughes 2017-03-13 18:32:45 UTC
I have found that it was commit cdf48fc3e9ce71ef09c0b9ddbdf7057f6d36e6da that cause the problem.

I then updated librsvg2 from 2.36.4_2 to 2.40.16 and now Claws Mail works at version 3.14.1-224-g3fd978.

I'm not sure why the older library was causing a problem, but I think this bug can be closed.
Comment 9 Michael Rasmussen 2017-03-13 19:14:02 UTC
(In reply to comment #8)
> 
> I'm not sure why the older library was causing a problem, but I think this
> bug can be closed.
An API change perhaps?
Comment 10 Ricardo Mones 2017-03-14 08:06:56 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > 
> > I'm not sure why the older library was causing a problem, but I think this
> > bug can be closed.
> An API change perhaps?

There's no call to librsvg functions in the mentioned commit. The only way that commit could affect behaviour of fancy is that some of the flags/libs emitted by librsvg were affecting how the webkit functions are compiled.

Anyway, given the CVEs affecting older versions¹, it's probably a good idea to bump required version to 2.40.

¹ https://security-tracker.debian.org/tracker/source-package/librsvg
Comment 11 Michael Hughes 2017-03-14 11:18:46 UTC
I did a "git checkout <revision>" for each commit done from the commit that was working for me and compiled each time.  Ran Claws Mail and opened the same HTML email till it core dumped.  It didn't core dump till I got the the commit with the "Configure SVG library" commit.  After it core dumped I upgraded the librsvg2 library and recompile Claws Mail without any changes to the Claws Mail code.  Ran Claws Mail, opened the same HTML email and it didn't core dump.  I then downloaded the rest of the commits and recompiled and Claws Mail is still running.

So I'm not sure why, but it was something to do with configuring SVG library.
Comment 12 Ricardo Mones 2017-03-14 11:44:52 UTC
(In reply to comment #11)
> I did a "git checkout <revision>" for each commit done from the commit that
> was working for me and compiled each time.  Ran Claws Mail and opened the
> same HTML email till it core dumped.  It didn't core dump till I got the the
> commit with the "Configure SVG library" commit.  After it core dumped I
> upgraded the librsvg2 library and recompile Claws Mail without any changes
> to the Claws Mail code.  Ran Claws Mail, opened the same HTML email and it
> didn't core dump.  I then downloaded the rest of the commits and recompiled
> and Claws Mail is still running.

If I may suggest, next time you can try git bisect, is faster than linear search: https://git-scm.com/docs/git-bisect

> So I'm not sure why, but it was something to do with configuring SVG library.

Yep, that's more or less what I wrote. My response was to miras' comment, not against your report ;-)
Comment 13 users 2017-03-16 18:53:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2017-03-16 19:53:02.691944577 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=88110ffe23e2f5a0f4e0267b36b6a3eac8402bdd
Merge: a6b0c1e da399f4
Author: Colin Leroy <colin@colino.net>
Date:   Thu Mar 16 19:53:02 2017 +0100

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=da399f43f30dd459dbdfe5b4f28c1baa8ac9d0a0
Author: Ricardo Mones <ricardo@mones.org>
Date:   Thu Mar 16 19:52:27 2017 +0100

    Require SVG library version 2.40.5
    
    Fix bug #3778: Claws-mail core dumps when trying to view a HTML email

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