Thanks Vladimir,
Should be fixed now.
Cheers, Johan
-----Original Message----- From: Vladimir Savic [mailto:vladimir.firefly.savic@...400...] Sent: zaterdag 8 november 2008 14:39 To: Engelen, J.B.C. (Johan) Cc: inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] 2geom update: new Rect and OptRect
J.B.C.Engelen@...1578... wrote:
Hi all,
I just updated 2geom in our trunk. It contains the 'new' Rect and OptRect (and Interval and OptInterval). Geom::Rect can no longer be empty. It *always* contains a rectangle. Geom::OptRect contains a rect or nothing (which means an
empty rect).
The same holds for Geom::Interval and Geom::OptInterval.
For example, boundingbox functions return an OptRect. You have to check whether it is empty or not, before you use the values in the Rect. If you didn't and turns out the bbox is empty, Inkscape will crash :-)
Think I've might just find one. When I try opening example shipped with inkscape, called filters.svg, crash happens. Here's the backtrace:
14:34 linux:~/sources/inkscape > gdb /opt/inkscape/bin/inkscape GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux"... (gdb) run Starting program: /opt/inkscape/bin/inkscape [Thread debugging using libthread_db enabled] [New Thread 0x7fdde670e700 (LWP 14854)]
** (inkscape:14854): WARNING **: Family name Bitstream Vera Sans does not have an entry in the font lister. inkscape: /usr/include/boost/optional/optional.hpp:578: typename boost::optional_detail::optional_base<T>::reference_type boost::optional<T>::get() [with T = Geom::D2Geom::Interval]: Assertion `this->is_initialized()' failed.
Program received signal SIGABRT, Aborted. [Switching to Thread 0x7fdde670e700 (LWP 14854)] 0x00007fdddeaae5c5 in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007fdddeaae5c5 in raise () from /lib64/libc.so.6 #1 0x00007fdddeaafbb3 in abort () from /lib64/libc.so.6 #2 0x00007fdddeaa71e9 in __assert_fail () from /lib64/libc.so.6 #3 0x00000000007722a2 in nr_arena_shape_update (item=0x6450800, area=0x0, gc=0x7fffee760ee0, state=256, reset=510) at /usr/include/boost/optional/optional.hpp:578 #4 0x0000000000769fb8 in nr_arena_item_invoke_update (item=0x6450800, area=0x0, gc=0x7fffee760fb0, state=510, reset=510) at display/nr-arena-item.cpp:260 #5 0x000000000076c2c0 in nr_arena_group_update (item=0x493bd20, area=0x0, gc=0x7fffee761060, state=510, reset=510) at display/nr-arena-group.cpp:178 #6 0x0000000000769fb8 in nr_arena_item_invoke_update (item=0x493bd20, area=0x0, gc=0x7fffee761130, state=510, reset=510) at display/nr-arena-item.cpp:260 #7 0x000000000076c2c0 in nr_arena_group_update (item=0x493be70, area=0x0, gc=0x7fffee7611e0, state=510, reset=510) at display/nr-arena-group.cpp:178 #8 0x0000000000769fb8 in nr_arena_item_invoke_update (item=0x493be70, area=0x0, gc=0x7fffee7612b0, state=510, reset=510) at display/nr-arena-item.cpp:260 #9 0x000000000076c2c0 in nr_arena_group_update (item=0x1489d20, area=0x0, gc=0x7fffee761360, state=510, reset=510) at display/nr-arena-group.cpp:178 #10 0x0000000000769fb8 in nr_arena_item_invoke_update (item=0x1489d20, area=0x0, gc=0x2062548, state=510, reset=510) at display/nr-arena-item.cpp:260 #11 0x00000000007762b4 in sp_canvas_arena_update (item=0x2062480, affine=@...2070..., flags=2) at display/canvas-arena.cpp:152 #12 0x000000000078f937 in sp_canvas_item_invoke_update (item=0x2062480, affine=<value optimized out>, flags=3) at display/sp-canvas.cpp:306 #13 0x0000000000793f8f in sp_canvas_group_update (item=0x2069ad0, affine=@...2071..., flags=3) at display/sp-canvas.cpp:785 #14 0x000000000078f937 in sp_canvas_item_invoke_update (item=0x2069ad0, affine=<value optimized out>, flags=1) at display/sp-canvas.cpp:306 #15 0x0000000000793f8f in sp_canvas_group_update (item=0x1fcec20, affine=@...2072..., flags=1) at display/sp-canvas.cpp:785 #16 0x000000000078f937 in sp_canvas_item_invoke_update (item=0x1fcec20, affine=<value optimized out>, flags=0) at display/sp-canvas.cpp:306 #17 0x00000000007939ca in do_update (canvas=0x2072000) at display/sp-canvas.cpp:2198 #18 0x0000000000793d52 in idle_handler (data=<value optimized out>) at display/sp-canvas.cpp:2226 #19 0x00007fdde29cb93a in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0 #20 0x00007fdde29cf040 in ?? () from /usr/lib64/libglib-2.0.so.0 #21 0x00007fdde29cf50d in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0 #22 0x00007fdde4f56977 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0 #23 0x00000000004527c9 in sp_main_gui (argc=1, argv=0x7fffee761e38) at main.cpp:854 #24 0x0000000000452c8e in main (argc=1, argv=0x7fffee761e38) at main.cpp:664 (gdb)
Vlada
Note that Rect's no longer have the method 'isEmpty'.
Rect's do have
the 'hasZeroArea' method. If this is true, the Rect
contains a single
point, like a (0,0)-(0,0) rectangle. It's not empty, it
contains one
point (0,0).
(OptRect and OptInterval have the same usage as
boost::optional<Rect>)
I made Inkscape compile with this update, and tried to fix
cases where
there was not an explicit empty check. I may have introduced/uncovered bugs, sorry for that. Let us know about what you've found.
Cheers, Johan