[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1059381: inkscape: Crashes when setting circle radius in document with tiny scale (huge viewBox extents)



Package: inkscape
Version: 1.2.2-2+b1
Severity: normal

Dear Maintainer,

I have a document containing a circle.  I think the actual radius of the circle
is 3.985 cm, but Inkscape shows a radius value of 0.000 cm.  When I try
changing the radius of the circle, Inkscape crashes with the message:

Inkscape encountered an internal error and will close now.  Automatic backups of unsaved documents were done to the following locations:
...

This is printed to standard error:

---
terminate called after throwing an instance of 'Geom::Exception'
  what():  lib2geom exception: assertion failed: B.isFinite() (./src/2geom/sbasis-to-bezier.cpp:485)

Emergency save activated!

Emergency save document locations:
  [... omitted ...].svg
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at https://inkscape.org/report
with a detailed description of the steps leading to the crash, so we can fix it.
---

Also: if I draw a new circle in this document and try setting the radius values
the same way, the same symptoms occur.


The issue also occurs in the upstream Inkscape AppImage (version 1.3.2
(091e20e, 2023-11-25)), so I've already reported it upstream as well:

    https://gitlab.com/inkscape/inbox/-/issues/9723

However, in the newer AppImage version, Inkscape doesn't crash, but prints a
similar message to standard error and behaves incorrectly (scales the circle to
be too large).  I don't know if the difference in behavior is because of
changes between versions 1.2.2 and 1.3.2, or if it is because of build options
chosen by Debian to favor a crash instead of trying to proceed through a failed
assertion.

There may not be much point in this Debian bug report since what is essentially
the same issue appears upstream, but hopefully this helps Debian users who are
experiencing the issue and might be searching bug reports.  I hope any upstream
fix can be expedited for Debian stable users in the next point release.


The issue occurs specifically in this document (attached), which was originally
generated by the SVG plot function in pcbnew 6.0.11 (the KiCad PCB Editor).  I
performed some edits to the SVG document with Inkscape and hit this issue on
one circle in particular.  This is a cut-down test case, with all objects other
than the circle deleted.

My guess is that the large viewBox extents (`0 0 297002200 210007200`) that
pcbnew chose for the root `<svg>` element are triggering this issue.  It seems
like pcbnew chose these viewBox extents for the convenience of using nanometer
values when writing the document, and letting the `viewBox` and
`width`/`height` attributes scale the object sizes and positions to the right
real distance units.  The document is probably valid, but I'm not an SVG
expert; I don't know if the specification warns against or forbids huge values.

There's no indication to Inkscape users that there's anything unusual with the
document scaling through normal editing.  All the object sizes and positions
look fine.  You have to check the Document Properties or read the SVG file to
notice this issue (or run into this Inkscape issue).


The issue seems to follow the document.  For a simple document like this one
with just one layer, I can adjust the viewBox extents to work around the bug:

  1. Select all objects and cut to the clipboard.
  
  2. Open Document Properties.
  
  3. Choose a reasonable Scale value.  It was previously set to 0.000001 cm per
     user unit in this document, so I chose 1 cm per user unit.
  
  4. Paste In Place to restore the objects.

Or, more simply:

  1. Select all objects and copy to the clipboard.
  
  2. Create a new document.
  
  3. Paste In Place to transfer the objects.

-- System Information:
Debian Release: 12.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-10-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages inkscape depends on:
ii  lib2geom1.2.0              1.2.2-3
ii  libatkmm-1.6-1v5           2.28.3-1
ii  libboost-filesystem1.74.0  1.74.0+ds1-21
ii  libc6                      2.36-9+deb12u3
ii  libcairo-gobject2          1.16.0-7
ii  libcairo2                  1.16.0-7
ii  libcairomm-1.0-1v5         1.14.4-2
ii  libcdr-0.1-1               0.1.6-2+b2
ii  libfontconfig1             2.14.1-4
ii  libfreetype6               2.12.1+dfsg-5
ii  libgc1                     1:8.2.2-3
ii  libgcc-s1                  12.2.0-14
ii  libgdk-pixbuf-2.0-0        2.42.10+dfsg-1+b1
ii  libglib2.0-0               2.74.6-2
ii  libglibmm-2.4-1v5          2.66.5-2
ii  libgomp1                   12.2.0-14
ii  libgsl27                   2.7.1+dfsg-5
ii  libgspell-1-2              1.12.0-1+b2
ii  libgtk-3-0                 3.24.38-2~deb12u1
ii  libgtkmm-3.0-1v5           3.24.7-1
ii  libharfbuzz0b              6.0.0+dfsg-3
ii  libjpeg62-turbo            1:2.1.5-2
ii  liblcms2-2                 2.14-2
ii  libmagick++-6.q16-8        8:6.9.11.60+dfsg-1.6
ii  libpango-1.0-0             1.50.12+ds-1
ii  libpangocairo-1.0-0        1.50.12+ds-1
ii  libpangoft2-1.0-0          1.50.12+ds-1
ii  libpangomm-1.4-1v5         2.46.3-1
ii  libpng16-16                1.6.39-2
ii  libpoppler-glib8           22.12.0-2+b1
ii  libpoppler126              22.12.0-2+b1
ii  libpotrace0                1.16-2
ii  libreadline8               8.2-1.3
ii  librevenge-0.0-0           0.0.5-3
ii  librsvg2-common            2.54.7+dfsg-1~deb12u1
ii  libsigc++-2.0-0v5          2.12.0-1
ii  libsoup2.4-1               2.74.3-1
ii  libstdc++6                 12.2.0-14
ii  libvisio-0.1-1             0.1.7-1+b3
ii  libwpg-0.3-3               0.3.3-1
ii  libx11-6                   2:1.8.4-2+deb12u2
ii  libxml2                    2.9.14+dfsg-1.3~deb12u1
ii  libxslt1.1                 1.1.35-1
ii  python3                    3.11.2-1+b1
ii  zlib1g                     1:1.2.13.dfsg-1

Versions of packages inkscape recommends:
ii  aspell                           0.60.8-4+b1
ii  fig2dev                          1:3.2.8b-3
ii  imagemagick                      8:6.9.11.60+dfsg-1.6
ii  imagemagick-6.q16 [imagemagick]  8:6.9.11.60+dfsg-1.6
ii  libimage-magick-perl             8:6.9.11.60+dfsg-1.6
ii  libwmf-bin                       0.2.12-5.1
pn  python3-cssselect                <none>
ii  python3-lxml                     4.9.2-1+b1
ii  python3-numpy                    1:1.24.2-1
ii  python3-scour                    0.38.2-2

Versions of packages inkscape suggests:
ii  dia                   0.97.3+git20220525-5
pn  inkscape-tutorials    <none>
pn  libsvg-perl           <none>
ii  pstoedit              3.78-2
ii  python3-packaging     23.0-1
pn  python3-uniconvertor  <none>
pn  ruby                  <none>

-- no debconf information

-- 
Jean-Paul Larocque <jpl-debian-bts@thoughtcrime.us>

Attachment: circle_radius.svg
Description: image/svg


Reply to: