[Posterize] "CRITICAL" console messages when toggling 'Contrasted' live preview

Bug #638943 reported by su_v
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
John Smith

Bug Description

Inkscape 0.48+devel r9762 on Mac OS X 10.5.8

Toggling 'Live preview' of the experimental 'Posterize' filter effect with the setting
 Type: Contrasted
produces these console messages:

** (inkscape-bin:45804): CRITICAL **: gboolean sp_document_add_resource(SPDocument*, const gchar*, SPObject*): assertion `!g_slist_find(rlist, object)' failed

** (inkscape-bin:45804): CRITICAL **: gboolean sp_document_add_resource(SPDocument*, const gchar*, SPObject*): assertion `!g_slist_find(rlist, object)' failed

The effect preview seems to be rendered correctly nevertheless.
Reporting this issue because the console messages are "CRITICAL".

su_v (suv-lp)
Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
Revision history for this message
jazzynico (jazzynico) wrote :

Thanks ~suv!

This filter is currenty in progress, and there are lots of things to improve in the code and UI...

Changed in inkscape:
importance: Undecided → Low
milestone: none → 0.49
status: New → In Progress
Revision history for this message
su_v (suv-lp) wrote :

> This filter is currently in progress (…)
I'm aware of the status (it's brand-new and marked as Experimental) ;-) - sorry if this report was overhasty and unneeded.

Revision history for this message
jazzynico (jazzynico) wrote :

> - sorry if this report was overhasty and unneeded.

No, no, not at all. I didn't notice this console message... ;)

Revision history for this message
jazzynico (jazzynico) wrote :

Not sure this issue is due to the new filter...
The error message triggers after the preview is updated 10 times (just check/uncheck the preview mode, no need to change the default values), when Filter::merge_filters is called in filter.cpp.
Maybe something wrong when reading the filters primitives.
Still investigating.

Revision history for this message
su_v (suv-lp) wrote :

I don't get the messages with the other filter effects which have dialogs (Drop Shadow, Drop Shadow color, Duochrome custom).

> gboolean sp_document_add_resource(SPDocument*, const gchar*, SPObject*): assertion `!g_slist_find(rlist, object)' failed

Could it be related to using the 'Component Transfer' filter primitive? At least the filter dialog tells:"This SVG filter effect is not yet implemented in Inkscape." and the manual says «Partially implemented, No user interface.».

sp_document_add_resource():
<http://inkscape.modevia.com/doxygen/html/document_8cpp_source.php#l01344>
called from sp_feComponentTransfer_build():
<http://inkscape.modevia.com/doxygen/html/componenttransfer_8cpp_source.php#l00094>
Comment:
     //do we need this?

Revision history for this message
jazzynico (jazzynico) wrote :

> Comment: //do we need this?

I don't know, but when it is commented, the filter doesn't trigger the error message anymore.
sp_document_add_resource() is also used in some other filters (pointlight.cpp, distantlight.cpp, spotlight.cpp and componenttransfer-funcnode.cpp) always with the same kind of comment (or // is this necessary?), but in these cases, the ressources are released differently (compare sp_fedistantlight_release with sp_feComponentTransfer_release).

Requesting some help from the dev list...

Revision history for this message
jazzynico (jazzynico) wrote :

No idea on how to fix it on the moment.

Changed in inkscape:
assignee: JazzyNico (jazzynico) → nobody
status: In Progress → Confirmed
Revision history for this message
John Smith (john-smithi) wrote :

Fix committed r11679 : Remove the addReource call from feComponentTransfer.

I think JazzyNico's comment #6 is correct.
If a filter primitive explicitly adds a resource it should remove it in the release function.
But it is not necessary to add resources either since the compound filter adds them anyway (and causes the CRITICAL message in this case).

So it should be safe to not add the resource since its not being removed in the release function.
The alternate fix is to remove the added resource in the release function.

FYI - This can be seen in "Effect->Image Paint and Draw->Poster Paint".

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: nobody → John Smith (john-smithi)
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.