Nux

Conditional jump or move depends on uninitialised value(s): nux::CreateTexture2DFromPixbuf(_GdkPixbuf*, bool) (GLTextureResourceManager.cpp:99)

Bug #988880 reported by Sebastien Bacher
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Nux
Invalid
Low
Unassigned
gtk+3.0 (Ubuntu)
New
Undecided
Unassigned
nux (Ubuntu)
Invalid
Low
Unassigned

Bug Description

From Nux 3.0:
==2781== Conditional jump or move depends on uninitialised value(s)
==2781== at 0x11B04FAF: nux::CreateTexture2DFromPixbuf(_GdkPixbuf*, bool) (GLTextureResourceManager.cpp:99)
==2781== by 0x110BF7B1: unity::dash::(anonymous namespace)::LazyLoadTexture::LoadTexture() (DashStyle.cpp:2362)
==2781== by 0x110BF934: unity::dash::(anonymous namespace)::LazyLoadTexture::texture() (DashStyle.cpp:2345)
==2781== by 0x110E9210: unity::SearchBarSpinner::SearchBarSpinner() (SearchBarSpinner.cpp:42)
==2781== by 0x110E50A8: unity::SearchBar::Init() (SearchBar.cpp:154)
==2781== by 0x110E6EEA: unity::SearchBar::SearchBar(bool, char const*, int) (SearchBar.cpp:135)
==2781== by 0x1107130D: unity::hud::View::SetupViews() (HudView.cpp:375)
==2781== by 0x110719BC: unity::hud::View::View() (HudView.cpp:75)
==2781== by 0x10F92949: _ZNSt17_Function_handlerIFPN5unity3hud12AbstractViewEvEZNS1_10ControllerC1ERKSt8functionIS4_EEd_NS1_UlvE_EE9_M_invokeERKSt9_Any_data (HudController.h:47)
==2781== by 0x11067DC0: unity::hud::Controller::SetupHudView() (functional:2161)
==2781== by 0x110685F7: unity::hud::Controller::EnsureHud() (HudController.cpp:154)
==2781== by 0x1106975A: unity::hud::Controller::Controller(std::function<unity::hud::AbstractView* ()()> const&) (HudController.cpp:85)
==2781==

ORIGINAL DESCRIPTION:
Running the current staging version (SRU candidate for precise) under valgrind it's a bit noisy with warning, those come from unity:

==4260== Conditional jump or move depends on uninitialised value(s)
==4260== at 0x99D9683: nux::CreateTexture2DFromPixbuf(_GdkPixbuf*, bool) (GLTextureResourceManager.cpp:95)
==4260== by 0x9E7F487: unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme(_GtkIconTheme*, std::string const&, int, bool, bool) (LauncherIcon.cpp:423)

==4260== Conditional jump or move depends on uninitialised value(s)
==4260== at 0x9E7EA59: unity::launcher::LauncherIcon::ColorForIcon(_GdkPixbuf*, nux::color::Color&, nux::color::Color&) (LauncherIcon.cpp:277)
==4260== by 0x9E7F4CE: unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme(_GtkIconTheme*, std::string const&, int, bool, bool) (LauncherIcon.cpp:426)

==4260== Conditional jump or move depends on uninitialised value(s)
==4260== at 0x9A82AA8: nux::color::RGBtoHSV(float, float, float, float&, float&, float&) (Color.cpp:217)
==4260== by 0x9A831E0: nux::color::HueSaturationValue::HueSaturationValue(nux::color::RedGreenBlue const&) (Color.cpp:486)
==4260== by 0x9E7EAC9: unity::launcher::LauncherIcon::ColorForIcon(_GdkPixbuf*, nux::color::Color&, nux::color::Color&) (LauncherIcon.cpp:291)
==4260== by 0x9E7F4CE: unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme(_GtkIconTheme*, std::string const&, int, bool, bool) (LauncherIcon.cpp:426)

Changed in unity (Ubuntu):
status: New → Triaged
Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
importance: Undecided → Low
Changed in unity:
importance: Undecided → Low
summary: Conditional jump or move depends on uninitialised value(s)
+ (unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme)
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: Conditional jump or move depends on uninitialised value(s) (unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme)

Thanks seb128. I noticed these a while ago but never got around to logging them.

I've increased the importance to Medium. Unpredictable jumps/moves are likely to cause noticeably unpredictable behaviour, or worse.

