[webkit-gtk] [Patch/Workaround] for gtk webkit as used by SWT

Olaf Flebbe o.flebbe at science-computing.de
Wed Jun 29 08:07:46 PDT 2011


>> The proposed patch is to short-circuit Timer destruction for the case
>> currentThread() != construction time thread.

...

Hi,


One can trigger the bug with a modified GtkLauncher when exiting it from
a different thread (this essentialy happens in java SWT HTML widget).

For instance for libwebkitgtk 1.3.10 use this patch (optionally you will
have to enable assertions) in order to reproduce the problem I see.
Start GtkLauncher and wait 10sec to crash. Should crash even with webkit
nightly, since this code is unmodified since that release.

Running out of time for today, if time permits I will open an issue
tomorrow in bugzilla.

Cheers
  Olaf

--- Tools/GtkLauncher/main.c.orig       2011-06-29 16:55:17.000000000 +0200
+++ Tools/GtkLauncher/main.c    2011-06-29 16:55:31.000000000 +0200
@@ -248,6 +248,12 @@
 }
 #endif

+void* threadwrap(void *a)
+{
+       sleep( 10);
+       exit(0);
+}
+
 int main(int argc, char* argv[])
 {
     WebKitWebView *webView;
@@ -257,6 +263,15 @@
     if (!g_thread_supported())
         g_thread_init(NULL);

+       pthread_t tid;
+       pthread_attr_t attr;
+
+
+
+       pthread_attr_init(&attr);
+
+       pthread_create( &tid, &attr, &threadwrap, NULL);
+
 #ifndef GTK_API_VERSION_2
     disablePlugin("Shockwave Flash");
 #endif


PS:You get other crashes if you start gtk not in main-thread. (this time
it crashes in purgeScratchBufferTimer: initialized in mainthread
destrcuted in render thread, you get the point?). IMHO this issue really
has to be solved.
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: o_flebbe.vcf
Type: text/x-vcard
Size: 347 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20110629/f113dd7e/attachment.vcf>


More information about the webkit-gtk mailing list