spiel icon indicating copy to clipboard operation
spiel copied to clipboard

assertion failed: (object == G_OBJECT (sRegistry)) when no session bus

Open ghost opened this issue 1 year ago • 9 comments

Compile and install libspiel and libspeechprovider on Fedora Linux 39.

Create a simple C program, which compiles but fails to execute.

...
#include <spiel/spiel.h>
#include <spiel/spiel-speaker.h>

gint main(gint argc, gchar **argv) {
  GError *error = NULL;
  SpielSpeaker *speaker;
  GListModel * providers;
  speaker = spiel_speaker_new_sync(NULL, &error);

  if (error)
    g_error("Error: %s\n", error->message);

  return EXIT_SUCCESS;
}
ERROR:../libspiel/spiel-registry.c:436:spiel_registry_finalize: assertion failed: (object == G_OBJECT (sRegistry))
Bail out! ERROR:../libspiel/spiel-registry.c:436:spiel_registry_finalize: assertion failed: (object == G_OBJECT (sRegistry))
Aborted

I don't know if I am failing in the implementation because I can't find a C program to use as a reference. I would appreciate the help.

ghost avatar Apr 25 '24 20:04 ghost

That is very strange. I don't know why the registry would be destroyed at that stage. FYI, there is a command line C program in utils/spiel.c for your reference, along with a few C tests. Any luck with those?

eeejay avatar Apr 25 '24 22:04 eeejay

I tried your program locally and it worked alright.

eeejay avatar Apr 25 '24 22:04 eeejay

Worked okay for me too, although I guess it's possible a compiler might be doing something funky (I used gcc-14.0.1).

My wild guess it that the G_OBJECT () cast might be failing, since it's already chained up and that causes the assertion failure. If that's true, maybe the cast failure isn't printed before the program aborts?

andyholmes avatar Apr 25 '24 22:04 andyholmes

@eeejay @andyholmes My oversight: I was working inside a container, which does not have access to X11 and dbus.

I tested using 'toolbox' and it works.

Sorry for the inconvenience.

otrocodigo avatar Apr 25 '24 22:04 otrocodigo

@eeejay I guess in that case, it's probably that if the registry fails initialization, when the "temporary" object is finalized it has not been assigned to sRegistry?

andyholmes avatar Apr 25 '24 22:04 andyholmes

I think we should keep this open because the error message is useless and it should be better than that.

eeejay avatar Apr 25 '24 23:04 eeejay

@eeejay Is there a channel to ask questions about the project? For example, I would like if you can indicate a folder with the onnx models for 'piper'.

otrocodigo avatar Apr 26 '24 00:04 otrocodigo

gnome:#a11y on matrix works for now

eeejay avatar Apr 26 '24 00:04 eeejay

gnome:#a11y on matrix works for now

Thank you. I already joined.

otrocodigo avatar Apr 26 '24 00:04 otrocodigo