trunk: critical warnings when applying or previewing extensions after opening document properties dialog (rev >= 12554)

Bug #1240308 reported by su_v on 2013-10-16
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
Unassigned

Bug Description

Steps to reproduce:
1) launch current trunk (default prefs, default new doc (no localized template))
2) open 'File > Document Properties > Page' and change default units from 'px' to 'mm'
3) open 'Extensions > Render > Gear > Gear…'
4) toggle 'Live Preview' on and off again
5) close dialog
6) inspect messages on the console

Variation:
1) launch current trunk (default prefs, default new doc (no localized template))
2) open 'File > Document Properties > Page' and change default units from 'px' to 'mm'
3) open 'Extensions > Render > Gear > Gear…'
4) click on 'Apply'
6) inspect messages on the console

Expected result:
No warnings or error messages on the console

Actual result:
Several warnings on the console each time the preview is toggled (or the extension effect applied), one of them 'Critical'.

rev 12692 (toggle live-preview):
** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): CRITICAL **: Gtk::TreeIter Inkscape::UI::Widget::PageSizer::find_paper_size(Inkscape::Util::Quantity, Inkscape::Util::Quantity) const: assertion `smaller <= larger' failed

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): CRITICAL **: Gtk::TreeIter Inkscape::UI::Widget::PageSizer::find_paper_size(Inkscape::Util::Quantity, Inkscape::Util::Quantity) const: assertion `smaller <= larger' failed

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): CRITICAL **: Gtk::TreeIter Inkscape::UI::Widget::PageSizer::find_paper_size(Inkscape::Util::Quantity, Inkscape::Util::Quantity) const: assertion `smaller <= larger' failed

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): WARNING **: Incompatible units

** (inkscape:34951): CRITICAL **: Gtk::TreeIter Inkscape::UI::Widget::PageSizer::find_paper_size(Inkscape::Util::Quantity, Inkscape::Util::Quantity) const: assertion `smaller <= larger' failed

Confirmed with r12678, r12691 on Ubuntu 13.04 (VM, 64bit) (inkscape-trunk PPA), and with r12692 on OS X 10.7.5.

Based on tests with archived builds (on OS X 10.7.5):
- not reproduced with rev <= 12553
- reproduced with rev >= 12554
these warnings originate from the merge of the GSoC unit-improvement branch in rev 12554:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/12554>

su_v (suv-lp) on 2013-10-16
description: updated
summary: - trunk: critical warnings when live-previewing extensions after changing
- default units (rev >= 12554)
+ trunk: critical warnings when applying or previewing extensions after
+ changing default units (rev >= 12554)

Correction:
The warnings start to appear after having opened and closed the 'Document Properties' dialog - it does not matter whether the default units are actually changed or not.

su_v (suv-lp) on 2013-10-16
summary: trunk: critical warnings when applying or previewing extensions after
- changing default units (rev >= 12554)
+ opening document properties dialog (rev >= 12554)
jazzynico (jazzynico) wrote :

Confirmed on Crunchbang Waldorf (Debian stable), Inkscape trunk revision 12692.

Changed in inkscape:
status: New → Triaged
su_v (suv-lp) on 2013-10-17
Changed in inkscape:
importance: Undecided → Medium
su_v (suv-lp) wrote :

Still present with r13026.

Alvin Penner (apenner) wrote :

some of these messages can also be encountered without running a Python extension.

- open default document, open Document Properties dialog
- note that default units = px
- note that Page Size = A4 (mm)
- switch to Page Size = US letter (in)
- switch to default units = mm
- get multiple console messages

** (inkscape.exe:2680): CRITICAL **: Gtk::TreeModel::iterator Inkscape::UI::Widget::PageSizer::find_paper_size(Inkscape::Util::Quantity, Inkscape::Util::Quantity) const: assertion `smallX <= largeX' failed

- switch to default units = pc
- get more console messages of the above type

Alvin Penner (apenner) wrote :

partial fix committed to rev 13052.

this fixes the CRITICAL **: Gtk::TreeModel::iterator warnings.
there are still some warnings of the type: WARNING **: Incompatible units
these are apparently caused by the presence of % units.

Johan Engelen (johanengelen) wrote :

See also my rev 13053. That piece of code should now work better for paper height/widths with different units.

Alvin Penner (apenner) wrote :

still getting warning messages, but have given up on finding the source, here is a brief summary of what I've seen so far:

- open Inkscape
- open Document Properties Dialog
- click on Custom Size->Width spin box and change width from 744 to 745 or something, without changing units.
- get many (self-made) console messages indicating that DocumentProperties::update() is executing, as expected
- close DocumentProperties Dialog
- execute Python extension
- note that a new temporary file is created and loaded
- get many (self-made) console messages indicating that DocumentProperties::update() is still executing, not expected

- in the middle of these updates, get the warning messages, caused by mixing '%' with 'px':

** (inkscape.exe:3492): WARNING **: Incompatible units

............................................................

there are three puzzlers:
- first of all, why is DocumentProperties::update() still executing?
- secondly, no units were actually changed, so this is not specifically related to document units
- thirdly, the mixture of units of '%' with 'px' appears to be happening quite normally, only temporarily, whenever any Python extension starts up. However it does not normally lead to error messages because normally DocumentProperties::update() would not be executing.

su_v (suv-lp) on 2014-11-06
Changed in inkscape:
milestone: 0.91 → 0.92
Tavmjong Bah (tavmjong-free) wrote :

Some more observations:

After the Document Properties dialog is opened, DocumentProperties::update() is being called by on_repr_attr_changed in document-properties.cpp

Running an extension, on_repr_attr_changed is being called when attributes are written in:

1. sp_namedview_document_from_window() in sp-namedview.cpp
2. copy_doc() in script.cpp: on both deleting and inserting attributes

Since the entire document is being copied, this results in about 100 calls to DocumentProperties::update()

If in any changes to attributes a value of length is changed from/to an absolute unit to/from a relative unit, an error message will be printed out.

Tavmjong Bah (tavmjong-free) wrote :

One more comment...

r12554 is not the cause of the problem but rather exposes a previously hidden problem.

Carlos Pita (carlosjosepita) wrote :

I think I'm having this problem too. After opening the Document Properties dialog most render extensions will:

1. Become increasingly slow.
2. Place the output in "random" locations and with "random" sizes.
3. Show the "incompatible units" warning.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers