valgrind reported uninitialized value issues

Bug #1298603 reported by David Mathog on 2014-03-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
David Mathog

Bug Description

As reported here

http://sourceforge.net/p/inkscape/mailman/message/32149230/

valgrind has been showing

   Conditional jump or move depends on uninitialised value(s)

messages on tests like this:
  valgrind -v --leak-check=yes --leak-resolution=high --num-callers=15 --show-reachable=yes --suppressions=./wcslen_sse2.supp --track-origins=yes src/inkscape --file /tmp/small.emf >/tmp/vgA.log 2>&1

The patch (next message) resolves 3 of these. Two are in style.cpp and one is in sp-clippath.cpp. Note that swapping the bit order in SPILengthOrNormal so that the first 3 fields matched those in SPILength resolved the vast majority of the style.cpp warnings. That issue was mentioned here:

  http://sourceforge.net/p/inkscape/mailman/message/32154613/

before I discovered that making the field order switch resolved the uninitialized variable warnings.

Even after the patch there is still one remaining warning of this type coming out of Inkscape code (and a few more from libraries Inkscape calls). The one Inkscape one is:

==9481== Conditional jump or move depends on uninitialised value(s)
==9481== at 0x551D121: ??? (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4)
==9481== by 0x5524FE4: g_signal_emit_valist (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4)
==9481== by 0x5525442: g_signal_emit (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4)
==9481== by 0x46CA2B6: ??? (in /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==9481== by 0x46E194F: gtk_window_propagate_key_event (in /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==9481== by 0x46E46B3: ??? (in /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==9481== by 0x42A5724: Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) (in /usr/lib/i386-linux-gnu/libgtkmm-2.4.so.1.1.0)
==9481== by 0x45908A1: ??? (in /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0.2400.10)
==9481== by 0x945D397: ???
==9481== Uninitialised value was created by a heap allocation
==9481== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==9481== by 0x8413A00: SPDesktopWidget::createInstance(SPNamedView*) (gc-core.h:74)
==9481== by 0x8413E1F: sp_desktop_widget_new(SPNamedView*) (desktop-widget.cpp:1656)
==9481== by 0x80FFD68: sp_file_open(Glib::ustring const&, Inkscape::Extension::Extension*, bool, bool) (file.cpp:299)
==9481== by 0x80AD85D: sp_main_gui(int, char const**) (main.cpp:1087)
==9481== by 0x808BDB0: main (main.cpp:812)

David Mathog (mathog) wrote :
David Mathog (mathog) wrote :
David Mathog (mathog) wrote :

The one remaining problem of this type wholly within Inkscape is found at around line 580 in the attached file.

jazzynico (jazzynico) on 2014-05-02
tags: added: code-design
Changed in inkscape:
status: New → In Progress
assignee: nobody → David Mathog (mathog)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers