GNOME Bugzilla – Bug 425850
anjuta crashes on import project from existing sources
Last modified: 2009-08-15 18:40:50 UTC
Please describe the problem: anjuta crashes on import project from existing sources Steps to reproduce: 1. start anjuta 2. New->Project from existing sources 3. Enter project name and give valid source path Actual results: anjuta crashes and give following error: (anjuta:16878): GLib-GObject-WARNING **: cannot register existing type `GlueFactory' (anjuta:16878): GLib-GObject-CRITICAL **: file gobject.c: line 792: assertion `G_TYPE_IS_OBJECT (object_type)' failed Expected results: Does this happen every time? yes Other information: trace segment is attached [1] glue_factory_add_path(factory = (nil), path = 0xc955b2f8 "/usr/lib/gnome-build-1.0/backends"), line 98 in "glue-factory.c" [2] gbf_backend_init(), line 293 in "gbf-backend.c" [3] on_import_next(page = 0x8451800, druid = 0x83e8708, pi = 0x8446ac8), line 64 in "project-import.c"
it crashes on glue_factory_add_path in gbf-backend.c, which belong to gnome-build module. The variable glue_factory is invalid. it is because glue_factory_get_type does not return a valid type, which the warning "(anjuta:16878): GLib-GObject-WARNING **: cannot register existing type `GlueFactory'" means. Compared gnome-build and anjuta codes, found there are duplicated codes in these two module. gnome-build/src/gbf/glue-factory.[c|h] anjuta/libanjuta/glue-factory.[c|h] gnome-build/src/gbf/glue-plugin.[c|h] anjuta/libanjuta/glue-plugin.[c|h] They are almost same, need remove one, better remove them from anjuta.
create a bug #425874 for gnome-build, to make the changes in gnome-build.
Created attachment 85764 [details] [review] patch for bug #425850
Created attachment 85798 [details] [review] new patch for bug #425850
Depending libanjuta on gnome-build isn't right. I think the best thing to do would be just rename glue* to anjuta_glue* in libanjuta to avoid namespace conflicts. It's not a huge amount of code so duplicacy is not really a concern.
Created attachment 85814 [details] [review] patch for 425850: rename glue to anjuta_glue
I made a new patch base on your suggestion, it will rename all glue things into anjuta_glue, including: - file name: s/glue-/anjuta-glue/g - function name: s/glue_/anjuta_glue_/g - macro name: s/GLUE/ANJUTA_GLUE/g - type name: s/Glue/AnjutaGlue/g - variables: There are tons of changes in this patch. I still think two copies glue things is not very good. Could you give deep explanation why "Depending libanjuta on gnome-build isn't right"? Anyway, each patch is fine with me, if you like the rename one, we can close the dependency bug 425874.
Nana, I saw you change the patch status to 'reviewed', does that mean the patch is okay? If not, is there anything need change?
Created attachment 85842 [details] [review] patch for bug 425850: rework with 'svn rm/add' instead of 'svn mv' Rework this patch, using 'svn rm/add' instead of 'svn mv' for rename files to let the patch looks more clear. Naba, sorry wrong spell you name in last comment,
Using svn mv is the correct way, using rm/add will lose the history which we don't want! The deep explanation: gnome-build is only used for project management by a plugin but it is possible to use anjuta completely without it. And it would not be good if libanjuta would be directly linked against gnome-build because any plugin would have to link against it then. About the glue code: It is used to load "plugins", e.g shared libraries which both gnome-build and anjuta do. Normally one would just outsource this to a glue-library but it's overkill in that case and it is also possible that the code changes in anjuta and differs to the code in gnome-build one day for some reason.
(In reply to comment #9) > Created an attachment (id=85842) [edit] > patch for bug 425850: rework with 'svn rm/add' instead of 'svn mv' > > Rework this patch, using 'svn rm/add' instead of 'svn mv' for rename files to > let the patch looks more clear. > > Naba, sorry wrong spell you name in last comment, > I already took care of that myself and in the process of committing it ...
(In reply to comment #7) > > I still think two copies glue things is not very good. Could you give deep > explanation why "Depending libanjuta on gnome-build isn't right"? > > Anyway, each patch is fine with me, if you like the rename one, we can close > the dependency bug 425874. > The patch is big, but is better. Name spacing our stuffs is always good.
Thanks for the patch, Halton. It's been committed in svn trunk.
Removed block on bug #425874
Closing all old bugs. Apologies for the spam.