Connector: assertion failure when moving empty group

Bug #167354 reported by Nirk
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Critical
Michael Wybrow

Bug Description

This is the error output on stdout:

** ERROR **: file sp-conn-end.cpp: line 224 (NR::Point
calc_bbox_conn_pt(const NR::Rect&, const NR::Point&)):
assertion failed: ((offset[otherDim] >= 0) ==
(cp[otherDim] >= 0))
aborting...

Reproduction: Move the text object "doc" on the top of
the page in the attached file a little and release mouse.

Some about my system:

$ uname -a
Linux beynac 2.6.12-9-686 #1 Mon Oct 10 13:25:32 BST
2005 i686 GNU/Linux
I run Ubuntu 6.04 "Dapper Drake" Development Branch

$ inkscape -V
Inkscape 0.43 (Feb 23 2006)

$ gdb --version
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show
warranty" for details.
This GDB was configured as "i486-linux-gnu".

$ gdm --version
GDM 2.13.0.8

the rest of this detailed description is gdb output
with /*comments*/, error and bt:

$ env DISPLAY=':0.0' gdb inkscape
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are
welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show
warranty" for details.
This GDB was configured as "i486-linux-gnu"...(no
debugging symbols found)
Using host libthread_db library
"/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) run project_graph2.svg
Starting program: /usr/bin/inkscape project_graph2.svg
(no debugging symbols found)
/* ... */
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1227130400 (LWP 21462)]
(no debugging symbols found)
/* ... */
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
/* ... */
(no debugging symbols found)

/* here, I switch to the xserver and move the text
object "doc" on the top of the page a little to the
right. */

** ERROR **: file sp-conn-end.cpp: line 224 (NR::Point
calc_bbox_conn_pt(const NR::Rect&, const NR::Point&)):
assertion failed: ((offset[otherDim] >= 0) ==
(cp[otherDim] >= 0))
aborting...

Program received signal SIGABRT, Aborted.
[Switching to Thread -1227130400 (LWP 21462)]
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb6f4f9a1 in raise () from
/lib/tls/i686/cmov/libc.so.6
#2 0xb6f512b9 in abort () from
/lib/tls/i686/cmov/libc.so.6
#3 0xb7384ef6 in g_logv () from /usr/lib/libglib-2.0.so.0
#4 0xb7384f2a in g_log () from /usr/lib/libglib-2.0.so.0
#5 0xb7384f96 in g_assert_warning () from
/usr/lib/libglib-2.0.so.0
#6 0x081e3843 in SPConnEnd::setAttacherHref ()
#7 0x081e3c6b in SPConnEnd::SPConnEnd ()
#8 0x0815ac4b in sp_item_write_transform ()
#9 0x08141207 in sp_selection_apply_affine ()
#10 0x081ddf20 in sp_sel_trans_ungrab ()
#11 0x081dac8d in key_is_a_modifier ()
#12 0x081b5e79 in sp_event_context_root_handler ()
#13 0x082cf03f in sp_marshal_INT__POINTER_POINTER ()
#14 0xb73e979f in g_closure_invoke () from
/usr/lib/libgobject-2.0.so.0
#15 0xb73f82da in g_signal_stop_emission () from
/usr/lib/libgobject-2.0.so.0
#16 0xb73f9876 in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#17 0xb7ae7a43 in gtk_signal_emit () from
/usr/lib/libgtk-x11-2.0.so.0
#18 0x082bb6c8 in sp_canvas_arena_get_type ()
#19 0x082bbbbf in sp_canvas_arena_render_pixblock ()
#20 0x082cedf8 in sp_marshal_BOOLEAN__POINTER ()
#21 0xb73e916f in g_cclosure_new_swap () from
/usr/lib/libgobject-2.0.so.0
#22 0xb73e979f in g_closure_invoke () from
/usr/lib/libgobject-2.0.so.0
#23 0xb73f89be in g_signal_stop_emission () from
/usr/lib/libgobject-2.0.so.0
#24 0xb73f9876 in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#25 0xb7ae7a43 in gtk_signal_emit () from
/usr/lib/libgtk-x11-2.0.so.0
#26 0x082c9b57 in sp_canvas_new_aa ()
#27 0x082cae95 in sp_canvas_update_now ()
#28 0xb7aa0460 in _gtk_marshal_BOOLEAN__BOXED () from
/usr/lib/libgtk-x11-2.0.so.0
#29 0xb73e916f in g_cclosure_new_swap () from
/usr/lib/libgobject-2.0.so.0
#30 0xb73e979f in g_closure_invoke () from
/usr/lib/libgobject-2.0.so.0
#31 0xb73f89be in g_signal_stop_emission () from
/usr/lib/libgobject-2.0.so.0
#32 0xb73f9876 in g_signal_emit_valist () from
/usr/lib/libgobject-2.0.so.0
#33 0xb73f9e79 in g_signal_emit () from
/usr/lib/libgobject-2.0.so.0
#34 0xb7b8246f in gtk_widget_activate () from
/usr/lib/libgtk-x11-2.0.so.0
#35 0xb7a9ebdd in gtk_propagate_event () from
/usr/lib/libgtk-x11-2.0.so.0
#36 0xb7a9efeb in gtk_main_do_event () from
/usr/lib/libgtk-x11-2.0.so.0
#37 0xb7942e1c in _gdk_events_queue () from
/usr/lib/libgdk-x11-2.0.so.0
#38 0xb737c7d7 in g_main_context_dispatch () from
/usr/lib/libglib-2.0.so.0
#39 0xb737f896 in g_main_context_check () from
/usr/lib/libglib-2.0.so.0
#40 0xb737fbb8 in g_main_loop_run () from
/usr/lib/libglib-2.0.so.0
#41 0xb7a9e2e5 in gtk_main () from
/usr/lib/libgtk-x11-2.0.so.0
#42 0xb7eb5b35 in Gtk::Main::run_impl () from
/usr/lib/libgtkmm-2.4.so.1
#43 0xb7eb5a26 in Gtk::Main::run () from
/usr/lib/libgtkmm-2.4.so.1
#44 0x0812dff2 in sp_main_gui ()
#45 0x081f51d5 in
Inkscape::NSApplication::Application::run ()
#46 0x0812d8ce in main ()
(gdb) c
Continuing.

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at
www.inkscape.org
with a detailed description of the steps leading to the
crash, so we can fix it.

