<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>188597</bug_id>
          
          <creation_ts>2018-08-15 02:42:20 -0700</creation_ts>
          <short_desc>[GTK] Segmentation fault when creating an instance of WebKitFindController without a WebKitWebView</short_desc>
          <delta_ts>2018-08-15 08:56:37 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hishy1950">bugzilla-webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1450255</commentid>
    <comment_count>0</comment_count>
    <who name="Hishy1950">bugzilla-webkit</who>
    <bug_when>2018-08-15 02:42:20 -0700</bug_when>
    <thetext>Hello.
When I try to create a new instance of FindController my application exixts with segmentation fault.

I am using Python bindings like this:

import gi

from gi.repository import GObject, Gtk, Gdk, WebKit2 as webkit

self.find_controller = webkit.FindController()


My litwebkitgtk version is 2.20.3.

Thank you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450299</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-08-15 08:37:45 -0700</bug_when>
    <thetext>Please post a backtrace</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450303</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-08-15 08:48:27 -0700</bug_when>
    <thetext>Well, actually since your example was so simple/good, I just got one myself:

(gdb) bt full
#0  0x00007fec0dfafe54 in WTF::DumbPtrTraits&lt;WebKit::WebPageProxy&gt;::unwrap(WebKit::WebPageProxy* const&amp;) (ptr=&lt;optimized out&gt;)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:1339
#1  0x00007fec0dfafe54 in WTF::RefPtr&lt;WebKit::WebPageProxy, WTF::DumbPtrTraits&lt;WebKit::WebPageProxy&gt; &gt;::get() const (this=&lt;optimized out&gt;)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/x86_64-redhat-linux-gnu/DerivedSources/ForwardingHeaders/wtf/RefPtr.h:72
#2  0x00007fec0dfafe54 in webkitWebViewBaseGetPage(_WebKitWebViewBase*) (webkitWebViewBase=0x0)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:1339
#3  0x00007fec0df93a59 in getPage (webView=&lt;optimized out&gt;)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:1983
#4  0x00007fec0df93a59 in webkitWebViewGetPage(_WebKitWebView*) (webView=&lt;optimized out&gt;)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:1983
#5  0x00007fec0df73d14 in getPage (findController=0x560f837a6820 [WebKitFindController])
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/glib/WebKitFindController.cpp:140
        findController = 0x560f837a6820 [WebKitFindController]
#6  0x00007fec0df73d14 in webkitFindControllerConstructed(GObject*) (object=&lt;optimized out&gt;)
    at /usr/src/debug/webkit2gtk3-2.20.4-1.fc28.x86_64/Source/WebKit/UIProcess/API/glib/WebKitFindController.cpp:140
        findController = 0x560f837a6820 [WebKitFindController]
#7  0x00007fec28c578fb in g_object_new_internal (class=class@entry=0x560f837e9260, params=params@entry=0x0, n_params=n_params@entry=0) at gobject.c:1839
        nqueue = 0x560f837c6ba0
        object = 0x560f837a6820 [WebKitFindController]
        __func__ = &quot;g_object_new_internal&quot;
#8  0x00007fec28c5916d in g_object_newv (object_type=94624630607200, n_parameters=n_parameters@entry=0, parameters=parameters@entry=0x0) at gobject.c:2036
        class = 0x560f837e9260
        unref_class = 0x0
        object = &lt;optimized out&gt;
        __func__ = &quot;g_object_newv&quot;
#9  0x00007fec290dd38c in pygobject_constructv (self=self@entry=0x7fec1ce60c60, n_parameters=0, parameters=0x0) at gobjectmodule.c:1000
        obj = &lt;optimized out&gt;
        __func__ = &quot;pygobject_constructv&quot;
#10 0x00007fec290e4ed9 in pygobject_init (self=self@entry=0x7fec1ce60c60, args=args@entry=&lt;unknown at remote 0x7fec3724b048&gt;, kwargs=kwargs@entry=0x0)
   ect-object.c:1305
        object_type = &lt;optimized out&gt;
        n_params = 0
        i = &lt;optimized out&gt;
        params = 0x0
        class = 0x560f837e9260
#11 0x00007fec36c9de42 in type_call (type=&lt;optimized out&gt;, args=&lt;unknown at remote 0x7fec3724b048&gt;, kwds=0x0) at /usr/src/debug/python3-3.6.6-1.fc28.x86_64/Objects/typeobject.c:915
        res = &lt;optimized out&gt;
        obj = &lt;unknown at remote 0x7fec1ce60c60&gt;
#12 0x00007fec36c2f81b in _PyObject_FastCallDict (func=&lt;unknown at remote 0x560f837e8e98&gt;, args=0x560f83534ae8, nargs=&lt;optimized out&gt;, kwargs=0x0)
    at /usr/src/debug/python3-3.6.6-1.fc28.x86_64/Objects/abstract.c:2331
        tuple = &lt;unknown at remote 0x7fec3724b048&gt;
        call = 0x7fec36c9ddd0 &lt;type_call&gt;
        result = 0x0
#13 0x00007fec36c9dd38 in _PyObject_FastCallKeywords (func=&lt;unknown at remote 0x560f837e8e98&gt;, stack=&lt;optimized out&gt;, nargs=0, kwnames=&lt;optimized out&gt;)
    at /usr/src/debug/python3-3.6.6-1.fc28.x86_64/Objects/abstract.c:2482
        kwdict = &lt;optimized out&gt;
        result = &lt;optimized out&gt;
        nkwargs = &lt;optimized out&gt;
#14 0x00007fec36cacd41 in call_function (pp_stack=0x7ffc4b6e8988, oparg=0, kwnames=0x0)
    at /usr/src/debug/python3-3.6.6-1.fc28.x86_64/Python/ceval.c:4854
        pfunc = 0x560f83534ae0
        func = &lt;unknown at remote 0x560f837e8e98&gt;
        x = &lt;optimized out&gt;
        w = &lt;optimized out&gt;
        nargs = 0
        stack = &lt;optimized out&gt;
Python Exception &lt;class &apos;gdb.error&apos;&gt; Dwarf Error: could not find partial DIE containing offset 0x316 [in module /usr/lib/debug/usr/bin/python3.6-3.6.6-1.fc28.x86_64.debug]:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450306</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-08-15 08:56:37 -0700</bug_when>
    <thetext>The problem is you didn&apos;t pass a WebKitWebView property. You&apos;re not really intended to create WebKitFindController yourself, but rather to get it from a WebKitWebView using webkit_web_view_get_find_controller().

Anyway, of course we should assert or emit a critical or something instead of crashing. My first instinct would be g_return_val_if_fail(), but there&apos;s no place where that would be possible. I guess we could add a g_assert() in webkitFindControllerConstructed, but that&apos;s not really a friendly way to signal API misuse. Not sure what we should do here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>