WebView crashes if it finishes constructing before its context

Bug #1292593 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Fix Released
Critical
Chris Coulson

Bug Description

This code causes a crash, because the second WebView completes construction before the WebContext:

import QtQuick 2.0
import QtTest 1.0
import com.canonical.Oxide 0.1

Column {
  focus: true

  WebView {
    id: webview
    width: 200
    height: 200
    context: WebContext {}
  }

  WebView {
    width: 200
    height: 200
    context: webview.context
  }
}

#0 0x00007fffdb6ad7b8 in oxide::WebView::Init(oxide::BrowserContext*, bool, gfx::Size const&) ()
   from /home/chr1s/src/oxide/oxide/objdir/out/chromium/Release/lib.target/libOxideQtCore.so.0
#1 0x00007fffdb69852f in oxide::qt::WebViewAdapter::init(oxide::qt::WebContextAdapter*, QSize const&, bool, QUrl const&, bool) ()
   from /home/chr1s/src/oxide/oxide/objdir/out/chromium/Release/lib.target/libOxideQtCore.so.0
#2 0x00007fffdf363622 in OxideQQuickWebViewPrivate::componentComplete (this=this@entry=0xd4bc40) at /home/chr1s/src/oxide/oxide/qt/quick/api/oxideqquickwebview.cc:181
#3 0x00007fffdf363cba in OxideQQuickWebView::componentComplete (this=0xd45800) at /home/chr1s/src/oxide/oxide/qt/quick/api/oxideqquickwebview.cc:318
#4 0x00007ffff6cfbc2a in QQmlVME::complete (this=this@entry=0xd25918, interrupt=...) at qml/qqmlvme.cpp:1205
#5 0x00007ffff6cf0cc2 in QQmlComponentPrivate::complete (enginePriv=0xc69a50, state=state@entry=0xd25910) at qml/qqmlcomponent.cpp:919
#6 0x00007ffff6cf0d97 in QQmlComponentPrivate::completeCreate (this=0xd25870) at qml/qqmlcomponent.cpp:956
#7 0x00007ffff6cf0c20 in QQmlComponent::create (this=this@entry=0x7fffffffe040, context=0xd20980, context@entry=0x0) at qml/qqmlcomponent.cpp:776
#8 0x000000000040283f in main (argc=4, argv=0x7fffffffe1a8) at /home/chr1s/src/oxide/oxide/qt/qmlrunner/main.cc:130

 oxide::WebView::Init() is called with a NULL BrowserContext

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

In fact, this crashes too:

import QtQuick 2.0
import QtTest 1.0
import com.canonical.Oxide 0.1

Column {
  focus: true

  WebContext {
    id: context
  }

  WebView {
    id: webview
    width: 200
    height: 200
    context: context
  }

  WebView {
    width: 200
    height: 200
    context: context
  }
}

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

And you don't even need the second webview:

import QtQuick 2.0
import QtTest 1.0
import com.canonical.Oxide 0.1

Item {
  focus: true

  WebContext {
    id: context
  }

  WebView {
    id: webview
    width: 200
    height: 200
    context: context
  }
}

Changed in oxide:
importance: Undecided → Critical
status: New → Triaged
Changed in oxide:
status: Triaged → In Progress
assignee: nobody → Chris Coulson (chrisccoulson)
Changed in oxide:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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