#48 webhelper segfault

closed-fixed
webhelper (4)
5
2011-03-10
2011-02-22
Anonymous
No

When i`m trying to enable webhelper i`ve got "Aborted" message:
Strace info:
gettimeofday({1298270074, 154371}, NULL) = 0
mmap2(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0xb51ff000
mprotect(0xb51ff000, 4096, PROT_NONE) = 0
clone(child_stack=0xb5bff424, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb5bffbd8, {entry_number:6, base_addr:0xb5bffb70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb5bffbd8) = 2818
futex(0xb5c2a714, FUTEX_WAKE_PRIVATE, 1) = 1
time(NULL) = 1298270074
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2679, ...}) = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(2803, 2803, SIGABRT) = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT +++

My system info:
geany 0.20 (built on Feb 13 2011 with GTK 2.18.9, GLib 2.22.5, GIO)
Linux aspire 2.6.32-71.14.1.el6.i686 #1 SMP Wed Jan 12 11:22:20 CST 2011 i686 i686 i386 GNU/Linux

Discussion

  • Wired... Could you run Geany in a debugger and post the backtrace please?

     
    • labels: --> webhelper
    • assigned_to: nobody --> colombanw
     

  • Anonymous
    2011-02-22

    I cannot because of:
    [Thread debugging using libthread_db enabled]
    Cannot find new threads: generic error

     
  • Can I provide needed information by other way?

     
  • Sorry for the delay,

    It seems that some versions of GDB (read: I had the same problem but not anymore) have problems with applications using libpthread... I found on the web [1] a proposed workaround that consist on adding libpthread as a LD_PRELOAD library, does this work for you? e.g.:

    LD_PRELOAD=/lib/libpthread.so.0 gdb geany

    Anyway, can you try the attached patch? It's only a guess on the possible problem, so a backtrace will still be helpful, but if it was the fix...

    [1] http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error

     

  • Anonymous
    2011-03-05

    Debug returned me:

    Program received signal SIGABRT, Aborted.
    0x00130416 in __kernel_vsyscall ()

    I cannot apply patch because of rejects:

    --- gwh-plugin.c
    +++ gwh-plugin.c
    @@ -416,6 +416,11 @@
    * (g_quark_from_static_string() for example) so it's not safe to remove it */
    plugin_module_make_resident (geany_plugin);

    + /* webkit uses threads */
    + if (! g_thread_supported ()) {
    + g_thread_init (NULL);
    + }
    +
    load_config ();
    gwh_keybindings_init ();

    I`ve tried 0.20 and trunk version

     
  • Can you post a backtrace from the debugger right after the abortion? Use GDB's "bt" command.

    Wired for the patch, it applies perfectly well for me on trunk... have you properly patched using -p1 from the repository root?
    ~/build/geany-plugins$ patch -p1 < 0001-Webhelper-initialize-threads.patch

     
  • Backtrace:
    #0 0x00130416 in __kernel_vsyscall ()
    #1 0x00bd8d11 in raise () from /lib/libc.so.6
    #2 0x00bda5ea in abort () from /lib/libc.so.6
    #3 0x009d3286 in g_logv () from /lib/libglib-2.0.so.0
    #4 0x009d32b7 in g_log () from /lib/libglib-2.0.so.0
    #5 0x009f1e33 in ?? () from /lib/libglib-2.0.so.0
    #6 0x01441c43 in soup_message_queue_new () from /usr/lib/libsoup-2.4.so.1
    #7 0x01449606 in ?? () from /usr/lib/libsoup-2.4.so.1
    #8 0x00974800 in g_type_create_instance () from /lib/libgobject-2.0.so.0
    #9 0x00958f29 in ?? () from /lib/libgobject-2.0.so.0
    #10 0x0095a13c in g_object_newv () from /lib/libgobject-2.0.so.0
    #11 0x0095adb3 in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #12 0x0095af2e in g_object_new () from /lib/libgobject-2.0.so.0
    #13 0x014498d8 in soup_session_async_new () from /usr/lib/libsoup-2.4.so.1
    #14 0x01db184f in ?? () from /usr/lib/libwebkit-1.0.so.2
    #15 0x01de8d3d in webkit_get_default_session () from /usr/lib/libwebkit-1.0.so.2
    #16 0x01dd559a in ?? () from /usr/lib/libwebkit-1.0.so.2
    #17 0x01deb9ae in ?? () from /usr/lib/libwebkit-1.0.so.2
    #18 0x009745f5 in g_type_class_ref () from /lib/libgobject-2.0.so.0
    #19 0x0095a978 in g_object_newv () from /lib/libgobject-2.0.so.0
    #20 0x0095adb3 in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #21 0x0095af2e in g_object_new () from /lib/libgobject-2.0.so.0
    #22 0x01deb7d4 in webkit_web_view_new () from /usr/lib/libwebkit-1.0.so.2
    #23 0x015a8009 in gwh_browser_init (self=0x83dc648) at gwh-browser.c:771
    #24 0x00974855 in g_type_create_instance () from /lib/libgobject-2.0.so.0
    #25 0x00958f29 in ?? () from /lib/libgobject-2.0.so.0
    #26 0x0095a682 in g_object_newv () from /lib/libgobject-2.0.so.0
    #27 0x0095adb3 in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #28 0x0095af2e in g_object_new () from /lib/libgobject-2.0.so.0
    #29 0x015a7527 in gwh_browser_new () at gwh-browser.c:857
    #30 0x015aa254 in plugin_init (data=0x81eebc0) at gwh-plugin.c:293
    #31 0x080c1fb1 in plugin_init (fname=<value optimized out>, init_plugin=1, add_to_list=1) at plugins.c:580
    #32 plugin_new (fname=<value optimized out>, init_plugin=1, add_to_list=1) at plugins.c:727
    #33 0x080c33ac in pm_plugin_toggled (cell=0x83ae2c0, pth=0x8492958 "20", data=0x0) at plugins.c:1148
    #34 0x00960b18 in g_cclosure_marshal_VOID__STRING () from /lib/libgobject-2.0.so.0
    #35 0x0095366b in g_closure_invoke () from /lib/libgobject-2.0.so.0
    #36 0x00969160 in ?? () from /lib/libgobject-2.0.so.0
    #37 0x0096a3c5 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
    #38 0x0096a847 in g_signal_emit () from /lib/libgobject-2.0.so.0
    ---Type <return> to continue, or q <return> to quit---
    #39 0x001da1e7 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #40 0x001cfdbe in gtk_cell_renderer_activate () from /usr/lib/libgtk-x11-2.0.so.0
    #41 0x003c8168 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #42 0x003c84f2 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #43 0x003c5115 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #44 0x0029d438 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #45 0x00951caa in ?? () from /lib/libgobject-2.0.so.0
    #46 0x0095366b in g_closure_invoke () from /lib/libgobject-2.0.so.0
    #47 0x00968d4e in ?? () from /lib/libgobject-2.0.so.0
    #48 0x0096a250 in g_signal_emit_valist () from /lib/libgobject-2.0.so.0
    #49 0x0096a847 in g_signal_emit () from /lib/libgobject-2.0.so.0
    #50 0x003d77ae in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #51 0x00294510 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
    #52 0x00295a12 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
    #53 0x00633ffb in ?? () from /usr/lib/libgdk-x11-2.0.so.0
    #54 0x009c8c78 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
    #55 0x009cc5e0 in ?? () from /lib/libglib-2.0.so.0
    #56 0x009cc9ff in g_main_loop_run () from /lib/libglib-2.0.so.0
    #57 0x00296039 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
    #58 0x080bdcf9 in main (argc=1, argv=0xbffff404) at main.c:1138

     
  • Patch doesn`t help :(

     
  • Really weird, looks like webkit_web_view() leads to an abortion...
    Well, do you use the latest SVN revision? The line numbers seem strange (at gwh-browser:771 it's not gwh_browser_init(), and it neither calls webkit_web_view_new()), though sometimes it's the compiler's optimizations that does this kind of thinks.

    I attach a small test program that uses WebKit, could you test it? If it crashes too, the bug must be somewhere else... what OS/version do you use?

     
  • Small WebKit test program

     
    Attachments
  • My system info:
    geany 0.20 (built on Feb 13 2011 with GTK 2.18.9, GLib 2.22.5, GIO)
    Linux aspire 2.6.32-71.14.1.el6.i686 #1 SMP Wed Jan 12 11:22:20 CST 2011 i686 i686 i386 GNU/Linux
    My distribution is Scientfic Linux 6 (RHEL 6)

    In webkittest I`ve got same error (aborted) backtrace:
    #0 0x00130416 in __kernel_vsyscall ()
    #1 0x01c31d11 in raise () from /lib/libc.so.6
    #2 0x01c335ea in abort () from /lib/libc.so.6
    #3 0x01b5f286 in g_logv () from /lib/libglib-2.0.so.0
    #4 0x01b5f2b7 in g_log () from /lib/libglib-2.0.so.0
    #5 0x01b7de33 in ?? () from /lib/libglib-2.0.so.0
    #6 0x0173fc43 in soup_message_queue_new () from /usr/lib/libsoup-2.4.so.1
    #7 0x01747606 in ?? () from /usr/lib/libsoup-2.4.so.1
    #8 0x01b00800 in g_type_create_instance () from /lib/libgobject-2.0.so.0
    #9 0x01ae4f29 in ?? () from /lib/libgobject-2.0.so.0
    #10 0x01ae613c in g_object_newv () from /lib/libgobject-2.0.so.0
    #11 0x01ae6db3 in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #12 0x01ae6f2e in g_object_new () from /lib/libgobject-2.0.so.0
    #13 0x017478d8 in soup_session_async_new () from /usr/lib/libsoup-2.4.so.1
    #14 0x0094e84f in ?? () from /usr/lib/libwebkit-1.0.so.2
    #15 0x00985d3d in webkit_get_default_session () from /usr/lib/libwebkit-1.0.so.2
    #16 0x0097259a in ?? () from /usr/lib/libwebkit-1.0.so.2
    #17 0x009889ae in ?? () from /usr/lib/libwebkit-1.0.so.2
    #18 0x01b005f5 in g_type_class_ref () from /lib/libgobject-2.0.so.0
    #19 0x01ae6978 in g_object_newv () from /lib/libgobject-2.0.so.0
    #20 0x01ae6db3 in g_object_new_valist () from /lib/libgobject-2.0.so.0
    #21 0x01ae6f2e in g_object_new () from /lib/libgobject-2.0.so.0
    #22 0x009887d4 in webkit_web_view_new () from /usr/lib/libwebkit-1.0.so.2
    #23 0x08048ada in main ()

     
  • Small WebKit test program, with thread initialization

     
    Attachments
  • Looks like a threading problem, but what?… could you try the second attached test program? (notice the additional package gthread-2.0 build with)

     
  • It works! (it opens an empty window ;) ).

     
  • But plugins configured and compiled with enabled environment flags:
    WEBHELPER_CFLAGS="gtk+-2.0 gthread-2.0 webkit-1.0"
    GEANY_CFLAGS="gtk+-2.0 gthread-2.0 webkit-1.0"
    Produces same error

     
  • Even with the 0001-Webhelper-initialize-threads.patch patch applied? This patch should do exactly the same thing that I did in webkittest2, so it *should* work, but maybe there's something else involved...

     
  • Ok, i did, everything from scratch (download, patch, compile,install) and seems to be everything fine now. Thank you for help - i think that`s was a reason that webhelper wasn`t enabled on rpmforge el6 packages.

     
  • Great! I'll then apply the patch on the SVN repository, thank you for the report and followup!

     
    • status: open --> closed-fixed