GNOME Bugzilla – Bug 155472
assert() statements have no place in a shared library
Last modified: 2011-08-25 04:56:01 UTC
There appear to be several places where libart has assert() statements in it, which, if encountered, cause the application using the library to abort. This is a bad practice: assert() statements should be used as developer debugging aids only, and should not appear in released code, especially in code used by third parties in a shared-library setting. Some systems will convert assert() statements into no-ops if the NDEBUG macro is defined. Another option is to actually handle the errors properly instead of just bailing. Context: The Xfce Desktop Environment (http://xfce.org/) uses gdk-pixbuf, which in turn uses librsvg (which uses libart_lgpl) to render SVG icons for menus and panel launchers. Some of our users are complaining that portions of our desktop are crashing, when the root cause comes from assert() statements in libart, such as this: xfdesktop: art_render_gradient.c:338: art_render_gradient_linear_render_8: Asser tion `offset_fraction <= stops[ix].offset' failed. Aborted
Created attachment 32629 [details] [review] patch to remove assert statements This patch "#if 0"s the assert() statements, and (naively) attempts to recover if the assert() conditions are not met. This seems to work well enough to allow our apps to continue running if the assert() condition fails.
*** Bug 121850 has been marked as a duplicate of this bug. ***
*** Bug 166373 has been marked as a duplicate of this bug. ***
libart development has been stalled and it has been unmaintained now. Maintainers don't have future development plan so i am closing all the bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.