Sometimes my home built Geany crashes with a segfault when I use the window split function.
Build info:
Linux Fedora 10, updated, uname -a: Linux goedel.recco.de 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
Geany svnversion: 3603
I built and installed geany with
./autogen.sh; make rpm; sudo rpm -Uvh ...
Gcc Option -O2 is used for compiling.
I start Geany, open a file and use "Tools->Split Window->Vertically" (or Horizontally) and sometimes it crashes then. Below a stack trace of such an event ...
Wolfgang
[weo@goedel src]$ gdb geany GNU gdb Fedora (6.8-29.fc10) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu"... (gdb) run build.c Starting program: /home/weo/Devel/Geany/src/geany build.c [Thread debugging using libthread_db enabled] [New Thread 0x7ffff7fc8790 (LWP 7341)] Detaching after fork from child process 7351. Detaching after fork from child process 7352. [New Thread 0x7fffe9267950 (LWP 7403)]
Program received signal SIGSEGV, Segmentation fault. Document::AddRef (this=0xfffffffff172eac0) at Document.cxx:92 92 return refCount++; Current language: auto; currently c++ Missing separate debuginfos, use: debuginfo-install GConf2-2.24.0-1.fc10.x86_64 ORBit2-2.14.16-1.fc10.x86_64 atk-1.24.0-1.fc10.x86_64 bug-buddy-2.24.2-1.fc10.x86_64 cairo-1.8.0-1.fc10.x86_64 dbus-glib-0.76-3.fc10.x86_64 dbus-libs-1.2.4-2.fc10.x86_64 e2fsprogs-libs-1.41.4-1.fc10.x86_64 elfutils-libelf-0.140-1.fc10.x86_64 expat-2.0.1-5.x86_64 fontconfig-2.6.0-3.fc10.x86_64 freetype-2.3.7-2.fc10.x86_64 gamin-0.1.9-6.fc10.x86_64 gdbm-1.8.0-29.fc10.x86_64 glib2-2.18.4-1.fc10.x86_64 glibc-2.9-3.x86_64 gtk-nodoka-engine-0.7.2-1.fc10.x86_64 gtk2-2.14.7-1.fc10.x86_64 gvfs-1.0.3-5.fc10.x86_64 libICE-1.0.4-4.fc10.x86_64 libSM-1.1.0-2.fc10.x86_64 libX11-1.1.4-6.fc10.x86_64 libXau-1.0.4-1.fc10.x86_64 libXcomposite-0.4.0-5.fc10.x86_64 libXcursor-1.1.9-3.fc10.x86_64 libXdamage-1.1.1-4.fc9.x86_64 libXdmcp-1.0.2-6.fc10.x86_64 libXext-1.0.4-1.fc9.x86_64 libXfixes-4.0.3-4.fc10.x86_64 libXft-2.1.13-1.fc10.x86_64 libXi-1.1.3-4.fc9.x86_64 libXinerama-1.0.3-2.fc10.x86_64 libXrandr-1.2.3-1.fc10.x86_64 libXrender-0.9.4-3.fc9.x86_64 libasyncns-0.7-1.fc10.x86_64 libcanberra-0.10-3.fc10.x86_64 libcanberra-gtk2-0.10-3.fc10.x86_64 libcap-2.10-2.fc10.x86_64 libgcc-4.3.2-7.x86_64 libogg-1.1.3-9.fc9.x86_64 libpng-1.2.34-1.fc10.x86_64 libselinux-2.0.73-1.fc10.x86_64 libstdc++-4.3.2-7.x86_64 libtdb-1.1.1-26.fc10.x86_64 libtool-ltdl-1.5.26-4.fc10.x86_64 libvorbis-1.2.0-5.fc10.x86_64 libxcb-1.1.91-5.fc10.x86_64 ncurses-libs-5.6-20.20080927.fc10.x86_64 pango-1.22.3-1.fc10.x86_64 pixman-0.12.0-2.fc10.x86_64 pulseaudio-libs-0.9.14-1.fc10.x86_64 vte-0.17.4-1.fc10.x86_64 zlib-1.2.3-18.fc9.x86_64 (gdb) where #0 Document::AddRef (this=0xfffffffff172eac0) at Document.cxx:92 #1 0x00000000004acbfa in Editor::SetDocPointer (this=0x7fffeda69800, document=<value optimized out>) at Editor.cxx:5752 #2 0x00000000004b2feb in Editor::WndProc (this=0x7fffeda69800, iMessage=<value optimized out>, wParam=0, lParam=-244127040) at Editor.cxx:7487 #3 0x00000000004c133e in ScintillaBase::WndProc (this=0x7fffeda69800, iMessage=953402672, wParam=0, lParam=-244127040) at ScintillaBase.cxx:742 #4 0x00007ffff1507ca8 in sync_to_current () at splitwindow.c:167 #5 set_editor (editwin=0x7ffff1708c60, editor=0x7ffff17266b0) at splitwindow.c:196 #6 0x00007ffff1508266 in split_view (horizontal=0) at splitwindow.c:309 #7 0x0000003a9ce0b7dd in g_closure_invoke () from /lib64/libgobject-2.0.so.0 #8 0x0000003a9ce214bd in ?? () from /lib64/libgobject-2.0.so.0 #9 0x0000003a9ce22b68 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0 #10 0x0000003a9ce23093 in g_signal_emit () from /lib64/libgobject-2.0.so.0 #11 0x00000034ce4320cb in gtk_widget_activate () from /usr/lib64/libgtk-x11-2.0.so.0 #12 0x00000034ce336acd in gtk_menu_shell_activate_item () from /usr/lib64/libgtk-x11-2.0.so.0 #13 0x00000034ce338515 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0 #14 0x00000034ce329a08 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0 #15 0x0000003a9ce0b7dd in g_closure_invoke () from /lib64/libgobject-2.0.so.0 #16 0x0000003a9ce2119b in ?? () from /lib64/libgobject-2.0.so.0 #17 0x0000003a9ce229ea in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0 #18 0x0000003a9ce23093 in g_signal_emit () from /lib64/libgobject-2.0.so.0 #19 0x00000034ce42c7de in ?? () from /usr/lib64/libgtk-x11-2.0.so.0 #20 0x00000034ce322373 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0 #21 0x00000034ce323493 in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0 #22 0x00000034cde4deac in ?? () from /usr/lib64/libgdk-x11-2.0.so.0 #23 0x0000003a9ca3779b in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #24 0x0000003a9ca3af6d in ?? () from /lib64/libglib-2.0.so.0 #25 0x0000003a9ca3b49d in g_main_loop_run () from /lib64/libglib-2.0.so.0 #26 0x00000034ce3238a7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0 #27 0x0000000000469679 in main (argc=2, argv=0x7fffffffe318) at main.c:1077 (gdb)
On Thu, 2009-02-26 at 12:40 +0100, Wolfgang Ocker wrote:
Sometimes my home built Geany crashes with a segfault when I use the window split function.
Build info:
Linux Fedora 10, updated, uname -a: Linux goedel.recco.de 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
It might be a 32/64 bits problem. See splitwindow.c[167]:
scintilla_send_message(sci, SCI_SETDOCPOINTER, 0, GPOINTER_TO_INT(sdoc));
The usage of GPOINTER_TO_INT() looks strange to me. So I'll apply the patch below and test ...
Index: splitwindow.c =================================================================== --- splitwindow.c (revision 3603) +++ splitwindow.c (working copy) @@ -164,7 +164,7 @@
/* set the new sci widget to view the existing Scintilla document */ sdoc = (gpointer) scintilla_send_message(current, SCI_GETDOCPOINTER, 0, 0); - scintilla_send_message(sci, SCI_SETDOCPOINTER, 0, GPOINTER_TO_INT(sdoc)); + scintilla_send_message(sci, SCI_SETDOCPOINTER, 0, (glong) sdoc);
update_font(current, sci); lexer = scintilla_send_message(current, SCI_GETLEXER, 0, 0);
On Thu, 26 Feb 2009 14:12:22 +0100, Wolfgang wrote:
On Thu, 2009-02-26 at 12:40 +0100, Wolfgang Ocker wrote:
Sometimes my home built Geany crashes with a segfault when I use the window split function.
Build info:
Linux Fedora 10, updated, uname -a: Linux goedel.recco.de 2.6.27.15-170.2.24.fc10.x86_64 #1 SMP
Wed Feb 11 23:14:31 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
It might be a 32/64 bits problem. See splitwindow.c[167]:
scintilla_send_message(sci, SCI_SETDOCPOINTER, 0,
GPOINTER_TO_INT(sdoc));
The usage of GPOINTER_TO_INT() looks strange to me. So I'll apply the patch below and test ...
Thanks for reporting and for the patch (will be committed it later).
Just for your interest, I used the type "sptr_t" which is defined in Scintilla and typically used for the fourth argument of scintilla_send_message(). But it's simply a typedef for the long type, so it does the same as your patch.
Regards, Enrico