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 784907 - Number of threads > 2 creates vertical stripes on the image
Number of threads > 2 creates vertical stripes on the image
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: GeglBuffer
git master
Other Linux
: Normal major
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
: 759874 774863 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-07-13 13:41 UTC by alilakri
Modified: 2017-07-23 18:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description alilakri 2017-07-13 13:41:01 UTC
Menu: Colors/Exposure tool
As in title. ;-/ :)
Comment 1 Michael Natterer 2017-07-15 19:23:22 UTC
Does it go away if you set "Number of threads" to 1 in prefs?
Comment 2 alilakri 2017-07-16 08:49:18 UTC
Yes, the manipulation of threads removes this problem. It also helps the selection options: "gamma hack". The problem appears when you set the number of threads greater than 2 :-)
Comment 3 Michael Natterer 2017-07-16 12:19:11 UTC
Yes indeed.
Comment 4 Michael Natterer 2017-07-16 12:19:57 UTC
Actually, all point ops seem affected.
Comment 5 Øyvind Kolås (pippin) 2017-07-16 12:22:30 UTC
What does "gamma hack do" to the behavior of this?

This must be an old - or recently introduced, concurrent access bug in GeglBuffer, where due to racy updates to tiles some results are lost. That bug should be fixed - but improving how the slicing for the different threads is done might also eliminate many such tile acccess concurrency problems.
Comment 6 Michael Natterer 2017-07-16 12:32:56 UTC
Haven't tried "gamma hack" but I guess adding more ops to the graph
doesn't make it better.
Comment 7 Michael Natterer 2017-07-16 14:11:22 UTC
Now after rebuilding with some totally irrelevant cleanup i can't
reproduce this any longer, and i tried hard...
Comment 8 Ell 2017-07-23 18:05:49 UTC
This issue was caused by a number of unrelated reasons.  It *should* be fixed in master now, by

commit 5f4414f0261778644ba96db98cb9d0ea09ff6a6a
Author: Ell <ell_se@yahoo.com>
Date:   Fri Jul 21 08:20:56 2017 -0400

    tile-backend-swap: make thread safe; move more work to writer thread
    
    Make the swap tile backend thread safe, by adding locks as necessary,
    and by moving more of the work to the writer thread, to avoid having
    to synchronize.
    
    In particular, all reader threads share the same file destrcriptor,
    so they must not try to read from the swap in parallel.  Likewise,
    all manipulation of the gap list has to be synchronized, and was
    moved to the writer thread.  This has the additional benefit that
    storage reclamation for dead entries now happens in the writer thread,
    before any outstanding write operations are performed, while, in turn,
    storage allocation also happens in the writer thread, right before an
    entry is written to the swap; this helps minimize the gaps between swap
    entries.
    
    Additionally, TILE_GET commands for tiles that are queued for writing
    now return a COWed copy of the queued data, instead of a new copy.
    
    This fixes ceratin artifacts in multithreaded programs.  See
    bug #784907.

 gegl/buffer/gegl-tile-backend-swap.c | 589 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------
 1 file changed, 324 insertions(+), 265 deletions(-)

and

commit 64c691c852b4baeb85fd2b6881df3c0e9226e8ab
Author: Ell <ell_se@yahoo.com>
Date:   Fri Jul 21 08:59:55 2017 -0400

    tile-handler-cache: don't trim still-in-use tiles
    
    When trimming the cache, don't remove tiles whose reference count is
    greater than one, and are therefore still in use.  Otherwise, if the
    same tile is requested again, a different tile object might be
    returned, resulting in two different tile objects referring to the
    same tile.  If both tile objects are used to modify the tile data,
    then the changes of only one of them are going to be comitted.
    
    Note that, as a result, we never free hot tiles, since their reference
    count is always greater than or equal to two.  This commit effectively
    reverts commit 8c60f31f18ec3e91f56b4ababefef75573118478, since it's
    no longer necessary.
    
    While this problem is not multithreading-specific, it's most likely
    to occur in multithreaded programs.  See bug #784907.

 gegl/buffer/gegl-tile-handler-cache.c | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------
 1 file changed, 78 insertions(+), 48 deletions(-)

I'm closing this bug for now, because I can't reproduce it anymore.  It's entirely possible that there are other issues with similar symptoms lurking around.  Feel free to reopen if needed.
Comment 9 Øyvind Kolås (pippin) 2017-07-23 18:47:19 UTC
*** Bug 774863 has been marked as a duplicate of this bug. ***
Comment 10 Øyvind Kolås (pippin) 2017-07-23 18:58:21 UTC
*** Bug 759874 has been marked as a duplicate of this bug. ***