GNOME Bugzilla – Bug 776698
gnome-music may segfault on search active in selection mode
Last modified: 2017-08-28 06:26:24 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):
+ Trace 237029
_iter = self._parent.model.get_iter(path)
raise ValueError("invalid tree path '%s'" % path)
This also happens in other tabs.
Hm.. This seems to happen even without the 2nd option (activate selection mode), and doesn't happen in stable branch.
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.
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 #4 : You really need the development tree to work on this. Also as said, this is mainly a tracker problem.
*** Bug 766403 has been marked as a duplicate of this bug. ***
(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?
(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).
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)
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.
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.
(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!
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
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.
*** Bug 785529 has been marked as a duplicate of this bug. ***
*** Bug 786459 has been marked as a duplicate of this bug. ***
*** Bug 786875 has been marked as a duplicate of this bug. ***
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.
Pushed a minor workaround to the stable tree. Should fix this if we get to make another stable release.