/* inkscape shows error ok-box which cannot be clicked.
xserver doesn't respond. */
/* ctrl-c */
Program received signal SIGINT, Interrupt.
0xffffe410 in __kernel_vsyscall ()
(gdb) k
Kill the program being debugged? (y or n) y
(gdb) q

Revision history for this message
Nirk (nirk) wrote :
Revision history for this message
Peter Moulder (pjrm) wrote :

Reproduced.

The problem is that calc_bbox_conn_pt is being passed an
empty bbox (i.e. x0=y0=1e18,x1=y1=-1e18), which in turn is
because the connector's other end (#g2504) is an empty group!

Perhaps handle the case that the bbox is empty as detaching
that end. Does that sound reasonable, from a user's
perspective?

Revision history for this message
Bug Importer (bug-importer) wrote :

I don't know if I understand your explanation, pjrm. I am
unfamiliar with the terms you use.

I am more of a programmer than a user, so I wouldn't be the
right person to answer you question.

The Norwegian "Linuxmagasinet" had an article about the fast
developing Inkscape some time ago, and I recalled this the
other day when I needed to make some scalable vector graphics :)

Inkscape is truly impressive.

One thing though, irritates me. It is possible that object
connection is not an important subject in this application,
but I would like the connectors to not get disconnected if I
ungroup something it is connected to, and to not get
disconnected when I select two objects and a connector
between them, and move these together. That is really
frustrating, though I understand why it is that way.

Revision history for this message
Peter Moulder (pjrm) wrote :

Re understanding terms: yes, sorry, the detail about bbox
etc. was intended for Michael (or other inkscapers fixing
the bug).

The question that you might comment on is how connectors
should behave when one drags one of the attached objects
when the other attached object is an empty group.

Re "I would like the connectors to not get disconnected if I
ungroup something it is connected to": I'm not sure I
understand: how can it "stay connected" to something that
doesn't even exist any more? Should "ungroup" cause the
connector to reattach itself to some member of the group
(without moving the connector) ? Are you aware of the
"enter group" functionality (double-click on the group, or
right-click on it and choose the ‘Enter group #...’
(‘Rediger gruppe nr. ...’) menu item. If you weren't aware
of "enter group", then perhaps the fix is just to make this
functionality more prominent, e.g. offer it from the same
places where "Ungroup" is currently offered in the user
interface.

Re selecting connectors and their attached objects together
and moving them all: Yes, this should certainly be changed.
 Michael, is there already an RFE for this?

Revision history for this message
Nirk (nirk) wrote :

I wasn't aware of the "enter group" functionality. I
ungrouped groups whenever I wanted to change it's internals.
The "enter group" function is already quite prominent. I
would have found it had i searched for it. If it should be
more prominent, or placed where "Ungroup" is, I can't say,
as I discovered the group/ungroup functionality by pressing
C-g and C-u, the obvious and actual shortcuts. :)

After further investigation:

When you right click some objects, and the context menu
appears, "Group" could be a menu item where "Ungroup" is
when you select a grouped object, and "Enter group" could be
placed near "Ungroup" without any separators between. Is
there a keyboard shortcut for "Enter group"?

Ungroup and group has nice icons in the main application
menu which could be used in the context menu. Enter group
could also have an icon.

In my opinion, "Enter group" should be made a more prominent
feature.

Revision history for this message
Bryce Harrington (bryce) wrote :

Has there been progress on this bug? I'm wondering if this
qualifies as a must-fix for 0.44, or can be left for later.

Revision history for this message
Michael Wybrow (mjwybrow) wrote :

This problem is fixed in SVN. Connectors get detached from
empty groups now when they attempt to reroute to them.

Also, the other problem mentioned below, of connectors moved
as part of a selection becoming detached from other objects
in the selection was fixed as part of my big bugfixing
effort a few weeks ago. Connectors now stay attached to
other objects moved as part of the selection.

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.