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 678085 - Cage tool freezes GIMP
Cage tool freezes GIMP
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal major
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
: 759685 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-06-14 10:15 UTC by igvalor
Modified: 2017-01-31 18:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GIMP 2.9.3 Crash - WINE Program Error Details window contents (18.98 KB, text/plain)
2015-12-16 20:01 UTC, scott092707
  Details
Desktop record (1.56 MB, video/ogg)
2015-12-26 08:54 UTC, Dmitrij
  Details
quick hack (6.92 KB, patch)
2015-12-30 11:29 UTC, Massimo
none Details | Review
alternative approach (26.41 KB, patch)
2016-01-28 18:40 UTC, Massimo
none Details | Review
updated patch (10.86 KB, patch)
2016-02-02 08:04 UTC, Massimo
none Details | Review
fix (1.81 KB, patch)
2016-02-07 13:51 UTC, Massimo
none Details | Review

Description igvalor 2012-06-14 10:15:16 UTC
I select a layer, select cage transform tool, create a cage selection (4 points enough). When I finish the selection by clicking on the first point, an indicator 'Cage Transform' appears and GIMP hangs.
Comment 1 Michael Muré 2012-06-14 11:08:17 UTC

*** This bug has been marked as a duplicate of bug 676468 ***
Comment 2 igvalor 2012-06-17 14:45:09 UTC
(In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of bug 676468 ***

The bug does not crash. It freezes.
Comment 3 Thomas Manni 2015-06-07 11:09:32 UTC
This bug still exists in the current master branch.
Comment 4 ultimatefighteraction 2015-08-07 10:28:10 UTC
Hello!

I have the same problem.

(In reply to igvalor from comment #0)
> I select a layer, select cage transform tool, create a cage selection (4
> points enough). When I finish the selection by clicking on the first point,
> an indicator 'Cage Transform' appears and GIMP hangs.

I didn't found any solution nowhere. 

Best regards.
Comment 5 Massimo 2015-08-07 10:42:00 UTC
It is a dead-lock introduced in GEGL in this commit:

https://git.gnome.org/browse/gegl/commit/?id=981b35046d662e9976910ee0acc31fa68b338ca4

commenting out the pair of g_mutex_lock and g_mutex_unlock
calls introduced there apparently fixes the hang.

Unfortunately that commit does not revert cleanly and I
don't know how GEGL is supposed to be used in a multi-threaded
application, so I don't know if the data race fixed in that
commit is theoretical or real.
Comment 6 scott092707 2015-12-16 19:51:24 UTC
I have GIMP 2.8.14 under Lubuntu 15.10, and also GIMP 2.9.3 installed in WINE.
I have never used the Cage Transform before, but I have a panorama that Hugin stitched nicely, but naturally (due to barrel distortion (?)) has a strange shape.  Some sides of the image I can just fill in a background color - others will need some work.  I was hoping to use the Cage Transform to stretch some areas where the stretching would not probably be noticed.

In both versions of GIMP, I imput the points (6-7), clicking on the first one to complete.  It shows the "Calculating Coefficients" busy circle, which conmpletes,
then after a short pause, it shows a busy circle for "Cage Transform" (which, since I had not moved any points yet, seemed odd - but as I say, I have not used CT yet...), which gets about 90% of the way around, and then freezes.

The Windows version (2.9.3) does not show the coefficients busy circle except as a brief flash-, and the Transform circle does not appear until it reaches the freeze point - at which time a window appears saying "Runtime Error! ... Program: ... abnormal program termination -" It then lets me click on OK to terminate the program, or press cancel to start the WINE debugger (which merely says that GIMP 2.9 "has encountered a serious problem and needs to close"))

I have done a DesktopRecord for both versions.

Whatever the problem is, it is:
1) not just in Windows
2) not fixed in the development version

-----------------------------------------------------------------
scott@scott-Asus-M2M68-AM-Plus:~$ uname -a
Linux scott-Asus-M2M68-AM-Plus 4.2.0-19-generic #23-Ubuntu SMP Wed Nov 11 11:38:40 UTC 2015 i686 athlon i686 GNU/Linux
scott@scott-Asus-M2M68-AM-Plus:~$ lsb_release -dsc
Ubuntu 15.10
wily
Comment 7 scott092707 2015-12-16 19:58:54 UTC
Well, since I see that the file size limit for attachments is 3.6MB (or so), I guess I will NOT be attaching the Desktop Record .ogv files (~12MB, ~16MB).
If someone wants to see them, I could email, I suppose...

I CAN attach the Program Error Details window contents, (from the Wine Debug Window), in case it is useful...
Comment 8 scott092707 2015-12-16 20:01:18 UTC
Created attachment 317531 [details]
GIMP 2.9.3  Crash -  WINE Program Error Details window contents
Comment 9 Dmitrij 2015-12-26 08:54:46 UTC
Created attachment 317888 [details]
Desktop record

