[webkit-gtk] Problem porting webkitgtk app from webkitgtk 1.6.1 to 2.0.4

Barry.Scott@onelan.com barry.scott at onelan.com
Fri Oct 11 02:40:17 PDT 2013


(I first raise this issue on the webkit help list as was advised to raise here).

I'm porting a webkitgtk app from F16 to F19.
F16 uses webkitgtk-1.6.1-90.fc16.x86_64
F19 uses webkitgtk-2.0.4-1.fc19.x86_64

What I am seeing is a SEGV in webkit.

#0  WebCore::WidgetBackingStore::cairoSurface (this=0x0) at 
Source/WebCore/platform/gtk/GtkWidgetBackingStoreX11.cpp:90
#1  0x00007ffff6143081 in webkit_web_view_expose_event 
(widget=widget at entry=0x6cc050, event=0x7fffffffcee0) at 
Source/WebKit/gtk/webkit/webkitwebview.cpp:670
#2  0x00007ffff57d26ec in _gtk_marshal_BOOLEAN__BOXED (closure=0x6a64a0, 
return_value=0x7fffffffcb00, n_param_values=<optimized out>, 
param_values=0x7fffffffcbb0, 
    invocation_hint=<optimized out>, marshal_data=<optimized out>) at 
gtkmarshalers.c:86
#3  0x00007ffff3132a28 in g_closure_invoke (closure=closure at entry=0x6a64a0, 
return_value=return_value at entry=0x7fffffffcb00, n_param_values=2, 
    param_values=param_values at entry=0x7fffffffcbb0, 
invocation_hint=invocation_hint at entry=0x7fffffffcb50) at gclosure.c:777
#4  0x00007ffff31437fb in signal_emit_unlocked_R (node=node at entry=0x6a64d0, 
detail=detail at entry=0, instance=instance at entry=0x6cc050, 
    emission_return=emission_return at entry=0x7fffffffcc80, 
instance_and_params=instance_and_params at entry=0x7fffffffcbb0) at 
gsignal.c:3622
#5  0x00007ffff314b462 in g_signal_emit_valist (instance=<optimized out>, 
signal_id=<optimized out>, detail=<optimized out>, 
var_args=var_args at entry=0x7fffffffcd48)
    at gsignal.c:3338
#6  0x00007ffff314ba72 in g_signal_emit (instance=instance at entry=0x6cc050, 
signal_id=<optimized out>, detail=detail at entry=0) at gsignal.c:3384
#7  0x00007ffff58fa474 in gtk_widget_event_internal 
(widget=widget at entry=0x6cc050, event=event at entry=0x7fffffffcee0) at 
gtkwidget.c:5017
#8  0x00007ffff58fa891 in IA__gtk_widget_send_expose 
(widget=widget at entry=0x6cc050, event=event at entry=0x7fffffffcee0) at 
gtkwidget.c:4846
#9  0x00007ffff57d0fc0 in IA__gtk_main_do_event (event=0x7fffffffcee0) at 
gtkmain.c:1610
#10 0x00007ffff49bb7ff in _gdk_window_process_updates_recurse 
(window=window at entry=0x69f480, expose_region=expose_region at entry=0x6fcb90) at 
gdkwindow.c:5427
#11 0x00007ffff49bb7a5 in _gdk_window_process_updates_recurse 
(window=window at entry=0x69f360, expose_region=expose_region at entry=0x6fcb60) at 
gdkwindow.c:5400
#12 0x00007ffff49f14b5 in _gdk_windowing_window_process_updates_recurse 
(window=window at entry=0x69f360, region=region at entry=0x6fcb60) at gdkwindow-
x11.c:5643
#13 0x00007ffff49b81da in gdk_window_process_updates_internal 
(window=0x69f360) at gdkwindow.c:5594
#14 0x00007ffff49b8b18 in IA__gdk_window_process_all_updates () at 
gdkwindow.c:5702
#15 0x00007ffff574d061 in gtk_container_idle_sizer (data=<optimized out>) at 
gtkcontainer.c:1360
#16 0x00007ffff4997207 in gdk_threads_dispatch (data=0x6d3c00) at gdk.c:512
#17 0x00007ffff2e3ee06 in g_main_dispatch (context=0x671d00) at gmain.c:3054
#18 g_main_context_dispatch (context=context at entry=0x671d00) at gmain.c:3630
#19 0x00007ffff2e3f158 in g_main_context_iterate (context=0x671d00, 
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at 
gmain.c:3701
#20 0x00007ffff2e3f55a in g_main_loop_run (loop=0x672790) at gmain.c:3895
#21 0x000000000041dc61 in ONELAN::AsyncIoSchedulerGlib::scheduleUntilQuit 
(this=0x7fffffffd290) at ../../Common/async_scheduler_glib.cpp:55
#22 0x0000000000426029 in main (argc=10, argv=0x7fffffffe478) at 
player_html_main.cpp:102

The code at frame 1 is:

668         for (int i = 0; i < rectCount; i++) {
669             copyRectFromCairoSurfaceToContext(WEBKIT_WEB_VIEW(widget)-
>priv->backingStore->cairoSurface(),
670                                               cr.get(), IntSize(), 
IntRect(rects.get()[i]));

And the SEGV is because the backingStore is 0.
Examining the webitgtk code I can see that backingStore is only filled in on a 
resize.
But in my app the expose happens before any resize.

Appearty the SWT browser had to implement a workaround.

Grant Grey wrote:
FWIW the SWT Browser works around this by setting a size on the browser and > then reverting it, to force the native resize callbacks to run, see
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT%20WebKit/gtk/org/eclipse/swt/browser/WebKit.java#n665  

Barry



More information about the webkit-gtk mailing list