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 776698 - gnome-music may segfault on search active in selection mode
gnome-music may segfault on search active in selection mode
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.23.x
Other Linux
: Low minor
: ---
Assigned To: gnome-music-maint
gnome-music-maint
: 766403 785529 786459 786875 (view as bug list)
Depends on: 778875
Blocks: 778870
 
 
Reported: 2017-01-02 02:28 UTC by Mohammed Sadiq
Modified: 2017-08-28 06:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
detect model to choose song and favourite it (1.81 KB, patch)
2017-01-22 21:49 UTC, Alberto Fanjul
rejected Details | Review
searchview: Disable favourites (1.04 KB, patch)
2017-08-28 06:22 UTC, Marinus Schraal
none Details | Review

Description Mohammed Sadiq 2017-01-02 02:28:50 UTC
How to reproduce:

1. Go to Songs tab
2. Activate Selection mode (clicking the tick button or so)
3. Activate search and search for some song
4. From the listed matching songs press the star button twice (the favorite button) for the same song.

Result:
gnome-music segfaults (I get a Traceback, I don't know if this is what a segfault is, in python).

Terminal output:

(gnome-music:1445): Grilo-WARNING **: [tracker-source-request] /home/sadiq/jhbuild/checkout/grilo-plugins/src/tracker/grl-tracker-source-api.c:504: Could not execute sparql query id=9: parser stack overflow

(gnome-music:1445): Grilo-WARNING **: [tracker-source-request] /home/sadiq/jhbuild/checkout/grilo-plugins/src/tracker/grl-tracker-source-api.c:504: 	error in parsing query id=10 : Invalid normalization specified
Traceback (most recent call last):
  • File "/home/sadiq/jhbuild/install/lib/python3.5/site-packages/gnomemusic/widgets/starhandlerwidget.py", line 112 in _on_star_toggled
    _iter = self._parent.model.get_iter(path)
  • File "/home/sadiq/jhbuild/install/lib/python3.5/site-packages/gi/overrides/Gtk.py", line 826 in get_iter
    raise ValueError("invalid tree path '%s'" % path)
ValueError: invalid tree path '0:0'

Comment 1 Mohammed Sadiq 2017-01-02 02:29:59 UTC
This also happens in other tabs.
Comment 2 Mohammed Sadiq 2017-01-02 02:33:07 UTC
Hm.. This seems to happen even without the 2nd option (activate selection mode), and doesn't happen in stable branch.
Comment 3 Marinus Schraal 2017-01-09 12:56:19 UTC
This has probably to do with a problem in tracker not giving results for some of the queries resulting in an incomplete treeview. We should handle this more graceful, but it should be ok if tracker does it's job.
Comment 4 Bilal Elmoussaoui 2017-01-14 16:40:11 UTC
I would love to fix this, but when i activate the selection mode, the star button is not showing here(Gnome Music 3.22.2). Is that normal?
Comment 5 Marinus Schraal 2017-01-16 07:25:48 UTC
comment #4 : You really need the development tree to work on this. Also as said, this is mainly a tracker problem.
Comment 6 Marinus Schraal 2017-01-16 10:49:59 UTC
*** Bug 766403 has been marked as a duplicate of this bug. ***
Comment 7 kartik 2017-01-22 09:33:51 UTC
(In reply to Mohammed Sadiq from comment #2)
> Hm.. This seems to happen even without the 2nd option (activate selection
> mode), and doesn't happen in stable branch.

What OS are you using?
Comment 8 Mohammed Sadiq 2017-01-22 10:09:28 UTC
(In reply to kartik from comment #7)
> What OS are you using?

I'm on Debian GNU/Linux (testing). But I hope it doesn't matter. I tested gnome-music from git master (using jhbuild).
Comment 9 Alberto Fanjul 2017-01-22 11:59:26 UTC
Trying tracker search directly from command line:

    $ tracker sparql -q "SELECT DISTINCT rdf:type(?song) ?song AS ?tracker_urn tracker:id (?song) AS ?id ?url nie:title(?song) AS ?title nmm:artistName(nmm:performer(?song)) AS ?artist nie:title(nmm:musicAlbum(?song)) AS ?album nfo:duration(?song) AS ?duration ?tag AS ?favourite nie:usageCounter(?song) AS ?play_count { {  SELECT DISTINCT  ?song  WHERE {  ?song a
12:54:20 nmm:MusicPiece .  BIND(tracker:normalize(nie:title(nmm:musicAlbum(?song)), \'nfkd\') AS ?match1) .  BIND(tracker:normalize(nmm:artistName(nmm:performer(?song)), \'nfkd\') AS ?match2) .  BIND(tracker:normalize(nie:title(?song), \'nfkd\') AS ?match3) .  FILTER (  CONTAINS(tracker:case-fold(tracker:unaccent(?match1)), \"cop\") || 
12:54:20 CONTAINS(tracker:case-fold(?match1), \"cop\") ||  CONTAINS(tracker:case-fold(tracker:unaccent(?match2)), \"cop\") ||  CONTAINS(tracker:case-fold(?match2), \"cop\") ||  CONTAINS(tracker:case-fold(tracker:unaccent(?match3)), \"cop\") ||  CONTAINS(tracker:case-fold(?match3), \"cop\")  )  } } ?song a nmm:MusicPiece ; nmm:musicAlbumDisc ?disc ; nmm:musicAlbum
12:54:20 ?album ; nmm:performer ?performer ; nie:url ?url . OPTIONAL { ?song nao:hasTag ?tag . FILTER (?tag = nao:predefined-tag-favorite) } . FILTER(STRSTARTS(?url, \'file:///home/alberto/M%C3%BAsica/\')) } ORDER BY ?artist ?album nmm:setNumber(?disc) nmm:trackNumber(?song)"
    No se pudo ejecutar la consulta, 1.416: syntax error, unexpected character

I'm asking on #tracker channel since I try to debug tracker, but can understand what is happening on vala.

I think problem is in translating sql on tracker_sparql_pattern_translate_group_graph_pattern function (name for vala turning into c to use on gdb)
Comment 10 Alberto Fanjul 2017-01-22 21:49:07 UTC
Created attachment 344006 [details] [review]
detect model to choose song and favourite it

This issue was not related with tracker at all

search model is different from songs model.

I'm not satisfied with condition to detect model, but it works

I keep helper to inspect model (print_tree_store) as it helps to resolve the bug, but it can be removed.
Comment 11 Marinus Schraal 2017-02-02 16:58:26 UTC
Review of attachment 344006 [details] [review]:

I'm not convinced, I still think this is b/c the model doesn't get properly filled when the other queries return no results.

The path is 0:0 but really should be 2:0 (for the first item in the songs results - which is what you sort of do in this patch), that means that in the model the first 2 subpaths (0 & 1) aren't added.

It looks like a discrepancy between 2 models, but if that's the case why I'm not sure why there are 2 models at all.
Comment 12 kartik 2017-02-02 17:11:40 UTC
(In reply to Marinus Schraal from comment #11)
> Review of attachment 344006 [details] [review] [review]:
> 
> I'm not convinced, I still think this is b/c the model doesn't get properly
> filled when the other queries return no results.
> 
> The path is 0:0 but really should be 2:0 (for the first item in the songs
> results - which is what you sort of do in this patch), that means that in
> the model the first 2 subpaths (0 & 1) aren't added.

I had looked into the bug and came up with a very similar solution as alberto did. This seems to does the job, but something is amiss. 

> It looks like a discrepancy between 2 models, but if that's the case why I'm
> not sure why there are 2 models at all.

Exactly my thoughts!
Comment 13 Alberto Fanjul 2017-02-02 17:27:48 UTC
I checked out version 3.22.2 and on that version search show info on all items from parent model (albumns, artists, playlists) and not only on songs, so, yes I think Marinus is right, something wrong in other queries is corrupting the selection. I will check that again from that perspective
Comment 14 Marinus Schraal 2017-08-17 14:54:24 UTC
I'm pretty sure this got fixed with tracker 1.99.1/music 3.25.90, which started returning all search queries again . Please reopen if still an issue.

https://git.gnome.org/browse/gnome-music/commit/?id=6d636676f70c12ce1bf83f2536828ccb64824401

This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Comment 15 Marinus Schraal 2017-08-17 14:54:47 UTC
*** Bug 785529 has been marked as a duplicate of this bug. ***
Comment 16 Marinus Schraal 2017-08-18 12:40:26 UTC
*** Bug 786459 has been marked as a duplicate of this bug. ***
Comment 17 Marinus Schraal 2017-08-28 06:10:50 UTC
*** Bug 786875 has been marked as a duplicate of this bug. ***
Comment 18 Marinus Schraal 2017-08-28 06:22:59 UTC
Created attachment 358561 [details] [review]
searchview: Disable favourites

Disable favourites in search, it crashes with the tracker search results
not being returned correctly.

See https://bugzilla.gnome.org/show_bug.cgi?id=776698 for more info.
Comment 19 Marinus Schraal 2017-08-28 06:26:24 UTC
Pushed a minor workaround to the stable tree. Should fix this if we get to make another stable release.