Share

Synfig Animation Studio

Tracker: Bugs

5 Not handled exception when remove all gradient Cpoints - ID: 2096641
Last Update: Comment added ( genete )

Using SVN 2039

Open the gradient editor dialog. Right click over each any existing
triangle slider and select "Delete". The gradient becomes transparent. Now
click on the area where the triangle sliders were. It crashed with this
message:

glibmm-ERROR **:
unhandled exception (type std::exception) in signal handler:
what: synfig::Gradient::find(): Unable to find UniqueID in gradient


Genete ( genete ) - 2008-09-06 08:57

5

Closed

Accepted

Genete

Crasher/nasty bug

SVN version

Public


Comments ( 8 )




Date: 2008-09-14 21:17
Sender: geneteProject AdminAccepting Donations

Applied the patch from dooglus in svn 2056.


Date: 2008-09-14 16:37
Sender: dooglusProject AdminAccepting Donations

How about this 3rd patch? Just return early if the gradient is empty.
File Added: bug_2096641_patch3.txt


Date: 2008-09-14 13:17
Sender: dooglusProject AdminAccepting Donations

It should be an error for find() to be called with a cpoint that doesn't
exist. I don't think it's a good idea to remove the exception raising
behaviour in that case.

A better fix for this bug would be to stop find() being called when there
are no cpoints in the gradient.

Note also that there are two functions which both raise exceptions when
the cpoint can't be found. If we're going to change the behaviour of one,
shouldn't we also change the other too?

synfig::Gradient::iterator synfig::Gradient::find(const UniqueID &id)
synfig::Gradient::const_iterator synfig::Gradient::find(const UniqueID
&id)const



Date: 2008-09-13 11:32
Sender: geneteProject AdminAccepting Donations

I've set another solution for this:

Modify the synfig-core/src/synfig/gradient.cpp file instead and catch the
exception returning a valid iterator begin()

See attached patch file.
File Added: bug_2096641_patch2.txt


Date: 2008-09-13 10:24
Sender: pabs3

Looks like a bug in the synfig::Gradient::proximity function, I think it
shouldn't use iter-- at the end of the function.


Date: 2008-09-13 09:54
Sender: geneteProject AdminAccepting Donations

But in which situation someone would like to delete all the Cpoints?...
I know what you mean. You prefer that I caught the exception with a "try"
command in the gradient.cpp file, right?


Date: 2008-09-13 09:39
Sender: pabs3

Hmm, I don't think this is the right place to fix this. Either the erase
function should fail to remove the last cpoint or synfigstudio should not
crash when no cpoints are in the gradient. Personally I think removing all
cpoints is a valid thing to do so the crash should be avoided instead.


Date: 2008-09-13 09:31
Sender: geneteProject AdminAccepting Donations

This patch can solve the bug. See attached file.


Log in to comment.




Attached Files ( 3 )

Filename Description Download
bug_2096641_patch.txt Patch file Download
bug_2096641_patch2.txt Patch file Download
bug_2096641_patch3.txt Patch file Download

Changes ( 12 )

Field Old Value Date By
close_date - 2008-09-14 21:17 genete
status_id Open 2008-09-14 21:17 genete
File Added 293359: bug_2096641_patch3.txt 2008-09-14 16:37 dooglus
resolution_id Works For Me 2008-09-14 13:18 dooglus
File Added 293229: bug_2096641_patch2.txt 2008-09-13 11:32 genete
close_date 2008-09-13 09:33 2008-09-13 09:54 genete
status_id Pending 2008-09-13 09:54 genete
close_date - 2008-09-13 09:33 genete
assigned_to nobody 2008-09-13 09:33 genete
resolution_id None 2008-09-13 09:33 genete
status_id Open 2008-09-13 09:33 genete
File Added 293216: bug_2096641_patch.txt 2008-09-13 09:32 genete