Recorded a small video reproducing the bug
Comment 10 Massimo 2015-12-30 11:29:25 UTC
Created attachment 318028 [details] [review]
quick hack

Here it seems that what makes the cage tool different
is that the "gimp:cage-transform" has a (double) "progress"
property that it changes and notifies during its process execution.

These notifications probably trigger on the graph the signals
behind the invalidated_by_change sequence that in turn invalidates
the have_valid_rect causing the call to get_bounding_box to lock
again the (non-recursive) node->mutex while creating the cache
of the "gegl:map-absolute" operation.

A solution that seems to work is to change the "progress"
property from a gdouble to a GObject * pointer storing
directly the GimpProgress address and directly set its value,
text etc during "gimp:cage-transform" process execution.
Comment 11 Dmitrij 2015-12-31 17:42:56 UTC
@Massimo, thanks. It seems to be working now although green progress bar at the center is not needed in cases when the operation takes less than a second.
Comment 12 Massimo 2016-01-01 17:55:31 UTC
(In reply to Dmitrij from comment #11)
> @Massimo, thanks. It seems to be working now although green progress bar at
> the center is not needed in cases when the operation takes less than a
> second.

Yes I agree, I just tried to avoid a dead-lock and restored the previous behavior.

One could think to start showing the progress only if 2 secs are 
passed and the progress is not yet updated to the end, but that's
matter for another bug report
Comment 13 Michael Natterer 2016-01-10 15:38:09 UTC
*** Bug 759685 has been marked as a duplicate of this bug. ***
Comment 14 ultimatefighteraction 2016-01-10 21:06:29 UTC
Hello!

I'm back! Now I am on the 2.8 16 and I have the same problem! 

I select a layer, select cage transform tool, create a cage selection (4
> points enough). When I finish the selection by clicking on the first point,
> an indicator 'Cage Transform' appears and GIMP hangs.

Thanks for help.
Comment 15 scott092707 2016-01-10 23:42:56 UTC
@Dmitrij:
>It seems to be working now
Where?  Is the fix in a development version 
(such as windows binarys @ http://nightly.darkrefraction.com/gimp/dev  )?
I would like to try it...
Comment 16 Dmitrij 2016-01-11 08:49:33 UTC
The fix is for development version, not in it yet. It will be moved in the repository as soon as someone reviews Massimo's code. 
To use the patch before that you should compile GIMP yourself. Download the source code from https://github.com/GNOME/gimp/archive/master.zip , apply the patch and compile it. You will probably search the internet for instructions on how to apply a patch in your environment
Comment 17 Michael Natterer 2016-01-11 19:52:50 UTC
You probably shouldn't use github because it's only a mirror. GIMP is
hosted in GNOME git at https://git.gnome.org/browse/gimp
Comment 18 Massimo 2016-01-28 18:40:39 UTC
Created attachment 319964 [details] [review]
alternative approach

grep revealed that "gimp:shapeburst" is apparently the only other
operation with a "progress" property.

Apparently it not used anymore (I tried to see if it caused dead-locks),
but where it was used has been substituted by "gegl:distance-transform"
which does not have that property

It means that here:

https://git.gnome.org/browse/gimp/tree/app/core/gimpdrawable-blend.c#n608

the call to gimp_gegl_progress_connect is useless and can be safely
removed, while gimp_gegl_progress_connect can be modified in place to
adapt to changes of the only caller.

So another approach is to transform the "progress" property into
a signal that does not repeatedly invalidate the graph as if the user
changed a node property.

The attached patchset includes

one patch to remove "gimp:shapeburst" and the useless call to
gimp_gegl_progress_connect

a second patch to convert the property to a signal

a third patch to delay the exposure of the on canvas progress widget
so that it is not shown if the operation completes early.
Comment 19 Michael Natterer 2016-02-01 20:08:29 UTC
That looks totally reasonable, and is the better approach anyway,
please push.

(It even looks like something we could use for other cases where ops
take long and can't be split into chunks).
Comment 20 Massimo 2016-02-02 08:04:08 UTC
Created attachment 320250 [details] [review]
updated patch

Attaching a patch that converts the progress property
to a progress signal also for the resurrected gimp:shapeburst

only quickly tested
Comment 21 Michael Natterer 2016-02-02 10:36:46 UTC
Go ahead and push please.
Comment 22 Massimo 2016-02-02 11:26:59 UTC
pushed to master

commit b9ba90589a920db8a954387f5d16c9f658afd7eb
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date:   Tue Feb 2 12:21:15 2016 +0100

    Bug 678085 - Cage tool freezes GIMP
    
    Use a proper "progress" signal instead of a property "notify" one
    to update the on-canvas progress widget.
    
    This way the graph is not invalidated while processing it
Comment 23 Massimo 2016-02-07 13:51:29 UTC
Created attachment 320570 [details] [review]
fix

Testing this change on Win64 I just noticed that in the
previous commit I did not pass the right number and type
of parameters to g_signal_new.

If there are no objections I'll push the attached patch
to fix this mistake.
Comment 24 Michael Natterer 2016-02-07 16:05:33 UTC
Go ahead
Comment 25 Massimo 2016-02-07 18:00:46 UTC
hopefully fixed in master after:

commit b5546ac0ac4a30bfd31ccc75c22f722a1c38dee1
Author: Massimo Valentini <mvalentini@src.gnome.org>
Date:   Sun Feb 7 18:50:11 2016 +0100

    Bug 678085 - Cage tool freezes GIMP
    
    progress signal accepts 1 parameter not 0
    it worked in linux, but not in win64
Comment 26 ultimatefighteraction 2016-03-23 13:15:47 UTC
Hello!

(In reply to ultimatefighteraction from comment #4)
> Hello!
> 
> I have the same problem.
> 
> (In reply to igvalor from comment #0)
> > I select a layer, select cage transform tool, create a cage selection (4
> > points enough). When I finish the selection by clicking on the first point,
> > an indicator 'Cage Transform' appears and GIMP hangs.
> 
> I didn't found any solution nowhere. 
> 
> Best regards.

(In reply to ultimatefighteraction from comment #14)
> Hello!
> 
> I'm back! Now I am on the 2.8 16 and I have the same problem! 
> 
> I select a layer, select cage transform tool, create a cage selection (4
> > points enough). When I finish the selection by clicking on the first point,
> > an indicator 'Cage Transform' appears and GIMP hangs.
> 
> Thanks for help.

Why is no one responding? After all this time...

In my opinion, Gimp is as good as Photoshop but without the cage transform tool, I am changing my mind...

Please, why Gimp continues to hang on the 2.8 16? Any solution?
Comment 27 tobias 2016-03-23 15:36:18 UTC
> Please, why Gimp continues to hang on the 2.8 16? 

Because it has a bug.

> Any solution?

Wait for the next Gimp version or get the latest source code and compile it.
Comment 28 ultimatefighteraction 2016-03-23 17:13:13 UTC
So I am going to wait... Thank you tobias! :)
Comment 29 Massimo 2016-03-23 17:53:08 UTC
(In reply to ultimatefighteraction from comment #26)
...
> 
> Why is no one responding? After all this time...
> 
> In my opinion, Gimp is as good as Photoshop but without the cage transform
> tool, I am changing my mind...
> 
> Please, why Gimp continues to hang on the 2.8 16? Any solution?

I did not respond because I tried on my linux computer
and it works now and it worked when I read your comment.

I did not read what is your system.

On windows there is a known issue when GEGL saves the
cache in a file whose name or path contains non-ascii
characters, but in that case GIMP crashes. It is fixed
in git. The workaround for that bug was to set the environment
variable GEGL_SWAP=RAM.
Comment 30 ultimatefighteraction 2016-03-23 18:55:57 UTC
Windows 8 in 2015. Windows 10 in 2016.


Problem Screens :
http://image.noelshack.com/fichiers/2016/12/1458758856-capture.png
http://image.noelshack.com/fichiers/2016/12/1458758865-e.png

I know nothing about computers so I prefer to wait the new version. 

Thank you for your work! :)
Comment 31 Massimo 2016-03-23 19:08:55 UTC
(In reply to ultimatefighteraction from comment #30)
> Windows 8 in 2015. Windows 10 in 2016.
> 
> 
> Problem Screens :
> http://image.noelshack.com/fichiers/2016/12/1458758856-capture.png
> http://image.noelshack.com/fichiers/2016/12/1458758865-e.png
> 
> I know nothing about computers so I prefer to wait the new version. 
> 
> Thank you for your work! :)

In that case it could be the ascii problem, does your 
user name contain accented letters?

In that case you could try the solution outlined here:

https://bugzilla.gnome.org/show_bug.cgi?id=675591#c7

copying those lines in a .bat files and start GIMP double
clicking on its icon.

or if that is like chinese for you too there is also the 
last resort described in comment 10.
Comment 32 ultimatefighteraction 2016-03-23 21:30:31 UTC
Yes, there is a ë.

I copied this words in a .bat :
cd %USERPROFILE%
SET GEGL_SWAP=RAM
"%ProgramFiles%\GIMP 2\bin\gimp-2.8.exe"
http://image.noelshack.com/fichiers/2016/12/1458767828-capture.png

I execute as admin (not simple click because this application cannot run on your pc) and I open Gimp .... unfortunately Gimp continues to hang! :(

Please, on the new version this bug will be fix or I need to buy a new computer with a new user name (for different reasons, impossible to change this one)?

Sorry but the last ressort is more chinese than the .bat! lol
Comment 33 ultimatefighteraction 2016-03-24 15:29:25 UTC
Hi!

I created a new account without accented letters and ..... the cage transform tool works well!!! I am disappointed (and furious to be honest)because it was impossible for me to use this important tool because of a lack of interest for my, not one, but two posts! In 2015 and in 2016! For a stupid accented letter!

It's easy to write that the status is resolved fixed ignoring my two posts! lol

Of course, I don't want to have two accounts just because a tool doesnt' work in Gimp. Be serious....

So the bug continues for me, you proposed me a .bat solution, thanks but It doesn't work so could you propose another Serious ressort, please? Another code to copy in the .bat, I don't know....
Comment 34 Massimo 2016-03-24 17:00:54 UTC
(In reply to ultimatefighteraction from comment #33)
> Hi!
> 
> I created a new account without accented letters and ..... the cage
> transform tool works well!!! I am disappointed (and furious to be
> honest)because it was impossible for me to use this important tool because
> of a lack of interest for my, not one, but two posts! In 2015 and in 2016!
> For a stupid accented letter!
> 
> It's easy to write that the status is resolved fixed ignoring my two posts!
> lol
> 
> Of course, I don't want to have two accounts just because a tool doesnt'
> work in Gimp. Be serious....
> 
> So the bug continues for me, you proposed me a .bat solution, thanks but It
> doesn't work so could you propose another Serious ressort, please? Another
> code to copy in the .bat, I don't know....

Sorry the only other solution I can think of is to download an
unofficial Windows build, I'd suggest the nightly builds

http://nightly.darkrefraction.com/gimp/

but I see they're missing today, the other ones that I've heard
of are partha's 

http://www.partha.com/

and the portable GIMP of which I don't know the link. But beware
I'm a linux user, so you'd better look for advises on forums.
Comment 35 ultimatefighteraction 2016-03-24 18:02:39 UTC
Unofficial? Sorry but I am a serious person. Why not to suggest me to buy a new computer? It would be more simple! lol

I really don't understand why the accented letter bug is not fixed since 2015... OK so the solution proposed is to look for advises on forums? Waow! 

Thank you for your time. 

Best regards.
Comment 36 Michael Natterer 2016-03-24 18:21:07 UTC
I don't know what you expect here. We are all volunteers who do this
in our spare time. You were told where to download trusted builds of
GIMP that have the bug fixed. What's the problem?
Comment 37 ultimatefighteraction 2016-03-24 19:06:53 UTC
Yeah, you are volunteers and I respect that. But I created an account here, and I wrote two messages to share a bug. I spent time for that. Your time is not more important than mine.

You ask me to download an unofficial Windows build... OK but what is it? Will I loose my user prefrences? There will be no problem when I would like download the new Gimp version? Etc

Moreover there are two links, and Massimo says they're missing today and he doesn't know the link so I am sceptical.

I would like a simple answer, please. As if I am a child... An answer like this one :

The accented letter is not fixed on the official version, so you have two options :
-waiting to the new version
-doawnload this link (not maybe this one or maybe this one). With details instructions.

Could you understand that some terms are difficult to understand to ordinary people, please? 

What I expect here? Just a simple and clear solution. If it is not possible, not a problem, but say me the truth please...
Comment 38 Massimo 2016-03-24 19:09:01 UTC
(In reply to ultimatefighteraction from comment #35)
> Unofficial? Sorry but I am a serious person. Why not to suggest me to buy a
> new computer? It would be more simple! lol
> 
> I really don't understand why the accented letter bug is not fixed since
> 2015... OK so the solution proposed is to look for advises on forums? Waow! 
> 

As I said I use linux and I don't know what changed on Windows 10,
the batch file solution used to work, perhaps on Windows 10 there
is another method to set environment variables, I don't know and
I can't help with Windows 10 related problems, sorry.
Comment 39 ultimatefighteraction 2016-03-24 19:18:54 UTC
Not a problem Massimo, thank you for making an effort to try to help me. 

I'm going to be patient and see what happens about this bug in the new official version. 

Good evening! :)
Comment 40 Luc Pi 2016-11-07 10:30:22 UTC
(seen in gimp-2.8.18)
Comment 41 sokolov 2017-01-31 17:49:31 UTC
Which version is this supposed to be "resolved fixed" in?
Comment 42 Michael Schumacher 2017-01-31 18:05:26 UTC
Git master branch.

The brokenness in 2.8 on some Linux distros, like e.g. Debian and Ubuntu, is caused by a change the respective platform's maintainers did by themselves.