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 665885 - Allows defining circular categories --> crash
Allows defining circular categories --> crash
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: High critical
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
: 701087 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-12-09 19:13 UTC by Volker Sobek (weld)
Modified: 2015-09-29 15:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
selections: Prevent nested collections (2.40 KB, patch)
2015-08-25 19:42 UTC, Alessandro Bono
none Details | Review
mainToolbar: Listen to changes when a collection is active (1.33 KB, patch)
2015-08-26 10:48 UTC, Alessandro Bono
none Details | Review
selections: Prevent nested collections (2.40 KB, patch)
2015-08-26 10:49 UTC, Alessandro Bono
committed Details | Review
mainToolbar: Listen to changes when a collection is active (1.47 KB, patch)
2015-08-27 08:54 UTC, Alessandro Bono
none Details | Review
mainToolbar: Listen to changes when a collection is active (2.20 KB, patch)
2015-08-28 11:06 UTC, Alessandro Bono
none Details | Review
mainToolbar: Listen to changes when a collection is active (2.20 KB, patch)
2015-08-28 17:59 UTC, Alessandro Bono
committed Details | Review
mainToolbar: Fix typo in the variable name (904 bytes, patch)
2015-09-26 09:21 UTC, Alessandro Bono
committed Details | Review

Description Volker Sobek (weld) 2011-12-09 19:13:33 UTC
How to reproduce:
1. add category A to category B
2. add category B to category A

Result:
gnome-documents: line 15:  3411 Segmentation fault      (core dumped) /home/gnomedev/gnome-shell/install/bin/gjs-console -I /home/gnomedev/gnome-shell/install/share/gnome-documents/js -c "const Main = imports.main; Main.start();" "$@"

version: git commit 8f78779dad3ffffacf9b2e6ad8d5dea8eada53a0

After that, every time you start gnome-documents it will hang in a loop that ends in the same crash.
Comment 1 André Klapper 2011-12-10 10:17:43 UTC
Thanks for taking the time to report this bug.
Without a stack trace from the crash it's very hard to determine what caused it.
Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
Comment 2 Volker Sobek (weld) 2011-12-10 19:50:12 UTC
Program received signal SIGSEGV, Segmentation fault.
general_composite_rect (imp=0x758050, op=PIXMAN_OP_OVER, src=0x863b400, 
    mask=0x0, dest=0x8e3abc0, src_x=6, src_y=6, mask_x=12, mask_y=12, 
    dest_x=12, dest_y=12, width=46, height=46) at pixman-general.c:116
