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 755069 - Playlist sometimes misses out files when 'Include only the selected files' is not selected
Playlist sometimes misses out files when 'Include only the selected files' is...
Status: RESOLVED FIXED
Product: easytag
Classification: Other
Component: general
2.4.x
Other Linux
: Normal normal
: 2.2
Assigned To: EasyTAG maintainer(s)
EasyTAG maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-15 14:52 UTC by James Cowgill
Modified: 2015-11-29 18:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
synchronize the file list pointer (1.08 KB, patch)
2015-11-13 19:20 UTC, David King
committed Details | Review

Description James Cowgill 2015-09-15 14:52:11 UTC
Debian bug: https://bugs.debian.org/798719

See the above bug. If you generate a playlist with 'Include only the selected files' is not selected then some files don't appear in the final playlist.

I bisected the bug to this commit:
commit 46109b22591173b722a190a69151e855cea52227
Author: David King <amigadave@amigadave.com>
Date:   Wed Mar 25 18:44:02 2015 +0100

    Simplify core file list management
    
    The ETFileList pointer in ET_Core always points to the first item, so
    avoid calling g_list_first() on it unnecessarily.

This probably means that some (other) code is messing up ETCore->ETFileList and this commit happened to workaround it.
Comment 1 mariano 2015-09-23 14:05:33 UTC
This only started happening with update to version 2.4 

Generating playlists is unreliable, however it is not random. Removing and regenerating playlist will produce same results.
Comment 2 David King 2015-10-30 15:04:06 UTC
I have been investigating this on and off, and the bug is caused by the sorting code in EasyTAG confusing two linked lists. While the comments make it clear that the ETFileList pointer in ET_Core will always point to the head of the list, and the ETFileDisplayedList pointer is permitted to point to any node of the list, both lists are just pointers into the same list. The means that sorting the ETFileDisplayedList leads to the head of the ETFileList changing as well (if the sort results in that happening, of course).

There either needs to be some synchronisation of the two lists, or the ETFileDisplayedList should be a completely separate list. A revert might be the easy way out, but the underlying confusion is probably the cause of a few more bugs (memory leaks, at the very least), so I would rather fix this properly.
Comment 3 David King 2015-11-13 19:20:45 UTC
Created attachment 315430 [details] [review]
synchronize the file list pointer

This patch seems to work for me. It is a bit difficult to tell whether this has caught all the cases where the list pointers can get out of sync, so it needs a bit more testing.
Comment 4 David King 2015-11-29 18:37:06 UTC
Review of attachment 315430 [details] [review]:

I pushed this to master as commit 9adaa19236a14206c05c24b957c765833a79d834.