After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 425850 - anjuta crashes on import project from existing sources
anjuta crashes on import project from existing sources
Status: VERIFIED FIXED
Product: anjuta
Classification: Applications
Component: libanjuta
SVN TRUNK
Other All
: Normal critical
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-03 12:49 UTC by Halton Huo
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for bug #425850 (2.91 KB, patch)
2007-04-03 14:33 UTC, Halton Huo
none Details | Review
new patch for bug #425850 (17.27 KB, patch)
2007-04-04 13:41 UTC, Halton Huo
none Details | Review
patch for 425850: rename glue to anjuta_glue (64.58 KB, patch)
2007-04-04 17:22 UTC, Halton Huo
committed Details | Review
patch for bug 425850: rework with 'svn rm/add' instead of 'svn mv' (63.08 KB, patch)
2007-04-05 10:47 UTC, Halton Huo
none Details | Review

Description Halton Huo 2007-04-03 12:49:06 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"
Comment 1 Halton Huo 2007-04-03 13:01:04 UTC
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.
Comment 2 Halton Huo 2007-04-03 14:31:20 UTC
create a bug #425874 for gnome-build, to make the changes in gnome-build. 
Comment 3 Halton Huo 2007-04-03 14:33:03 UTC
Created attachment 85764 [details] [review]
patch for bug #425850
Comment 4 Halton Huo 2007-04-04 13:41:54 UTC
Created attachment 85798 [details] [review]
new patch for bug #425850
Comment 5 Naba Kumar 2007-04-04 14:28:02 UTC
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.
Comment 6 Halton Huo 2007-04-04 17:22:10 UTC
Created attachment 85814 [details] [review]
patch for 425850: rename glue to anjuta_glue
Comment 7 Halton Huo 2007-04-04 17:32:14 UTC
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.
Comment 8 Halton Huo 2007-04-05 10:16:05 UTC
Nana, I saw you change the patch status to 'reviewed', does that mean the patch is okay? If not, is there anything need change?
Comment 9 Halton Huo 2007-04-05 10:47:03 UTC
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,
Comment 10 Johannes Schmid 2007-04-05 11:03:13 UTC
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.
Comment 11 Naba Kumar 2007-04-05 12:22:20 UTC
(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 ...
Comment 12 Naba Kumar 2007-04-05 12:23:50 UTC
(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.
Comment 13 Naba Kumar 2007-04-05 12:27:18 UTC
Thanks for the patch, Halton. It's been committed in svn trunk.
Comment 14 Naba Kumar 2007-04-05 12:27:54 UTC
Removed block on bug #425874
Comment 15 Naba Kumar 2007-06-27 10:58:20 UTC
Closing all old bugs. Apologies for the spam.