116	{
(gdb) bt
  • #0 general_composite_rect
    at pixman-general.c line 116
  • #1 pixman_image_composite32
    at pixman.c line 780
  • #2 _composite_boxes
    at cairo-image-surface.c line 3008
  • #3 _clip_and_composite_boxes
    at cairo-image-surface.c line 3047
  • #4 _cairo_image_surface_paint
    at cairo-image-surface.c line 3301
  • #5 _cairo_surface_paint
    at cairo-surface.c line 2022
  • #6 _cairo_surface_paint
    at cairo-surface.c line 1993
  • #7 _cairo_gstate_paint
  • #8 INT_cairo_paint
    at cairo.c line 2228
  • #9 gd_create_collection_icon
    at lib/gd-utils.c line 493
  • #10 ffi_call_unix64
    from /usr/lib64/libffi.so.5
  • #11 ffi_call
    from /usr/lib64/libffi.so.5
  • #12 gjs_invoke_c_function
    at gi/function.c line 648
  • #13 function_call
    at gi/function.c line 957
  • #14 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #15 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #16 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #17 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #18 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #19 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #20 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #21 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #22 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #23 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #24 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #25 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #26 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #27 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #28 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #29 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #30 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #31 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #32 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #33 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #34 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #35 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #36 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #37 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #38 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0

Comment 3 Volker Sobek (weld) 2011-12-10 19:59:14 UTC
It hangs in an infinite loop that makes it run out of memory.
Comment 4 Volker Sobek (weld) 2011-12-10 20:09:37 UTC
Here is the start (missing in the previous one as it was too long):

  • #4676 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4677 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4678 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4679 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4680 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4681 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4682 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4683 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4684 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4685 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4686 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4687 js_fun_apply(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4688 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4689 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4690 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4691 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4692 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4693 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4694 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4695 js::CallOrConstructBoundFunction(JSContext*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4696 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4697 js::ExternalInvoke(JSContext*, js::Value const&, js::Value const&, unsigned int, js::Value*, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4698 JS_CallFunctionValue
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4699 gjs_callback_closure
    at gi/function.c line 200
  • #4700 ffi_closure_unix64_inner
    from /usr/lib64/libffi.so.5
  • #4701 ffi_closure_unix64
    from /usr/lib64/libffi.so.5
  • #4702 g_simple_async_result_complete
    at gsimpleasyncresult.c line 744
  • #4703 complete_in_idle_cb_for_thread
    at gsimpleasyncresult.c line 812
  • #4704 g_main_dispatch
    at gmain.c line 2513
  • #4705 g_main_context_dispatch
    at gmain.c line 3050
  • #4706 g_main_context_iterate
    at gmain.c line 3121
  • #4707 g_main_context_iterate
    at gmain.c line 3058
  • #4708 g_main_context_iteration
    at gmain.c line 3182
  • #4709 g_application_run
    at gapplication.c line 1512
  • #4710 ffi_call_unix64
    from /usr/lib64/libffi.so.5
  • #4711 ffi_call
    from /usr/lib64/libffi.so.5
  • #4712 gjs_invoke_c_function
    at gi/function.c line 648
  • #4713 function_call
    at gi/function.c line 957
  • #4714 js::Invoke(JSContext*, js::CallArgs const&, unsigned int)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4715 js::Interpret(JSContext*, JSStackFrame*, unsigned int, JSInterpMode)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4716 js::RunScript(JSContext*, JSScript*, JSStackFrame*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4717 js::Execute(JSContext*, JSObject*, JSScript*, JSStackFrame*, unsigned int, js::Value*)
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4718 JS_EvaluateUCScriptForPrincipals
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4719 JS_EvaluateUCScript
    from /home/gnomedev/gnome-shell/install/lib64/libmozjs185.so.1.0
  • #4720 gjs_context_eval
    at gjs/context.c line 1030
  • #4721 main
    at gjs/console.c line 111

Comment 5 Jim Campbell 2012-02-20 13:53:24 UTC
If you experience this crash, gnome-documents mail repeatedly crash on later restarts of the application.

To allow the application to start, you'll need to refresh the tracker database and restart it.

In a terminal:  
- tracker-control -r

then
- tracker-control -s

It will take a few moments for your tracker database to repopulate.
Comment 6 Cosimo Cecchi 2012-03-05 22:34:09 UTC
I now fixed this in 0.3.91.
Comment 7 Volker Sobek (weld) 2012-09-11 22:32:37 UTC
Well, with current git master you can still add collection A to B, and B to A, and get the crash. It seems the only thing that was fixed is that you can't add A to A?
Comment 8 Debarshi Ray 2014-03-28 13:09:57 UTC
(In reply to comment #7)
> Well, with current git master you can still add collection A to B, and B to A,
> and get the crash.

If that is still the case, then we should not do that. If A is part of B, then B should not be allowed to be a part of A.
Comment 9 Debarshi Ray 2014-03-28 14:31:25 UTC
*** Bug 701087 has been marked as a duplicate of this bug. ***
Comment 10 Debarshi Ray 2015-03-04 00:25:46 UTC
In a recent discussion with the designers we agreed that we don't want nested collections. ie. collections inside collections. Doing that should address this bug.
Comment 11 Kunaal Jain 2015-03-12 06:05:52 UTC
In the current git master, the collections is broken. In recent if you select a document to add to collection, the dialog box doesn't show the collection list. Also if you add new collection, the checkbox doesn't work.
Comment 12 Debarshi Ray 2015-03-12 10:02:52 UTC
(In reply to Kunaal Jain from comment #11)
> In the current git master, the collections is broken. In recent if you
> select a document to add to collection, the dialog box doesn't show the
> collection list. Also if you add new collection, the checkbox doesn't work.

Yes, I have seen that happen. Most likely a fallout from bug 686461

The first thing to do here would be to disable the collections button if a collection has been selected. That won't require the dialog to work.
Comment 13 Alessandro Bono 2015-08-25 19:42:20 UTC
Created attachment 309980 [details] [review]
selections: Prevent nested collections

Disable the Collections button in the collections overview.
If we are inside a collection, show the Collections button,
but disable the delete entry for the active collection in
the collections dialog.
Comment 14 Cosimo Cecchi 2015-08-25 23:18:55 UTC
Review of attachment 309980 [details] [review]:

Looks generally good. I think here the only thing that might needs discussion is your patch makes it not possible to add collections to other collections in general; I'm not 100% sure that's what we want, as opposed to just not being able to add a collection to itself.

::: src/selections.js
@@ +905,3 @@
+        let windowMode = Application.modeController.getWindowMode();
+        let activeCollection = Application.documentManager.getActiveCollection();
+        if(windowMode == WindowMode.WindowMode.COLLECTIONS && !activeCollection)

Missing space before paren
Comment 15 Debarshi Ray 2015-08-26 07:23:42 UTC
(In reply to Cosimo Cecchi from comment #14)
> Review of attachment 309980 [details] [review] [review]:
> 
> Looks generally good. I think here the only thing that might needs
> discussion is your patch makes it not possible to add collections to other
> collections in general; I'm not 100% sure that's what we want, as opposed to
> just not being able to add a collection to itself.

In my past conversations with Allan and Jakub they always said that we don't nested collections.

CCed them.
Comment 16 Alessandro Bono 2015-08-26 10:48:56 UTC
Created attachment 310015 [details] [review]
mainToolbar: Listen to changes when a collection is active
Comment 17 Alessandro Bono 2015-08-26 10:49:16 UTC
Created attachment 310016 [details] [review]
selections: Prevent nested collections

Disable the Collections button in the collections overview.
If we are inside a collection, show the Collections button,
but disable the delete entry for the active collection in
the collections dialog.
Comment 18 Cosimo Cecchi 2015-08-26 23:14:09 UTC
Review of attachment 310015 [details] [review]:

::: src/mainToolbar.js
@@ +113,3 @@
         this._viewListButton = null;
         this._viewSettingsId = 0;
+        this._activeCollection = null;

Should initialize this._infoUpdatedId = 0 here.

@@ +251,3 @@
+        if (activeCollection)
+            this._infoUpdatedId = activeCollection.connect('info-updated', Lang.bind(this, this._setToolbarTitle));
+        else

Should check for this._infoUpdatedId != 0 here.
Comment 19 Cosimo Cecchi 2015-08-26 23:14:39 UTC
Review of attachment 310016 [details] [review]:

Looks good to me provided that we want to prevent nested collections completely.
Comment 20 Alessandro Bono 2015-08-27 08:54:09 UTC
Created attachment 310076 [details] [review]
mainToolbar: Listen to changes when a collection is active
Comment 21 Jakub Steiner 2015-08-27 10:20:12 UTC
Two thumbs up for avoiding nesting.
Comment 22 Debarshi Ray 2015-08-27 12:03:02 UTC
Comment on attachment 310016 [details] [review]
selections: Prevent nested collections

Pushed to master.
Comment 23 Debarshi Ray 2015-08-27 12:25:11 UTC
Review of attachment 310076 [details] [review]:

There is one issue. If we open a collection, then preview an item and come back before opening the collection dialog, then the toolbar is not updated on rename. The reason is that we destroy and recreate the toolbars on window-mode changes. So the new OverviewToolbar does't have the signal connection set up when we return from the preview.

::: src/mainToolbar.js
@@ +252,3 @@
+        if (activeCollection)
+            this._infoUpdatedId = activeCollection.connect('info-updated', Lang.bind(this, this._setToolbarTitle));
+        else

The existing style is to use the braces.

@@ +256,3 @@
+                this._activeCollection.disconnect(this._infoUpdatedId);
+                this._infoUpdatedId = 0;
+            }

I think we need to disconnect on 'destroy' because activeCollection can outlive the toolbar.
Comment 24 Alessandro Bono 2015-08-28 11:06:19 UTC
Created attachment 310177 [details] [review]
mainToolbar: Listen to changes when a collection is active
Comment 25 Cosimo Cecchi 2015-08-28 17:40:11 UTC
Review of attachment 310177 [details] [review]:

::: src/mainToolbar.js
@@ +139,3 @@
         this.connect('destroy', Lang.bind(this,
             function() {
+                if (this._infoUpdatedId == 0)

This should check for != 0
Comment 26 Alessandro Bono 2015-08-28 17:59:26 UTC
Created attachment 310215 [details] [review]
mainToolbar: Listen to changes when a collection is active
Comment 27 Debarshi Ray 2015-09-01 07:36:34 UTC
Review of attachment 310215 [details] [review]:

Looks good to me.
Comment 28 Alessandro Bono 2015-09-26 09:21:01 UTC
Created attachment 312182 [details] [review]
mainToolbar: Fix typo in the variable name

Fallout from cb2039117e6ea422a810885d0622131e02f93f8e
Comment 29 Debarshi Ray 2015-09-29 15:41:25 UTC
Review of attachment 312182 [details] [review]:

Thanks for catching this!