Crash on attribute name with space
Steps to reproduce:
If I add an attribute with a name containing a space in the XML editor, inkscape crashes.
- open Inkscape
- add a shape
- select the shape
- open XML editor
- add an attribute with a name containing a space
- press TAB to change row or click anywhere to validate.
What happened?
Inkscape crash without complaining
Backtrace: inkscape_backtrace_xml_attribute_space.txt
Truncated version of backtrace
ERROR:../src/xml/simple-node.cpp:326:virtual void Inkscape::XML::SimpleNode::setAttributeImpl(const gchar*, const gchar*): assertion failed: (std::none_of(name, name + strlen(name), [](char c) { return g_ascii_isspace(c); }))
Thread 1 "inkscape" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff3e03e97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff3e05801 in __GI_abort () at abort.c:79
#2 0x00007ffff5c33335 in g_assertion_message (domain=domain@entry=0x0, file=file@entry=0x7ffff76cba6e "../src/xml/simple-node.cpp", line=line@entry=326, func=func@entry=0x7ffff76cc060 <Inkscape::XML::SimpleNode::setAttributeImpl(char const*, char const*)::__PRETTY_FUNCTION__> "virtual void Inkscape::XML::SimpleNode::setAttributeImpl(const gchar*, const gchar*)", message=message@entry=0x555558c41b10 "assertion failed: (std::none_of(name, name + strlen(name), [](char c) { return g_ascii_isspace(c); }))") at ../../../../glib/gtestutils.c:2532
#3 0x00007ffff5c3339a in g_assertion_message_expr (domain=domain@entry=0x0, file=file@entry=0x7ffff76cba6e "../src/xml/simple-node.cpp", line=line@entry=326, func=func@entry=0x7ffff76cc060 <Inkscape::XML::SimpleNode::setAttributeImpl(char const*, char const*)::__PRETTY_FUNCTION__> "virtual void Inkscape::XML::SimpleNode::setAttributeImpl(const gchar*, const gchar*)", expr=expr@entry=0x7ffff76cbcd0 "std::none_of(name, name + strlen(name), [](char c) { return g_ascii_isspace(c); })") at ../../../../glib/gtestutils.c:2555
#4 0x00007ffff71bbc4f in Inkscape::XML::SimpleNode::setAttributeImpl(char const*, char const*) (this=0x555556584f00, name=<optimised out>, value=0x0) at ../src/xml/simple-node.cpp:326
#5 0x00007ffff6e6ffdb in Inkscape::XML::Node::setAttributeOrRemoveIfEmpty(Inkscape::Util::const_char_ptr, Inkscape::Util::const_char_ptr) (value=..., key=..., this=0x555556584fd8) at ../src/xml/node.h:218
#6 0x00007ffff6e6ffdb in Inkscape::UI::Dialog::AttrDialog::nameEdited(Glib::ustring const&, Glib::ustring const&) (this=0x555558c04850, path=..., name=...) at ../src/ui/dialog/attrdialog.cpp:614
What should have happened?
Inkscape shoud have test the validity of the name and doesn't allow to change the focus. And should not crash but complain.
Inkscape Version and Operating System:
- Inkscape Version: 1.0beta2 (a71adda4, 2019-12-05)-->
- Operating System: Windows 10 pro
- Operating System version: 18363
Edited by Nathan Lee