[Geany-devel] Errors

Erik de Castro Lopo mle+tools at xxxxx
Thu Sep 23 02:19:20 UTC 2010


Erik de Castro Lopo wrote:

> Lex Trotman wrote:
> 
> > Good luck, I can add one bit, the segfault must have come as I closed
> > Geany since it didn't appear to crash at any time.
> 
> Yes, agreed.
> 
> I suspect that the on_idle_new_doc() function is being called
> while the program is exiting and thats causing both the warnings
> you are seeing and the segfault I'm seeing (I also see warnings
> like you're seeing).

Ok, this is really quite nasty. Here a backtrace capture with
--g-fatal-warnings on. The line numbers may be just a little
off because I added some debug printfs.


   GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in
   cast to `GtkNotebook'
   aborting...

   Program received signal SIGABRT, Aborted.
   0x00007ffff483a165 in *__GI_raise (sig=<value optimized out>)
       at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
   64      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
           in ../nptl/sysdeps/unix/sysv/linux/raise.c
   (gdb) bt
   #0  0x00007ffff483a165 in *__GI_raise (sig=<value optimized out>)
       at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
   #1  0x00007ffff483cf70 in *__GI_abort () at abort.c:92
   #2  0x00007ffff557a07a in g_logv () from /lib/libglib-2.0.so.0
   #3  0x00007ffff557a103 in g_log () from /lib/libglib-2.0.so.0
   #4  0x00007ffff5e48266 in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
   #5  0x000000000042f080 in document_new_file_if_non_open () at document.c:719
   #6  0x000000000042f0a9 in on_idle_new_doc (user_data=0x68f2) at document.c:627
   #7  0x00007ffff556f6f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
   #8  0x00007ffff5573568 in ?? () from /lib/libglib-2.0.so.0
   #9  0x00007ffff5573a75 in g_main_loop_run () from /lib/libglib-2.0.so.0
   #10 0x00007ffff7a2cef8 in gtk_clipboard_store () from /usr/lib/libgtk-x11-2.0.so.0
   #11 0x00007ffff7a2cfaf in ?? () from /usr/lib/libgtk-x11-2.0.so.0
   #12 0x00007ffff78f6793 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
   #13 0x0000000000472648 in main (argc=2, argv=0x7fffffffe398) at main.c:1129

First thing to note is that this is definitely happening when the
geany is being closed (ie clicking on the top right close window
button).

The trace above is all about this function

    GeanyDocument *document_new_file_if_non_open(void)
    {
	if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) == 0)
	    return document_new_file(NULL, NULL, NULL);

        return NULL;
    }

I added some debug printfs here and found that main_widgets.notebook
is not NULL, but is still not a valid GtkNoteBook, probably because
it has already received a destroy message.

I'm not sure of the best way to fix this.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the Devel mailing list