Open ctrlaltca opened 5 months ago
I can't see how this can be a problem with the Enchant code per se, there's nothing going on here that isn't tested by the regular tests (in particular, creating an Aspell provider). I agree, it's a mystery how the type is set to 0; is it possible that the code is somehow mixing modules from different versions of Enchant? You don't have to worry about Vala, you can look at the generated C, which is fairly straightforward. In this case, setting type
is entirely under the control of auto-generated C, and it looks like it's correct.
I tried building KVIrc from source and running it. It detected my Enchant, and I have Aspell installed and configured for English. In the languages preferences, I can see all my Enchant dictionaries listed as expected. I don't really understand how to make spell-checking work, so maybe I'm not triggering the crash: when I press Ctrl+G
I get either a blank popup, a popup that says Spelling suggestions for 'foo'
, whether foo
is a word, or not a word, or Spell Checker/No Suggestions Available
.
I can now confirm I've managed to put breakpoints in the right place, and the Aspell back-end initialises fine (along with all the rest).
I am using Enchant 2.8.0, but there's no reason I can see why 2.7.3 should behave differently.
So, we had confirmation from the user that everything works fine in normal conditions. The spellchecker in KVIrc is implemented as an external module (.so/.dll) that can be loaded and unloaded from memory dynamically. The crash only happens after a load-unload-reload cycle, and is not reproducible all the times.
Honestly i'm not eager to debug why our memory management fails with GObjects, so by now we are adding a workaround forcing the spellchecker module to be never unloaded from memory. This should avoid the problematic condition.
Thank you for your help in trying to understand what was wrong here. Feel free to close the issue
Sounds like a failure in finalization then, either in KVIrc or in libenchant, though the manifestation is still weird.
I would suspect enchant_provider_get_type
and its callee enchant_provider_get_type_once
of failing to cope with this case of de- and re-initialization, specifically around the call to g_once_init_enter
: I would suspect in particular that the call is really only initializing enchant_provider_type_id__once
once, but that enchant_provider_type_id__once
is being set back to 0 in between calls. It's not very likely as all of this code is entirely auto-generated, but it is at least possible (I've run into codegen bugs in the Vala compiler before).
Hello, we are using libenchant to provide spellchecking support in KVIrc. We recently received info about a crash related to a failure in initializing libenchant while using the aspell provider. Our code is calling
new enchant::Broker();
to instantiate a new Broker and this leads to a crash with the following trace:I tried to have a look at the code, but i'm not fluent in Vala/glib and was not able to figure out why g_type_create_instance is created with type=0x0.