Hi wysota, yes I realized that when it crashes this time, but I don't know what do I have to fix exactly.
Valgrind prints some things like this on the console:
==2848== Invalid write of size 4
==2848== at 0x435CA6E3: pthread_mutex_init (in /usr/lib/libpthread-2.16.so)
==2848== by 0x808A450: TLib::CSection::CSection() (Section.cpp:11)
==2848== by 0x80773D6: CClass1::CClass1() (Class1.cpp:15)
==2848== by 0x807C642: CClass2::CClass2() (Class2.cpp:21)
==2848== by 0x807C800: CClass2::Initialize() (Class1.cpp:51)
==2848== by 0x805A346
: BaseWizard
::BaseWizard(QWidget*) (basewizard.
cpp:49) ==2848== by 0x80523A2: main (main.cpp:26)
==2848== Address 0x5b09f14 is 0 bytes after a block of size 292 alloc'd
==2848== at 0x4008AAD: operator new(unsigned int) (vg_replace_malloc.c:292)
==2848== by 0x807C638: CClass2::CClass2() (Class2.cpp:21)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
==2848== Invalid read of size 4
==2848== at 0x438EBA44: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBC32: std::string::_M_replace_safe(unsigned int, unsigned int, char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBCDB: std::string::assign(char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBF16: std::string::operator=(char const*) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x80767B4: CClass3::CClass3() (Class3.cpp:39)
==2848== by 0x807C6E2: CClass2::CClass2() (Class2.cpp:34)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
==2848== Address 0x5b15efc is 4 bytes after a block of size 48 alloc'd
==2848== at 0x4008AAD: operator new(unsigned int) (vg_replace_malloc.c:292)
==2848== by 0x807C6D8: CClass2::CClass2() (Class2.cpp:34)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346
: BaseWizard
::BaseWizard(QWidget*) (basewizard.
cpp:49) ==2848== by 0x80523A2: main (main.cpp:26)
==2848== Invalid write of size 4
==2848== at 0x435CA6E3: pthread_mutex_init (in /usr/lib/libpthread-2.16.so)
==2848== by 0x808A450: TLib::CSection::CSection() (Section.cpp:11)
==2848== by 0x80773D6: CClass1::CClass1() (Class1.cpp:15)
==2848== by 0x807C642: CClass2::CClass2() (Class2.cpp:21)
==2848== by 0x807C800: CClass2::Initialize() (Class1.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
==2848== Address 0x5b09f14 is 0 bytes after a block of size 292 alloc'd
==2848== at 0x4008AAD: operator new(unsigned int) (vg_replace_malloc.c:292)
==2848== by 0x807C638: CClass2::CClass2() (Class2.cpp:21)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
==2848== Invalid read of size 4
==2848== at 0x438EBA44: std::string::_M_mutate(unsigned int, unsigned int, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBC32: std::string::_M_replace_safe(unsigned int, unsigned int, char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBCDB: std::string::assign(char const*, unsigned int) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x438EBF16: std::string::operator=(char const*) (in /usr/lib/libstdc++.so.6.0.17)
==2848== by 0x80767B4: CClass3::CClass3() (Class3.cpp:39)
==2848== by 0x807C6E2: CClass2::CClass2() (Class2.cpp:34)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
==2848== Address 0x5b15efc is 4 bytes after a block of size 48 alloc'd
==2848== at 0x4008AAD: operator new(unsigned int) (vg_replace_malloc.c:292)
==2848== by 0x807C6D8: CClass2::CClass2() (Class2.cpp:34)
==2848== by 0x807C800: CClass2::Initialize() (Class2.cpp:51)
==2848== by 0x805A346: BaseWizard::BaseWizard(QWidget*) (basewizard.cpp:49)
==2848== by 0x80523A2: main (main.cpp:26)
To copy to clipboard, switch view to plain text mode
There are like 5 times more that information and then it throws the program. But if I run it without valdring then it says the glibc malloc() memory corruption.
note: About that references... main and basewizard are my classes on Qt (main.cppp and basewizard is the QWizard), and Class1,2,3 and CSection are from the external libraries
Bookmarks