evolution crashed with SIGSEGV, while pasting from clipboard

Bug #1570110 reported by Thiago Martins
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
WebKit
Fix Released
Medium
webkitgtk (Ubuntu)
Fix Released
High
Unassigned
Trusty
Won't Fix
Undecided
Unassigned
Xenial
Fix Released
High
Unassigned

Bug Description

* Impact
some webkitgtk consumers like the evolution composer hit segfault issues

* Test case
- Click New > Compose Email Message
- Enter any email address in 'To:'
- Enter anything into 'Subject"
- Go to any webpage, and highlight a few lines
- Click 'ctrl c'
- Place cursor into the body of the open Compose Message window
- Click 'ctrl v'

* Regression potential
it's a webkit update so could impact other clients of the library, check that the html rendering in those

------------------------------------

Guys,

 Evolution on Xenial crashes most of times that I want to copy and paste stuff into Mail composer window.

 From what I'm seeing, if the stuff inside of the clipboard is formatted, with big fonts, tables, etc, it crashes.

 The workaround is to use "Diodon" to paste into Evolution without any formatting, or, to open an vim session on Terminal, paste into it first, then, copy it again from vim, and paste into Evolution, this way, it doesn't crash.

 Looks very easy to reproduce!

Cheers!
Thiago

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: evolution 3.18.5.2-0ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-18.34-generic 4.4.6
Uname: Linux 4.4.0-18-generic x86_64
ApportVersion: 2.20.1-0ubuntu1
Architecture: amd64
CrashCounter: 1
CurrentDesktop: Unity
Date: Wed Apr 13 18:35:02 2016
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/evolution
InstallationDate: Installed on 2016-01-30 (74 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Alpha amd64 (20160130)
ProcCmdline: evolution
SegvAnalysis:
 Segfault happened at: 0x7f9bdaf3d949: cmpq $0x0,0x18(%rax)
 PC (0x7f9bdaf3d949) ok
 source "$0x0" ok
 destination "0x18(%rax)" (0x654e2073656d696c) not located in a known VMA region (needed writable region)!
SegvReason: writing unknown VMA
Signal: 11
SourcePackage: evolution
StacktraceTop:
 ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
 ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
 ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
 ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
 ?? () from /usr/lib/x86_64-linux-gnu/libwebkitgtk-3.0.so.0
Title: evolution crashed with SIGSEGV
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirtd lpadmin lxd plugdev sambashare sudo

Revision history for this message
In , Michael Gratton (mjog) wrote :
Download full text (3.9 KiB)

WebKitGTK+ 2.4.10 seems to have introduced a bug that is causing a crash when loading HTML images in Geary (See https://bugzilla.gnome.org/show_bug.cgi?id=763933). This didn't occur using earlier versions of WebKitGTK+.

Geary currently implements user-controlled image loading by what amounts to using a random scheme string for the IMG SRC attribute - when the user has assented to loading images for a specific message, it updates every IMG SRC attribute value to be prefixed with the random scheme. The crash occurs during this process, at random, when displaying a HTML message.

A workaround exists in removing the src element first using webkit_dom_element_remove_attribute(), causing the subsequent call to webkit_dom_element_set_attribute() not crash. Workarounds that do not work include cloning the IMG element and setting the SRC element on that instead, nor does casting the element and using webkit_dom_html_image_element_set_src(). I didn't try creating a new Attr instance, setting the value on that, then setting that on the IMG element.

I know you guys aren't interested in supporting 2.4.x, but I thought I'd log it since it's a regression with 2.4.10 (thanks for doing a new release, BTW!).

Thread 1 "geary" received signal SIGSEGV, Segmentation fault.
WebCore::AXObjectCache::handleAttributeChanged (this=0x7fff9191b500, attrName=..., element=0x5df8210)
    at ../Source/WebCore/accessibility/AXObjectCache.cpp:880
880 if (!attrName.localName().string().startsWith("aria-"))
(gdb) bt
#0 0x00007ffff4d8aae9 in WebCore::AXObjectCache::handleAttributeChanged(WebCore::QualifiedName const&, WebCore::Element*) (this=0x7fff9191b500, attrName=..., element=0x5df8210) at ../Source/WebCore/accessibility/AXObjectCache.cpp:880
#1 0x00007ffff4f8105a in WebCore::Element::attributeChanged(WebCore::QualifiedName const&, WTF::AtomicString const&, WTF::AtomicString const&, WebCore::Element::AttributeModificationReason) (this=0x5df8210, name=..., oldValue=..., newValue=...)
    at ../Source/WebCore/dom/Element.cpp:1137
#2 0x00007ffff4f80530 in WebCore::Element::didModifyAttribute(WebCore::QualifiedName const&, WTF::AtomicString const&, WTF::AtomicString const&) (this=this@entry=0x5df8210, name=..., oldValue=..., newValue=...) at ../Source/WebCore/dom/Element.cpp:2851
#3 0x00007ffff4f8777d in WebCore::Element::setAttributeInternal(unsigned int, WebCore::QualifiedName const&, WTF::AtomicString const&, WebCore::Element::SynchronizationOfLazyAttribute) (this=this@entry=0x5df8210, index=<optimised out>, name=..., newValue=..., inSynchronizationOfLazyAttribute=inSynchronizationOfLazyAttribute@entry=WebCore::Element::NotInSynchronizationOfLazyAttribute)
    at ../Source/WebCore/dom/Element.cpp:1075
#4 0x00007ffff4f8494f in WebCore::Element::setAttribute(WTF::AtomicString const&, WTF::AtomicString const&, int&) (this=this@entry=0x5df8210, localName=..., value=..., ec=@0x7fffffffddec: 0) at ../Source/WebCore/dom/Element.cpp:1027
#5 0x00007ffff5bd7a5c in webkit_dom_element_set_attribute(WebKitDOMElement*, gchar const*, gchar const*, GError**) (self=self@entry=0x5dcd0b0 [WebKitDOMHTMLImageElement], name=name@entry=0x6ac5bc "src", value=value@entry=0x5851a00 "glxaowi...

Read more...

Revision history for this message
In , Michael Gratton (mjog) wrote :

NB, while the crash occurs in WebCore::AXObjectCache::handleAttributeChanged, I don't think it's related to accessibility, by that stage attrName has gone bad: attrName.m_impl is pointing to an invalid memory location.

Revision history for this message
In , Michael Gratton (mjog) wrote :

This seems to be not just limited to setting IMG SRC attributes. Geary is also occasionally crashing when pasting content into an editable web view, with a similar top of the stack, e.g.: https://bugzilla.gnome.org/show_bug.cgi?id=764168

They seem to be related in that in both cases, an attribute value is being set via the DOM API in a document that is already being displayed by a web view.

Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :

We received 1333 reports of this crash from Evolution and Geary users in Fedora in the past two weeks. It is definitely a regression from the 2.4.10 update.

There are possibly more reports, but since it's a WebKit1 crash the crashes get assigned to individual applications rather than to WebKit, making it impossible to search for them. I only checked Evolution and Geary.

Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :
Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :

(In reply to comment #2)
> This seems to be not just limited to setting IMG SRC attributes. Geary is
> also occasionally crashing when pasting content into an editable web view,
> with a similar top of the stack, e.g.:
> https://bugzilla.gnome.org/show_bug.cgi?id=764168
>
> They seem to be related in that in both cases, an attribute value is being
> set via the DOM API in a document that is already being displayed by a web
> view.

This is how Evolution is crashing as well (at least, it's the report for which we received a description and full backtrace, see the See Also field).

Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :
Download full text (18.1 KiB)

(In reply to comment #5)
> This is how Evolution is crashing as well (at least, it's the report for
> which we received a description and full backtrace, see the See Also field).

Sigh, I realize this is a private bug... I think thread 1 is probably the only important part; note the string "aria-" in the crash frame.

Core was generated by `/usr/bin/evolution'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 WTF::StringImpl::startsWith (this=0xbad801d800000002, matchString=matchString@entry=0x7f85ba36fea7 "aria-", matchLength=matchLength@entry=5, caseSensitive=caseSensitive@entry=true) at Source/WTF/wtf/text/StringImpl.cpp:1363
1363 if (matchLength > length())
[Current thread is 1 (Thread 0x7f85c0247ac0 (LWP 17496))]

Thread 1 (Thread 0x7f85c0247ac0 (LWP 17496)):
#0 WTF::StringImpl::startsWith (this=0xbad801d800000002, matchString=matchString@entry=0x7f85ba36fea7 "aria-", matchLength=matchLength@entry=5, caseSensitive=caseSensitive@entry=true) at Source/WTF/wtf/text/StringImpl.cpp:1363
No locals.
#1 0x00007f85b8f3e00f in WTF::StringImpl::startsWith<6u> (caseSensitive=true, prefix=..., this=<optimized out>) at Source/WTF/wtf/text/StringImpl.h:730
No locals.
#2 WTF::String::startsWith<6u> (caseSensitive=true, prefix=..., this=<optimized out>) at Source/WTF/wtf/text/WTFString.h:281
No locals.
#3 WebCore::AXObjectCache::handleAttributeChanged (this=0x7f851b997f00, attrName=..., element=0x558fcfb67cb0) at Source/WebCore/accessibility/AXObjectCache.cpp:880
No locals.
#4 0x00007f85b91641ea in WebCore::Element::attributeChanged (this=0x558fcfb67cb0, name=..., oldValue=..., newValue=...) at Source/WebCore/dom/Element.cpp:1137
        cache = <optimized out>
        styleResolver = <optimized out>
        testShouldInvalidateStyle = true
        shouldInvalidateStyle = <optimized out>
#5 0x00007f85b9163520 in WebCore::Element::didModifyAttribute (this=this@entry=0x558fcfb67cb0, name=..., oldValue=..., newValue=...) at Source/WebCore/dom/Element.cpp:2851
No locals.
#6 0x00007f85b916b449 in WebCore::Element::setAttributeInternal (this=0x558fcfb67cb0, index=<optimized out>, name=..., newValue=..., inSynchronizationOfLazyAttribute=WebCore::Element::NotInSynchronizationOfLazyAttribute) at Source/WebCore/dom/Element.cpp:1075
        oldValue = {m_string = {m_impl = {m_ptr = 0x7f858c676000}}}
        valueChanged = <optimized out>
        attributeName = <optimized out>
#7 0x00007f85b91de4b9 in WebCore::CompositeEditCommand::applyCommandToComposite (this=this@entry=0x7f853a37c900, prpCommand=...) at Source/WebCore/editing/CompositeEditCommand.cpp:278
        command = {m_ptr = 0x7f853a56ad20}
#8 0x00007f85b91e4f1a in WebCore::CompositeEditCommand::setNodeAttribute (this=this@entry=0x7f853a37c900, element=..., attribute=..., value=...) at Source/WebCore/editing/CompositeEditCommand.cpp:664
No locals.
#9 0x00007f85b926c8f9 in WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline (this=this@entry=0x7f853a37c900, insertedNodes=...) at Source/WebCore/editing/ReplaceSelectionCommand.cpp:525
        element = 0x558fcfb67cb0
        inlineStyle = 0x7f853a3cb410
        newInlineStyle = {m_ptr = 0x7f851b975b70}
  ...

Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :

Comment from the downstream bug:

"""Ok, I've done a bit more experimentation and I think I can give you some additional info, hopefully even useful!

If I have my email format set to Plain Text, I cannot get the crash that I reported regardless of how or what I copy/paste.

If I have the email format set to HTML, I cannot get the crash if I copy plain text into the email. However, If I copy HTML text into the email I can reproduce the crash every time.

The specific steps to reproduce are as follows:

- Click New > Compose Email Message
- Enter any email address in 'To:'
- Enter anything into 'Subject"
- Go to any webpage, and highlight a few lines
- Click 'ctrl c'
- Place cursor into the body of the open Compose Message window
- Click 'ctrl v'
- Crash will occur 100% of time for me.

The trick seems to be to have the email formatting to be HTML and then copy-paste HTML content.

Hopefully this is helpful."""

Seems it's 100% reproducible for some users, but not for others.

Revision history for this message
In , Tpopela (tpopela) wrote :

(In reply to comment #7)
> Seems it's 100% reproducible for some users, but not for others.

It would be easy to bisect to the bad commit, but when we can't reproduce this on our machines:/.

Revision history for this message
In , Tpopela (tpopela) wrote :

With Milan we figured out that this backported change http://trac.webkit.org/changeset/197274 had a follow-up (security bug) http://trac.webkit.org/changeset/165044 that was not backported and is causing the crash.

Revision history for this message
In , Mcatanzaro (mcatanzaro) wrote :

Just an FYI, we're up to 1,871 reports of this crash, i.e. we got over 500 new reports over this past weekend.

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

(In reply to comment #10)
> Just an FYI, we're up to 1,871 reports of this crash, i.e. we got over 500
> new reports over this past weekend.

I'll fix t and make a new release as soon as I find the time

Revision history for this message
In , Cgarcia-f (cgarcia-f) wrote :

Patch backported to 2.4 branch in r199282. Thanks!

Revision history for this message
Thiago Martins (martinx) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 WebCore::HTMLElement::parseAttribute (this=0x557263c7e070, name=..., value=...) at ../Source/WebCore/html/HTMLElement.cpp:349
 WebCore::Element::attributeChanged (this=0x557263c7e070, name=..., oldValue=..., newValue=...) at ../Source/WebCore/dom/Element.cpp:1097
 WebCore::Element::didModifyAttribute (this=this@entry=0x557263c7e070, name=..., oldValue=..., newValue=...) at ../Source/WebCore/dom/Element.cpp:2851
 WebCore::Element::setAttributeInternal (this=0x557263c7e070, index=<optimized out>, name=..., newValue=..., inSynchronizationOfLazyAttribute=<optimized out>) at ../Source/WebCore/dom/Element.cpp:1075
 WebCore::CompositeEditCommand::applyCommandToComposite (this=this@entry=0x7f9b5b7c27e0, prpCommand=...) at ../Source/WebCore/editing/CompositeEditCommand.cpp:278

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in evolution (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
Sebastien Bacher (seb128) wrote :

that bug is fixed in 2.4.11 upstream, that should probably be SRUed

information type: Private → Public
affects: evolution (Ubuntu) → webkitgtk (Ubuntu)
Changed in webkitgtk (Ubuntu):
importance: Medium → High
status: New → Fix Committed
Changed in webkit-open-source:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Exactly, Trusty also needs 2.4.11.

Changed in webkitgtk (Ubuntu):
status: Fix Committed → Confirmed
Revision history for this message
Van Stokes, Jr. (vstokes) wrote :

This problem still persists in Gnome Ubuntu 16.04 X64:

$ uname -a
Linux eerlon 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

$ evolution --version
evolution 3.18.5.2

Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Please merge webkitgtk 2.4.11-1 from Debian Bug #1571071

tags: added: desktop-trello-import
Revision history for this message
Will Cooke (willcooke) wrote : Automatically added comment
tags: removed: desktop-trello-import
Changed in webkitgtk (Ubuntu):
status: Confirmed → In Progress
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :

I uploaded 2.4.11 to yakkety and as a SRU to 16.04

Revision history for this message
Amr Ibrahim (amribrahim1987) wrote :

Thanks Sebastien. I guess 14.04 is also affected.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webkitgtk - 2.4.11-0ubuntu1

---------------
webkitgtk (2.4.11-0ubuntu1) yakkety; urgency=medium

  * New upstream version:
    - "Fix a crash when changing elment attributes with DOM bindings"
      which impacts the evolution composer for example (lp: #1570110)
  * debian/patches/fix-arm64-build.patch:
    - dropped, the issue is resolved in the new version

 -- Sebastien Bacher <email address hidden> Fri, 13 May 2016 10:52:06 +0200

Changed in webkitgtk (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Thiago, or anyone else affected,

Accepted webkitgtk into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/webkitgtk/2.4.11-0ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Changed in webkitgtk (Ubuntu Xenial):
status: New → Fix Committed
Mathew Hodson (mhodson)
Changed in webkitgtk (Ubuntu Xenial):
importance: Undecided → High
tags: added: regression-update
Mathew Hodson (mhodson)
tags: added: trusty
Revision history for this message
Sebastien Bacher (seb128) wrote :

the steps to trigger the segfault doesn't hit the bug here neither with the old version nor the new one but I've been using evolution on different html files with the old and new version and have no issue and no visible regression. Empathy works fine as well

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package webkitgtk - 2.4.11-0ubuntu0.1

---------------
webkitgtk (2.4.11-0ubuntu0.1) xenial; urgency=medium

  * New upstream version:
    - "Fix a crash when changing elment attributes with DOM bindings"
      which impacts the evolution composer for example (lp: #1570110)
  * debian/patches/fix-arm64-build.patch:
    - remove, this has been fixed upstream.

 -- Sebastien Bacher <email address hidden> Fri, 13 May 2016 10:52:06 +0200

Changed in webkitgtk (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for webkitgtk has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Adrian Bunk (bunk) wrote :

I have re-added the Ubuntu Stable Release Updates Team:

As was already mentioned here, this regression was also introduced in trusty.

The same fix is therefore required in trusty, and in other supported releases that got the 2.4.10 security update.

Changed in webkitgtk (Ubuntu Trusty):
assignee: nobody → Sebastien Bacher (seb128)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in webkitgtk (Ubuntu Trusty):
status: New → Confirmed
Revision history for this message
jamina1 (jamina1) wrote :

I can't get it to add Wily, but I'm on Xubuntu Wily and I have the same problem. Great that it's been fixed in Xenial, but I need it backported :(

no longer affects: wily (Ubuntu)
no longer affects: wily (Ubuntu Trusty)
no longer affects: wily (Ubuntu Xenial)
Revision history for this message
Brian Murray (brian-murray) wrote :

Wily recently reached End of Life and is no longer supported so this will not be fixed in that release.

Changed in webkitgtk (Ubuntu Trusty):
status: Confirmed → Won't Fix
assignee: Sebastien Bacher (seb128) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.