Assert fails opening CSS dialog with @import url ; selector_a {}
Summary:
In 1.1-dev debug build, CSS dialog crashes if file contains @import url, a semicolon, then a selector.
Steps to reproduce:
- open Inkscape
- open drawing_crash_css_dialog.svg
- open CSS and selectors dialog (Shift+Ctrl+Q)
What happened?
- crash
- Also happens if wrapped in CDATA like so:
<![CDATA[@import "style.css"; circle {}]]>
, but not like so<![CDATA[@import "style.css";]]> circle {}
- Backtrace: inkscape-backtrace-css-dialog-import.txt
- Truncated backtrace:
** (org.inkscape.Inkscape:132438): WARNING **: 14:06:35.102: Could not open file
** (org.inkscape.Inkscape:132438): CRITICAL **: 14:06:35.102: cr_tknzr_new_from_uri: assertion 'input != NULL' failed
** (org.inkscape.Inkscape:132438): CRITICAL **: 14:06:35.102: cr_parser_parse_file: assertion 'tknzr != NULL' failed
import_style_cb: Could not parse:
[New Thread 0x7fffe62af700 (LWP 132471)]
[Thread 0x7fffe62af700 (LWP 132471) exited]
** (org.inkscape.Inkscape:132438): WARNING **: 14:06:58.011: Could not open file
** (org.inkscape.Inkscape:132438): CRITICAL **: 14:06:58.011: cr_tknzr_new_from_uri: assertion 'input != NULL' failed
** (org.inkscape.Inkscape:132438): CRITICAL **: 14:06:58.011: cr_parser_parse_file: assertion 'tknzr != NULL' failed
import_style_cb: Could not parse:
**
ERROR:../src/ui/dialog/selectorsdialog.cpp:924:std::vector<SPObject*> Inkscape::UI::Dialog::SelectorsDialog::_getObjVec(Glib::ustring): assertion failed: (selector.find(";") == Glib::ustring::npos)
Bail out! ERROR:../src/ui/dialog/selectorsdialog.cpp:924:std::vector<SPObject*> Inkscape::UI::Dialog::SelectorsDialog::_getObjVec(Glib::ustring): assertion failed: (selector.find(";") == Glib::ustring::npos)
Thread 1 "inkscape" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) set pagination off
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff5be9859 in __GI_abort () at abort.c:79
#2 0x00007ffff6227b63 in g_assertion_message (domain=<optimised out>, file=<optimised out>, line=<optimised out>, func=0x7ffff7aebad8 "std::vector<SPObject*> Inkscape::UI::Dialog::SelectorsDialog::_getObjVec(Glib::ustring)", message=<optimised out>) at ../../../glib/gtestutils.c:2914
#3 0x00007ffff6284b4f in g_assertion_message_expr (domain=domain@entry=0x0, file=file@entry=0x7ffff7aebb30 "../src/ui/dialog/selectorsdialog.cpp", line=line@entry=924, func=func@entry=0x7ffff7aebad8 "std::vector<SPObject*> Inkscape::UI::Dialog::SelectorsDialog::_getObjVec(Glib::ustring)", expr=expr@entry=0x7ffff7aebaa8 "selector.find(\";\") == Glib::ustring::npos") at ../../../glib/gtestutils.c:2940
#4 0x00007ffff753cb18 in Inkscape::UI::Dialog::SelectorsDialog::_getObjVec(Glib::ustring) (this=this@entry=0x55555779dc20, selector=...) at ../src/ui/dialog/selectorsdialog.cpp:924
#5 0x00007ffff75436ee in Inkscape::UI::Dialog::SelectorsDialog::_selectRow() (this=0x55555779dc20) at /usr/include/gtkmm-3.0/gtkmm/treeiter.h:565
#6 0x00007ffff7543b99 in Inkscape::UI::Dialog::SelectorsDialog::NodeObserver::notifyContentChanged(Inkscape::XML::Node&, Inkscape::Util::ptr_shared, Inkscape::Util::ptr_shared) (this=0x5555583c1370) at ../src/ui/dialog/selectorsdialog.cpp:86
#7 0x00007ffff7719c45 in Inkscape::XML::CompositeNodeObserver::notifyContentChanged(Inkscape::XML::Node&, Inkscape::Util::ptr_shared, Inkscape::Util::ptr_shared) (this=this@entry=0x555556710b18, node=..., old_content=old_content@entry=..., new_content=...) at ../src/xml/composite-node-observer.cpp:84
#8 0x00007ffff772dca6 in Inkscape::XML::SimpleNode::setContent(char const*) (this=0x555556710ab0, content=<optimised out>) at ../src/xml/simple-node.cpp:309
#9 0x00007ffff753e226 in Inkscape::UI::Dialog::SelectorsDialog::_writeStyleElement() (this=this@entry=0x55555779dc20) at ../src/ui/dialog/selectorsdialog.cpp:641
#10 0x00007ffff7541039 in Inkscape::UI::Dialog::SelectorsDialog::_readStyleElement() (this=this@entry=0x55555779dc20) at ../src/ui/dialog/selectorsdialog.cpp:583
#11 0x00007ffff7543c57 in Inkscape::UI::Dialog::SelectorsDialog::_handleSelectionChanged() (this=this@entry=0x55555779dc20) at ../src/ui/dialog/selectorsdialog.cpp:1326
#12 0x00007ffff7543ca6 in Inkscape::UI::Dialog::SelectorsDialog::update() (this=0x55555779dc20) at ../src/ui/dialog/selectorsdialog.cpp:1315
What should have happened?
- no crash, similar behaviour to release build
Version Info:
- Inkscape 1.1-dev (17927dee9b, 2020-12-18) Linux Mint 20
- not in 1.0.x.