Crash export-id-only to svg with ungrouped clone
Steps to reproduce:
Quite odd, specific cases for crash but in master
- Download clone-use.svg
- Run
inkscape "Downloads/clone-use.svg" --export-id="target" --export-id-only --export-file="export.svg"
- Crash
Backtrace for Inkscape 1.1-dev (3fd61253, 2020-01-31) debug build, Linux Mint 19.1: inkscape_backtrace_export_svg.txt
Truncated backtrace for search
(gdb) bt #0 0x00007ffff4249434 in __dynamic_cast () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #1 0x00007ffff6c0e616 in SPObject::deleteObject(bool, bool) (this=0x555555e0dc70, propagate=propagate@entry=true, propagate_descendants=propagate_descendants@entry=true) at ../src/object/sp-object.cpp:486 #2 0x00007ffff6c0ef63 in SPObject::cropToObject(SPObject*) (this=this@entry=0x555556b82450, except=except@entry=0x555555b356d0) at ../src/object/sp-object.cpp:520 #3 0x00007ffff6c0eef0 in SPObject::cropToObject(SPObject*) (this=0x5555557e2120, except=except@entry=0x555555b356d0) at ../src/object/sp-object.cpp:513 #4 0x00007ffff6a2669d in InkFileExportCmd::do_export_svg(SPDocument*, std::__cxx11::basic_string, std::allocator >) (this=this@entry=0x7ffff7dd2690 ::get_instance()::instance+144>, doc=doc@entry=0x555555febc00, filename_in="/home/nal/Downloads/basically_errors.svg") at ../src/io/file-export-cmd.cpp:265 #5 0x00007ffff6a277cc in InkFileExportCmd::do_export(SPDocument*, std::__cxx11::basic_string, std::allocator >) (this=this@entry=0x7ffff7dd2690 ::get_instance()::instance+144>, doc=doc@entry=0x555555febc00, filename_in="/home/nal/Downloads/basically_errors.svg") at ../src/io/file-export-cmd.cpp:122
Export to pdf doesn't crash, placing the clone inside a group prevents the crash
Example files
Simplified example (not clone-use.svg):
Run inkscape "minimal.svg" --export-id="target" --export-id-only --export-file="export.svg"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0" y="0" height="10" width="10" id="original" />
<use x="0" y="0" height="100%" width="100%" id="clone" xlink:href="#original" />
<rect x="10" y="10" height="10" width="10" id="target" />
</svg>
Adding group tags to clone (no crash):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0" y="0" height="10" width="10" id="original" />
<g><use x="0" y="0" height="100%" width="100%" id="clone" xlink:href="#original" /></g>
<rect x="10" y="10" height="10" width="10" id="target" />
</svg>
Inkscape Version and Operating System:
- Inkscape 1.1-dev (3fd61253, 2020-01-31) debug build, Linux Mint 19.1
- Inkscape 1.0alpha (9dee831c, 2019-01-15) appimage, Linux Mint 19.1
- Inkscape 0.92.4 (f053d5d8, 2020-01-13) debug build, Linux Mint 19.1 (using
--export-plain-svg
inside of--export-file
, backtrace includes call tosp_object_unref
at the top of everything) - Inkscape 0.92.3 (2405546, 2018-03-11) ppa, Linux Mint 19.1, similar to 0.92.4
Changelog
- Added truncated backtrace to improve search
- Added extra test case