Assertion `pathlen < 200' failed

Bug #1155046 reported by Mildred
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
jazzynico
Fedora
Won't Fix
Undecided

Bug Description

Inkscape crash with:

inkscape: libavoid/connector.cpp:844: bool Avoid::ConnRef::generatePath(): Assertion `pathlen < 200' failed.

This is because I have too mushc onnectors in my drawing I think. Removing the assertion, and I can open my files again.

See details in https://bugzilla.redhat.com/show_bug.cgi?id=921033

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Description of problem:
Opened a svg file with inkscape

Version-Release number of selected component:
inkscape-0.48.4-1.fc18

Additional info:
backtrace_rating: 4
cmdline: inkscape /home/shanti/Work/Sogilis/formation-git/Slides/03_Branches.svg.2013_03_13_11_23_37.0.svg
crash_function: Avoid::ConnRef::generatePath
executable: /usr/bin/inkscape
kernel: 3.7.4-204.fc18.x86_64
uid: 1000

Truncated backtrace:
Thread no. 1 (9 frames)
 #4 Avoid::ConnRef::generatePath at libavoid/connector.cpp:844
 #5 Avoid::Router::rerouteAndCallbackConnectors at libavoid/router.cpp:739
 #6 Avoid::Router::processTransaction at libavoid/router.cpp:564
 #7 sp_document_ensure_up_to_date at document.cpp:1055
 #8 SPDesktop::init at desktop.cpp:188
 #9 SPDesktopWidget::createInstance at widgets/desktop-widget.cpp:1417
 #10 sp_desktop_widget_new at widgets/desktop-widget.cpp:1402
 #11 sp_file_open at file.cpp:244
 #12 sp_main_gui at main.cpp:968

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709481
File: backtrace

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709482
File: cgroup

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709483
File: core_backtrace

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709484
File: dso_list

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709485
File: environ

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709486
File: limits

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709487
File: maps

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709488
File: open_fds

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709489
File: proc_pid_status

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709490
File: var_log_messages

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Created attachment 709491
File: 03_Branches.svg.2013_03_13_11_23_37.0.svg

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

I am getting the following from the command line:

inkscape: libavoid/connector.cpp:844: bool Avoid::ConnRef::generatePath(): Assertion `pathlen < 200' failed.

Looking at libavoid/connector.cpp, it seem that inkscape was not designed for path length > 200. And I think I hit the limit.

Here is what I can get from this source file name:

825 int pathlen = 1;
826 for (VertInf *i = tar; i != _srcVert; i = i->pathNext)
827 {
828 pathlen++;
829 if (i == NULL)
830 {
831 db_printf("Warning: Path not found...\n");
832 pathlen = 2;
833 tar->pathNext = _srcVert;
834 if ((_type == ConnType_PolyLine) && _router->InvisibilityGrph)
835 {
836 // TODO: Could we know this edge already?
837 EdgeInf *edge = EdgeInf::existingEdge(_srcVert, tar);
838 COLA_ASSERT(edge != NULL);
839 edge->addCycleBlocker();
840 }
841 break;
842 }
843 // Check we don't have an apparent infinite connector path.
844 COLA_ASSERT(pathlen < 200);
845 }
846 std::vector<Point> path(pathlen);

I'm using a lot of connectors in this drawing, you can look at the file that fails to open.

And this is very annoying because I can save the drawing ok, but then I can't open it afterwards. Fortunately, I have version control and was able to dig up a previous version that I could still open. But when I'm doing some operations, it always end up with this assertion failure.

Revision history for this message
In , Mildred (mildred-redhat-bugs) wrote :

Removing this assertion and recompiling inkscape ... I can open my files; Yay !

Reported in inkscape bug tracker: https://bugs.launchpad.net/fedora/+bug/1155046

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

Not reproduced with Inkscape 0.47 on OS X 10.7,
reproduced with Inkscape 0.48.4 and 0.48+devel r12203

tags: added: connectors regression
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Mildred (mildred) wrote :

Sorry, forgot to tell which version I used: inkscape-0.48.4-1.fc18.x86_64

Revision history for this message
jazzynico (jazzynico) wrote :

The regression was introduced with revision 8855 "Merge GSoC2009 Connectors into trunk" (http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/8855).

Revision history for this message
jazzynico (jazzynico) wrote :

Arcadie, do you remember why you added that pathlen test? Apparently, it prevents valid SVG files from loading.
Would it be acceptable to set a higher value?

Apart from that, I find it a bit harsh to quit the whole application just because it can't load a file. It would be nicer to have an error dialog, as it is done when extension-based imports fail.

Changed in inkscape:
assignee: nobody → Arcadie M. Cracan (acracan)
status: Confirmed → Triaged
Revision history for this message
Arcadie M. Cracan (acracan) wrote : Re: [Bug 1155046] Re: Assertion `pathlen < 200' failed

Actually this assertion is inside libavoid and I didn't touch that code.
Perhaps Michael would better explain the reason that assertion is there.

I will try to contact him and ask about it.

În ziua de Lun 18 Mar 2013, la 09:58:43, ați scris:
> Arcadie, do you remember why you added that pathlen test? Apparently, it
> prevents valid SVG files from loading. Would it be acceptable to set a
> higher value?
>
> Apart from that, I find it a bit harsh to quit the whole application
> just because it can't load a file. It would be nicer to have an error
> dialog, as it is done when extension-based imports fail.
>
> ** Changed in: inkscape
> Status: Confirmed => Triaged
>
> ** Changed in: inkscape
> Assignee: (unassigned) => Arcadie M. Cracan (acracan)

Revision history for this message
Mildred (mildred) wrote :

Perhaps it is possible to increase the limit (I suspect this was a check for infinite loops, thinking this was a high enough value) and disable this assertion in release builds.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be
able to fix it before Fedora 18 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Revision history for this message
kilian (istdochspam-wirklich) wrote :

I stumpled multiple times over the same bug. Solved it each time manually by setting pathlen check limit to 6000 (in libavoid/connector.cpp Line 844 ).. It would be perfect, if you could include that perminately...

Revision history for this message
jazzynico (jazzynico) wrote :

Attaching the test file posted in the original Red Hat bug report (https://bugzilla.redhat.com/show_bug.cgi?id=921033 comment #11).

jazzynico (jazzynico)
Changed in inkscape:
assignee: Arcadie M. Cracan (acracan) → jazzynico (jazzynico)
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Test value set to 10000 as of revision 13501.

Note that the upstream libavoid project is still active (part of adaptagrams, see https://github.com/mjwybrow/adaptagrams). Apparently the latest code doesn't use the pathlen check anymore in the connector.cpp file (https://github.com/mjwybrow/adaptagrams/blob/master/cola/libavoid/connector.cpp). But lots of code changed since we included it in Inkscape, and I suggest that we consider updating to a more recent version (in 1.0?).

Changed in inkscape:
milestone: none → 0.91
status: In Progress → Fix Committed
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Won't Fix
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.