Re: [gedit-list] gtksourceview problem



Hi again,

A better backtrace:

Switching to Thread -1228847408 (LWP 4293)]
0xb7385119 in g_type_check_instance_is_a ()
from /usr/lib/libgobject-2.0.so.0
(gdb) bt
#0  0xb7385119 in g_type_check_instance_is_a ()
from /usr/lib/libgobject-2.0.so.0
#1  0xb7fa5405 in gtk_source_language_get_name (language=0x30207b20) at
gtksourcelanguage.c:439
#2  0xb47e8896 in gtc_snippets_provider_real_get_data (base=0x852cdc0,
completion=0x806f2b8, event_name=0xb47e9386 "user-request-event",
event_data=0x0)
    at gtc-snippets-provider.c:116
#3  0xb47e7bf8 in gtk_text_completion_provider_get_data (self=0x852cdc0,
completion=0x806f2b8, event_name=0xb47e9386 "user-request-event",
event_data=0x0)
    at gtk-text-completion-provider.c:11
#4  0xb47e66e7 in gtk_text_completion_popup_raise_event
(popup=0x84e9318, event_name=0xb47e9386 "user-request-event",
event_data=0x0)
    at gtk-text-completion-popup.c:796
#5  0xb47e7231 in view_key_press_event_cb (view=0x806f2b8,
event=0x855eda8, user_data=0x84e9318) at gtk-text-completion-popup.c:380
#6  0xb78ac6b0 in _gtk_marshal_BOOLEAN__BOXED ()
from /usr/lib/libgtk-x11-2.0.so.0
#7  0xb736a62b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#8  0xb737b103 in ?? () from /usr/lib/libgobject-2.0.so.0
#9  0x0853c260 in ?? ()
#10 0xbfa36f30 in ?? ()
#11 0x00000002 in ?? ()
#12 0xbfa3700c in ?? ()
#13 0xbfa36f1c in ?? ()
#14 0xbfa36ecc in ?? ()
#15 0x00000000 in ?? ()

The line is:

g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (language), NULL);

but i don't understand why... Are compatible gtksourceview 1 and
gtksourceview 2?

I paste my function, perhaps it help you:

static GList* gtc_snippets_provider_real_get_data
(GtkTextCompletionProvider* base, GtkTextView* completion, const gchar*
event_name, gpointer event_data)
{	
	GHashTable *snippets;
	GList *snippets_list;
	GtcSnippetsProvider *prov;
	gchar* lang_text = NULL;
	
	prov = GTC_SNIPPETS_PROVIDER(base);
	
	if (strcmp(event_name,USER_REQUEST_EVENT)==0)
	{
		g_list_free(prov->priv->active_list);
		prov->priv->active_list = NULL;
		prov->priv->temp_view = completion;
		
		if (GTK_IS_SOURCE_VIEW(completion))
		{
			//Es una lista y no un hashtable
			GtkSourceBuffer *buffer =
GTK_SOURCE_BUFFER(gtk_text_view_get_buffer(completion));
			g_assert(buffer!=NULL);
			GtkSourceLanguage* s_lang = gtk_source_buffer_get_language(buffer);
			
			if (s_lang != NULL){
				lang_text = gtk_source_language_get_name(s_lang);
			}
		}
		if (lang_text!=NULL)
		{
			snippets_list =
gtk_snippets_loader_get_snippets_by_language(prov->priv->loader,lang_text);
			if (snippets_list!=NULL)
			{
				g_list_foreach(snippets_list,gtcsp_list_for_each_add_snippet,prov);
			}
		}
		else
		{
			snippets = gtk_snippets_loader_get_snippets(prov->priv->loader);
			if (snippets!=NULL)
			{
				g_hash_table_foreach
(snippets,gtcsp_hash_for_each_add_snippet,prov);
			}
		}
		prov->priv->temp_view = NULL;
		return prov->priv->active_list;
	}
	
	return NULL;
}


S.O.S. !!!!!

Regards,
	Chuchi