Changed in unity:
importance: Low → Medium
Changed in unity (Ubuntu):
importance: Low → Medium
Changed in unity:
milestone: none → 5.14.0
Changed in nux (Ubuntu):
importance: Undecided → Medium
Changed in nux:
importance: Undecided → Medium
Revision history for this message
Tim Penhey (thumper) wrote :

These all come from a variable created on the stack in /usr/lib/x86_64-linux-gnu/libpixman-1.so.0.24.4

Investigation continuing.

Revision history for this message
Tim Penhey (thumper) wrote :

The source of the buffer with uninitialized memory is
  gdk_pixbuf_get_pixels(pixbuf);
This shows up in valgrind as
  Uninitialised value was created by a stack allocation
    at 0x10EA312D: general_composite_rect (pixman-general.c:105)

This is an large buffer allocated on the stack to avoid dynamic allocation for small images. It is here that I'm out of my depth, and we need a simple test case.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like it might just need a memset to zero. That will be fast no matter how big the stack frame is.

Changed in unity:
milestone: 5.14.0 → 5.16.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In Nux 1.0, the error is at GLTextureResourceManager.cpp:95
In 2,.0/3.0 it is now at GLTextureResourceManager.cpp:99 ...

From Nux 3.0 and Unity 6.0 today:

==2781== Conditional jump or move depends on uninitialised value(s)
==2781== at 0x11B04FAF: nux::CreateTexture2DFromPixbuf(_GdkPixbuf*, bool) (GLTextureResourceManager.cpp:99)
==2781== by 0x110BF7B1: unity::dash::(anonymous namespace)::LazyLoadTexture::LoadTexture() (DashStyle.cpp:2362)
==2781== by 0x110BF934: unity::dash::(anonymous namespace)::LazyLoadTexture::texture() (DashStyle.cpp:2345)
==2781== by 0x110E9210: unity::SearchBarSpinner::SearchBarSpinner() (SearchBarSpinner.cpp:42)
==2781== by 0x110E50A8: unity::SearchBar::Init() (SearchBar.cpp:154)
==2781== by 0x110E6EEA: unity::SearchBar::SearchBar(bool, char const*, int) (SearchBar.cpp:135)
==2781== by 0x1107130D: unity::hud::View::SetupViews() (HudView.cpp:375)
==2781== by 0x110719BC: unity::hud::View::View() (HudView.cpp:75)
==2781== by 0x10F92949: _ZNSt17_Function_handlerIFPN5unity3hud12AbstractViewEvEZNS1_10ControllerC1ERKSt8functionIS4_EEd_NS1_UlvE_EE9_M_invokeERKSt9_Any_data (HudController.h:47)
==2781== by 0x11067DC0: unity::hud::Controller::SetupHudView() (functional:2161)
==2781== by 0x110685F7: unity::hud::Controller::EnsureHud() (HudController.cpp:154)
==2781== by 0x1106975A: unity::hud::Controller::Controller(std::function<unity::hud::AbstractView* ()()> const&) (HudController.cpp:85)
==2781==

no longer affects: unity
no longer affects: unity (Ubuntu)
summary: - Conditional jump or move depends on uninitialised value(s)
- (unity::launcher::LauncherIcon::TextureFromSpecificGtkTheme)
+ Conditional jump or move depends on uninitialised value(s):
+ nux::CreateTexture2DFromPixbuf(_GdkPixbuf*, bool)
+ (GLTextureResourceManager.cpp:99)
description: updated
Changed in nux:
status: New → Confirmed
Changed in nux (Ubuntu):
status: New → Confirmed
Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks like all the errors are coming from pbuf returned from gtk_icon_info_load_icon:
    glib::Object<GdkPixbuf> pbuf(gtk_icon_info_load_icon(info, &error));
in
    LauncherIcon::TextureFromSpecificGtkTheme

Changed in unity:
status: Confirmed → Invalid
status: Invalid → Confirmed
Changed in nux:
status: Confirmed → Invalid
Changed in nux (Ubuntu):
status: Confirmed → Invalid
Changed in unity:
milestone: none → 7.0.0
Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.0 → 7.0.1
Stephen M. Webb (bregma)
Changed in unity:
importance: Undecided → High
Changed in unity (Ubuntu):
importance: Undecided → High
Stephen M. Webb (bregma)
Changed in unity:
milestone: 7.0.1 → 7.1.0
Stephen M. Webb (bregma)
no longer affects: unity
no longer affects: unity (Ubuntu)
Changed in nux:
importance: Medium → Low
Changed in nux (Ubuntu):
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.