GNOME Bugzilla – Bug 678085
Cage tool freezes GIMP
Last modified: 2017-01-31 18:05:26 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.
*** This bug has been marked as a duplicate of bug 676468 ***
(In reply to comment #1) > > *** This bug has been marked as a duplicate of bug 676468 *** The bug does not crash. It freezes.
This bug still exists in the current master branch.
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.
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.
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
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...
Created attachment 317531 [details] GIMP 2.9.3 Crash - WINE Program Error Details window contents
Created attachment 317888 [details] Desktop record Recorded a small video reproducing the bug
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.
@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.
(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
*** Bug 759685 has been marked as a duplicate of this bug. ***
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.
@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...
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
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
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.
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).
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
Go ahead and push please.
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
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.
Go ahead
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
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?
> 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.
So I am going to wait... Thank you tobias! :)
(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.
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 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.
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
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....
(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.
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.
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?
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...
(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.
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! :)
(seen in gimp-2.8.18)
Which version is this supposed to be "resolved fixed" in?
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.