Revision 10629, compiling with GCC 4.2.1 on Mac OS X 10.5.8 (i386):
1) warning during compilation:
CXX xml/repr-css.o xml/repr-css.cpp: In function ‘gchar* sp_repr_css_write_string(SPCSSAttr*)’: xml/repr-css.cpp:235: warning: cannot pass objects of non-POD type ‘const class Inkscape::Util::ptr_shared<char>’ through ‘...’; call will abort at runtime xml/repr-css.cpp:235: warning: format ‘%s’ expects type ‘char*’, but argument 5 has type ‘int’
2) runtime error on launch (with new preferences file):
Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand. sp_repr_css_write_string (css=0x5f74f70) at xml/repr-css.cpp:235 235 g_warning("sp_repr_css_write_string: %s %s", g_quark_to_string(iter->key), iter->value );
(full backtrace attached)
3) After changing line 235 to a static string:
- launching Inkscape (with new prefs) reaches the g_warning() (on line 235) 133 times until the new document window is finally displayed - drawing a simple shape (rect) or a straight line (pencil tool) executes it 7 times, - changing the stroke width (via style indicator in the status bar) executes it 14 times
-> I have reverted 'src/xml/repr-css.cpp' to r10628 for now.
Questions: - Is this error related to using a rather old (or outdated) version of GCC on Mac OS X 10.5.8? (I don't have the option to use a more recent version for building Inkscape due to apparent ABI mismatches since all dependencies get built with Apple's GCC 4.0 (default compiler on 10.5.8)) - Is it expected that the warning on line 235 is reached so often while doing basic stuff like opening a new document window or drawing a simple object with default style attributes?
~suv
(gdb) r Starting program: /Volumes/green/mp-inkscape/src/inkscape-trunk/Build/bin/inkscape Reading symbols for shared libraries ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.......................................................................... done Xlib: extension "RANDR" missing on display "/tmp/launch-EhMYaX/:0". Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done Reading symbols for shared libraries . done
Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand. sp_repr_css_write_string (css=0x5f74f70) at xml/repr-css.cpp:235 235 g_warning("sp_repr_css_write_string: %s %s", g_quark_to_string(iter->key), iter->value ); (gdb) bt #0 sp_repr_css_write_string (css=0x5f74f70) at xml/repr-css.cpp:235 #1 0x0011ce3e in Inkscape::Preferences::mergeStyle (this=0x4448960, pref_path=@0xbfffe320, style=0x5f6d070) at preferences.cpp:501 #2 0x0053629c in sp_text_lineheight_value_changed (adj=0x725ca00, tbl=0x724bb48) at widgets/toolbox.cpp:6951 #3 0x04149f59 in g_closure_invoke () #4 0x0415c0d3 in signal_emit_unlocked_R () #5 0x0415d761 in g_signal_emit_valist () #6 0x0415da69 in g_signal_emit () #7 0x025fb38a in gtk_adjustment_value_changed () #8 0x02746bda in gtk_spin_button_set_property () #9 0x0414b7bb in object_set_property () #10 0x04151d6d in g_object_newv () #11 0x02a29719 in Glib::Object::Object () #12 0x0215962e in Gtk::Object::Object () #13 0x021c839e in Gtk::Widget::Widget () #14 0x021287aa in Gtk::Entry::Entry () #15 0x02187067 in Gtk::SpinButton::SpinButton () #16 0x0034c0df in Inkscape::UI::Widget::SpinButton::SpinButton (this=0x76120b0, adjustment=@0x7612090, climb_rate=0.10000000000000001, digits=2) at spinbutton.h:40 #17 0x0054e954 in createCustomSlider (adjustment=0x725ca00, climbRate=0.10000000000000001, digits=2) at widgets/toolbox.cpp:1053 #18 0x0007c352 in create_tool_item (action=0x7262608) at ege-adjustment-action.cpp:839 #19 0x025f5b28 in gtk_action_create_tool_item () #20 0x027f2b6c in update_node () #21 0x027f1d66 in update_node () #22 0x027f1d66 in update_node () #23 0x027f2daf in do_updates () #24 0x027f2e62 in gtk_ui_manager_real_get_widget () #25 0x00557f2a in setup_aux_toolbox (toolbox=0x45ff328, desktop=0x5f6fd80) at widgets/toolbox.cpp:1998 #26 0x00542365 in Inkscape::UI::ToolboxFactory::setToolboxDesktop (toolbox=0x45ff328, desktop=0x5f6fd80) at widgets/toolbox.cpp:1734 #27 0x0058838d in Inkscape::UI::UXManagerImpl::connectToDesktop (this=0x6f120a0, toolboxes=@0xbfffee84, desktop=0x5f6fd80) at ui/uxmanager.cpp:230 #28 0x004d3afb in SPDesktopWidget::createInstance (namedview=0x4a14600) at widgets/desktop-widget.cpp:1483 #29 0x004d3b49 in sp_desktop_widget_new (namedview=0x4a14600) at widgets/desktop-widget.cpp:1432 #30 0x000947d9 in sp_file_new (templ=@0xbfffefcc) at file.cpp:126 #31 0x00094b1c in sp_file_new_default () at file.cpp:178 #32 0x0000840b in sp_main_gui (argc=1, argv=0xbffff0fc) at main.cpp:974 #33 0x00008c8a in main (argc=1, argv=0xbffff0fc) at main.cpp:709 (gdb)