Re: Weird problems with Enchant and GTK

From: Dominic Lachowicz <domlachowicz_at_gmail.com>
Date: Mon Aug 04 2008 - 03:15:23 CEST

The Zemberek provider uses dbus to talk to the Zemberek daemon. It
probably doesn't unregister itself. It's also too permissive about
what dictionaries it supports.

If you have a little time, could you look into it? Code is here:

http://www.abisource.com/viewvc/enchant/trunk/src/zemberek/zemberek_provider.cpp?view=markup

zemberek_provider_request_dict should probably be modified to only
return a dictionary if it can connect to the Zemberek dbus daemon and
the language tag starts with "tr".

http://www.abisource.com/viewvc/enchant/trunk/src/zemberek/zemberek.cpp?view=markup

This has a "g_type_init" that it probably doesn't need.

On Sun, Aug 3, 2008 at 1:47 PM, Enrico Tröger <enrico.troeger@uvena.de> wrote:
> Hey all,
>
>
> I just stumbled on a weird problem:
>
> see the attached test case which simply creates a broker object,
> requests a dictionary object and frees BOTH again.
> When running this code once, there is no problem. But I got weird DBus
> warnings and similar code in my app actually causes a segfault when
> the sample code is ran twice (therefore the for loop around it).
>
> I know that Enchant isn't linked to GTK and this is what makes it weird.
>
> Details:
> Compile the sample code this way:
>
> gcc -o "test" -Wall "enchant_test.c" `pkg-config --cflags --libs
> enchant`
>
> And run the binary
> ./enchant_test 1
> ./enchant_test 3
>
> And this should work. But now, compile the code this way (notice the
> added gtk+-2.0 package):
>
> gcc -o "test" -Wall "enchant_test.c" `pkg-config --cflags --libs
> enchant gtk+-2.0`
>
> And running
> ./enchant_test 1
> is still fine but once you keep the loop running more than once, there
> will happen strange things:
>
> enrico@endor ;-): /misc$ ./enchant_test 2
> finished
>
> (process:18884): GLib-GObject-WARNING **: cannot register existing type
> `DBusGProxy'
>
> (process:18884): GLib-GObject-CRITICAL **: g_type_set_qdata: assertion
> `node != NULL' failed
>
> (process:18884): GLib-GObject-CRITICAL **:
> g_boxed_type_register_static: assertion `g_type_from_name (name) == 0'
> failed
>
> (process:18884): GLib-GObject-CRITICAL **: g_type_set_qdata: assertion
> `node != NULL' failed
>
> (process:18884): GLib-GObject-WARNING **: cannot register existing type
> `DBusGProxy'
>
> (process:18884): GLib-GObject-CRITICAL **: g_object_new: assertion
> `G_TYPE_IS_OBJECT (object_type)' failed finished
>
>
> Again, this only happens when the application is linked against GTK.
> And it seems it only happens when the "zemberek" provider is used.
> This is another thing which seems strange to me:
> when I choose a non-sense dictionary name like "nonsense123" I would
> expect enchant gives me an error saying that the dictionary doesn't
> exist. Instead, it returns a valid dictionary object from the
> "zemberek" provider. It seems this provider is used for tr-dictionaries?
>
> When I choose another dictionary like "de" or "en" which both are
> provided by aspell (on my system), the above example code works fine,
> even when called multiple times.
>
> So, am I doing something wrong or might there be a problem in the
> "zemberek" provider code?
>
>
> Regards,
> Enrico
>
> --
> Get my GPG key from http://www.uvena.de/pub.key
>

-- 
Counting bodies like sheep to the rhythm of the war drums.
Received on Mon Aug 4 03:15:59 2008

This archive was generated by hypermail 2.1.8 : Mon Aug 04 2008 - 03:15:59 CEST