El lun, 02-07-2007 a las 23:33 +0200, perriman escribi� Hi all!!
> 
> I have a problem:
> 
> I am installed gtksourceview 2 but I have gtksourceview 1 too. When i
> launch an applicationj that uses GtkSourceLanguage compiled and linked
> with gtksourceview-1.0 , it crash and i don't know why. Can you help me?
> I have two GtkSourceView and when I try to get the source name, it
> crash.
> 
> I will try download gtksourceviw 1 code and install it to provide you a
> better backtrace. This is my gdb session:
> 
> ################################3In a .c file:
> 
> 108                     if (GTK_IS_SOURCE_VIEW(completion))
> (gdb) n
> 111                             GtkSourceBuffer *buffer =
> GTK_SOURCE_BUFFER(gtk_text_view_get_buffer(completion));
> (gdb) n
> 112                             g_assert(buffer!=NULL);
> (gdb) n
> 113                             GtkSourceLanguage* s_lang =
> gtk_source_buffer_get_language(buffer);
> (gdb) n
> 115                             if (s_lang != NULL){
> (gdb) p s_lang
> $4 = (GtkSourceLanguage *) 0x84b5f90
> (gdb) n
> 116                                     lang_text =
> gtk_source_language_get_name(s_lang);
> (gdb) n
> 
> (openldev:20202): GtkSourceView-CRITICAL **:
> gtk_source_language_get_name: assertion `GTK_IS_SOURCE_LANGUAGE
> (language)' failed
> 119                     if (lang_text!=NULL)
> (gdb) n
> 129                             snippets =
> gtk_snippets_loader_get_snippets(prov->priv->loader);
> 
> ################################3In a .h file:
> 
> 108                     if (GTK_IS_SOURCE_VIEW(completion))
> (gdb) n
> 111                             GtkSourceBuffer *buffer =
> GTK_SOURCE_BUFFER(gtk_text_view_get_buffer(completion));
> (gdb) n
> 112                             g_assert(buffer!=NULL);
> (gdb) n
> 113                             GtkSourceLanguage* s_lang =
> gtk_source_buffer_get_language(buffer);
> (gdb) n
> 115                             if (s_lang != NULL){
> (gdb) n
> 116                                     lang_text =
> gtk_source_language_get_name(s_lang);
> (gdb) n
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xb73a6119 in g_type_check_instance_is_a ()
> from /usr/lib/libgobject-2.0.so.0
> 
> 
> 0xb73a6119 in g_type_check_instance_is_a ()
> from /usr/lib/libgobject-2.0.so.0
> (gdb) bt
> #0  0xb73a6119 in g_type_check_instance_is_a ()
> from /usr/lib/libgobject-2.0.so.0
> #1  0xb7fc6325 in gtk_source_language_get_name ()
> from /usr/lib/libgtksourceview-1.0.so.0
> #2  0xb4809896 in gtc_snippets_provider_real_get_data (base=0x852c6c0,
> completion=0x806f2b8, event_name=0xb480a386 "user-request-event",
> event_data=0x0)
>     at gtc-snippets-provider.c:116
> #3  0xb4808bf8 in gtk_text_completion_provider_get_data (self=0x852c6c0,
> completion=0x806f2b8, event_name=0xb480a386 "user-request-event",
> event_data=0x0)
>     at gtk-text-completion-provider.c:11
> #4  0xb48076e7 in gtk_text_completion_popup_raise_event
> (popup=0x8527718, event_name=0xb480a386 "user-request-event",
> event_data=0x0)
>     at gtk-text-completion-popup.c:796
> #5  0xb4808231 in view_key_press_event_cb (view=0x806f2b8,
> event=0x855eae8, user_data=0x8527718) at gtk-text-completion-popup.c:380
> #6  0xb78cd6b0 in _gtk_marshal_BOOLEAN__BOXED ()
> from /usr/lib/libgtk-x11-2.0.so.0
> #7  0xb738b62b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
> #8  0xb739c103 in ?? () from /usr/lib/libgobject-2.0.so.0
> #9  0x0852f100 in ?? ()
> #10 0xbfec03a0 in ?? ()
> #11 0x00000002 in ?? ()
> #12 0xbfec047c in ?? ()
> #13 0xbfec038c in ?? ()
> #14 0xbfec033c in ?? ()
> #15 0x00000000 in ?? ()
> 
> 
> Regards,
> 	Chuchi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]