1

Do you have any theory how to debug this potentially problematic memory access pattern? I have hunch it might be related to a certain heisen-bug I'm experiencing, but I can't seem to pinpoint it.

it's a snippet of a run of debug build, under valgrind, with --track-origins=yes, --leak-check=full

How could I be misusing Qt's Gui lib so that it manifests itself in the following manner?

==15169== Conditional jump or move depends on uninitialised value(s)
==15169==    at 0x99CD8AA: XSetCommand (in /usr/lib64/libX11.so.6.3.0)
==15169==    by 0x99D1FFE: XSetWMProperties (in /usr/lib64/libX11.so.6.3.0)
==15169==    by 0x7280853: QWidgetPrivate::create_sys(unsigned long, bool, bool) (in /usr/lib64/qt4/libQtGui.so.4.8.3)
==15169==    by 0x723550F: QWidget::create(unsigned long, bool, bool) (in /usr/lib64/qt4/libQtGui.so.4.8.3)
==15169==    by 0x723F3E1: QWidget::setVisible(bool) (in /usr/lib64/qt4/libQtGui.so.4.8.3)
==15169==    by 0x40DFE5: QWidget::show() (qwidget.h:494)
==15169==    by 0x40DA5D: SYSApplication::on_start() (sysapplication.cpp:55)
==15169==    by 0x40D5BC: main (main.cpp:8)
==15169==  Uninitialised value was created by a stack allocation
==15169==    at 0x723F0E0: QWidget::setVisible(bool) (in /usr/lib64/qt4/libQtGui.so.4.8.3)
==15169== 
qdot
  • 6,195
  • 5
  • 44
  • 95

1 Answers1

0

Check what variables your reference at main.cpp:8 and sysapplication.cpp:55. If you're at fault then one of the variables in use here is at fault.

Also, check out Uninitialised value was created by a stack allocation at QWidget::setVisible - Do you ever call setVisible? If so, what is the value of the parameter?

Important note: Valgrind will keep track of memory that is copied around. If you have:

int i;       // 1
int j = i;   // 2
int k = j;   // 3
if (k) {}    // 4

then Valgrind will throw this error at line 4 even though line 1 is at the source of the error.

It's also possible that Qt is failing to initialize something. Plenty of libraries throw a lot of worrying errors when run under Valgrind.

Bill
  • 14,257
  • 4
  • 43
  • 55
  • My working theory is that I'm using QStackedWidget as a top-most window widget.. and then I'm adding a subwidget to it, and telling the QStackedWidget to appear. – qdot Sep 26 '12 at 22:48