G
Green Mamba
Gast
Hallo,
ich habe ein Problem in einem Projekt von mir, und bin auf Valgrind gestoßen. Das Tool war mir bislang schon recht hilfreich, aber einige Dinge versteh ich momentan überhaupt nicht. Ich bekomme Seitenweise folgende Meldungen:
Das ist nicht unbedingt ein Problem, aber die Übersicht bei den Ausgaben leidet doch sehr darunter.
Dann zu meinem eigentlichen aktuellen Problem. Wie kann es sein, dass wenn ich eine im Header-File deklarierte integer-Variable im Construktor der Klasse mit 0 initialisiere, ich so eine Meldung von Valgrind bekomme?
Hier das Headerfile:
und der Konstruktor:
Jede der rot markierten Zeilen ruft eine Meldung in der Art wie oben hervor. Wäre für jede Hilfe dankbar.
Viele Grüße,
Green Mamba
ich habe ein Problem in einem Projekt von mir, und bin auf Valgrind gestoßen. Das Tool war mir bislang schon recht hilfreich, aber einige Dinge versteh ich momentan überhaupt nicht. Ich bekomme Seitenweise folgende Meldungen:
Code:
==7162== Conditional jump or move depends on uninitialised value(s)
==7162== at 0x1CE64257: (within /usr/lib/libGLcore.so.1.0.7174)
==7162==
==7162== Conditional jump or move depends on uninitialised value(s)
==7162== at 0x1CEF23B1: (within /usr/lib/libGLcore.so.1.0.7174)
==7162==
==7162== Conditional jump or move depends on uninitialised value(s)
==7162== at 0x1CEF24CF: (within /usr/lib/libGLcore.so.1.0.7174)
==7162==
==7162== Conditional jump or move depends on uninitialised value(s)
==7162== at 0x1CE9CC74: (within /usr/lib/libGLcore.so.1.0.7174)
==7162==
==7162== Conditional jump or move depends on uninitialised value(s)
==7162== at 0x1CE80583: (within /usr/lib/libGLcore.so.1.0.7174)
Dann zu meinem eigentlichen aktuellen Problem. Wie kann es sein, dass wenn ich eine im Header-File deklarierte integer-Variable im Construktor der Klasse mit 0 initialisiere, ich so eine Meldung von Valgrind bekomme?
Code:
==7162== Invalid write of size 4
==7162== at 0x8073164: TetraRenderer::TetraRenderer(SLFFEAProblemDataTetra*) (TetraRenderer.cpp:30)
==7162== by 0x80715C1: OfflineDeformDataAdvisorSLFFEA::genData(QString) (OfflineDeformDataAdvisorSLFFEA.cpp:49)
==7162== by 0x80604AE: FlexGUI::pushButtonLoad_released() (FlexGUI.qt.cpp:63)
==7162== by 0x805F9F7: FlexGUI::qt_invoke(int, QUObject*) (moc_FlexGUI.qt.cpp:88)
==7162== by 0x1C06D0ED: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D895: QObject::activate_signal(int) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3DF9D8: QAction::activated() (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3DFA3B: QAction::qt_emit(int, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D120: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D895: QObject::activate_signal(int) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3C502B: QButton::clicked() (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C1054C8: QButton::mouseReleaseEvent(QMouseEvent*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== Address 0x1E4488B8 is 4 bytes after a block of size 12 alloc'd
==7162== at 0x1B903458: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==7162== by 0x80715A9: OfflineDeformDataAdvisorSLFFEA::genData(QString) (OfflineDeformDataAdvisorSLFFEA.cpp:49)
==7162== by 0x80604AE: FlexGUI::pushButtonLoad_released() (FlexGUI.qt.cpp:63)
==7162== by 0x805F9F7: FlexGUI::qt_invoke(int, QUObject*) (moc_FlexGUI.qt.cpp:88)
==7162== by 0x1C06D0ED: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D895: QObject::activate_signal(int) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3DF9D8: QAction::activated() (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3DFA3B: QAction::qt_emit(int, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D120: QObject::activate_signal(QConnectionList*, QUObject*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C06D895: QObject::activate_signal(int) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C3C502B: QButton::clicked() (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
==7162== by 0x1C1054C8: QButton::mouseReleaseEvent(QMouseEvent*) (in /usr/lib/qt3/lib/libqt-mt.so.3.3.3)
Code:
class TetraRenderer
{
public:
//!Constructs a new Renderer with Data already set.
TetraRenderer (SLFFEAProblemDataTetra* data);
SoSeparator* getSceneGraph ();
static void partSelected (void * userdata, SoPath * path);
static void partDeselected (void * userdata, SoPath * path);
private:
void buildGeometry();
void makeTetra (int i);
SoSeparator* m_pRoot;
SoSelection* m_pSelection;
SLFFEAProblemDataTetra* m_pTetraGeometryData;
vector < int >* m_pHandleList;
int m_numHandleList;
int m_activeHandle;
};
und der Konstruktor:
Code:
TetraRenderer::TetraRenderer (ProblemDataTetra* data)
{
m_pTetraGeometryData=data;
m_pRoot = new SoSeparator;
m_pRoot->ref();
m_pSelection=new SoSelection;
m_pSelection->ref();
m_pRoot->addChild(m_pSelection);
m_pSelection->policy = SoSelection::TOGGLE;
m_pSelection->addSelectionCallback ( partSelected, this );
m_pSelection->addDeselectionCallback ( partDeselected, this );
[COLOR="Red"] m_numHandleList=0;
m_activeHandle=0;
m_pHandleList = new vector < int >;[/COLOR]
buildGeometry(); //for testing purposes only
}
Viele Grüße,
Green Mamba