EnvironmentManager crash

Hamish Rodda rodda at kde.org
Tue Dec 18 02:45:35 UTC 2007


Hi,

It seems with the latest environment manager changes, I'm now experiencing 
crashes.  To reproduce this, open kdevplatform + kdevelop as projects, enable 
parsing of all files, and restart kdevelop.

I had a look at the code, is it using a sorted std::set?  I don't think Qt has 
a direct equivalent, but we could use QSet and then apply a sorting operator 
to the list, or use QMap which is ordered and just use a dummy value.

==5675==
==5675== Thread 5:
==5675== Use of uninitialised value of size 8
==5675==    at 0x1F243B6A: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:841)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==
==5675== Use of uninitialised value of size 8
==5675==    at 0x1F243B7D: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:841)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==
==5675== Use of uninitialised value of size 8
==5675==    at 0x1F243BB1: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:842)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==
==5675== Use of uninitialised value of size 8
==5675==    at 0x1F243BC4: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:842)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==
==5675== Conditional jump or move depends on uninitialised value(s)
==5675==    at 0x1F243AD5: QHashNode<KDevelop::HashedString, 
rpp::pp_macro*>::same_key(unsigned, KDevelop::HashedString const&) 
(qhash.h:200)
==5675==    by 0x1F243BD2: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:842)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==
==5675== Use of uninitialised value of size 8
==5675==    at 0x1F243BA6: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:843)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==
==5675== Invalid read of size 4
==5675==    at 0xCD0FA70: KDevelop::HashedString::hash() const 
(hashedstring.h:52)
==5675==    by 0xCD0FA8A: KDevelop::qHash(KDevelop::HashedString const&) 
(hashedstring.h:83)
==5675==    by 0x1F243B1D: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::findNode(KDevelop::HashedString const&, unsigned*) const 
(qhash.h:837)
==5675==    by 0x1F243C35: QHash<KDevelop::HashedString, 
rpp::pp_macro*>::contains(KDevelop::HashedString const&) const (qhash.h:829)
==5675==    by 0x1F24239A: 
rpp::Environment::retrieveStoredMacro(KDevelop::HashedString const&) const 
(pp-environment.cpp:212)
==5675==    by 0x1EFAF8DE: 
Cpp::EnvironmentManager::lexedFile(KDevelop::HashedString const&, 
rpp::Environment const*, KDevelop::ParsingEnvironmentFileAcceptor*) 
(environmentmanager.cpp:151)
==5675==    by 0x1EFAFC3F: 
Cpp::EnvironmentManager::find(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, 
KDevelop::ParsingEnvironmentFileAcceptor*) (environmentmanager.cpp:455)
==5675==    by 0xCF42FF1: 
KDevelop::DUChain::chainForDocument(KDevelop::HashedString const&, 
KDevelop::ParsingEnvironment const*, KDevelop::TopDUContext::Flags) const 
(duchain.cpp:305)
==5675==    by 0x1ED0A906: PreprocessJob::headerSectionEnded() 
(preprocessjob.cpp:262)
==5675==    by 0x1ED0BE5F: PreprocessJob::run() (preprocessjob.cpp:222)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)
==5675==  Address 0x2032fc28 is 4,040 bytes inside a block of size 40,960 
free'd
==5675==    at 0x4C21F3B: free (vg_replace_malloc.c:323)
==5675==    by 0x1F475437: TokenStream::~TokenStream() (lexer.h:83)
==5675==    by 0x1F47501F: ParseSession::~ParseSession() (parsesession.cpp:40)
==5675==    by 0x1ED04EA9: CPPParseJob::~CPPParseJob() (cppparsejob.cpp:150)
==5675==    by 0x1ED0A552: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:358)
==5675==    by 0x1F23F55A: rpp::pp::handle_include(bool, rpp::Stream&, 
rpp::Stream&) (pp-engine.cpp:306)
==5675==    by 0x1F23F67A: rpp::pp::handle_directive(QString const&, 
rpp::Stream&, rpp::Stream&) (pp-engine.cpp:240)
==5675==    by 0x1F23F97F: rpp::pp::operator()(rpp::Stream&, rpp::Stream&) 
(pp-engine.cpp:370)
==5675==    by 0x1F240207: rpp::pp::processFile(QString const&, 
rpp::pp::StringType, QString const&) (pp-engine.cpp:104)
==5675==    by 0x1ED0BB3B: PreprocessJob::run() (preprocessjob.cpp:206)
==5675==    by 0x1ED05238: CPPParseJob::parseForeground() 
(cppparsejob.cpp:101)
==5675==    by 0x1ED0A4EC: PreprocessJob::sourceNeeded(QString&, 
rpp::Preprocessor::IncludeType, int, bool) (preprocessjob.cpp:354)

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20071218/f69cc59d/attachment.sig>


More information about the KDevelop-devel mailing list