Bug 241470 - nspluginviewer valgrind errors on exit
Summary: nspluginviewer valgrind errors on exit
Status: RESOLVED UNMAINTAINED
Alias: None
Product: konqueror
Classification: Applications
Component: nspluginviewer (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 21:22 UTC by Martin Koller
Modified: 2018-12-23 20:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2010-06-11 21:22:42 UTC
Version:           unspecified (using Devel) 
OS:                Linux

I was testing a NPAPI plugin and used the new env var VALGRIND_NSPLUGINVIEWER to run it inside valgrind (thanks for this feature!).

The plugin went fine, but on exit of nspluginviewer, I saw the following valgrind messages.

To me it seems like that:
KCleanUpGlobalStatic calls a function on exit, which runs  KConfig::sync(), which tries to create e QTextCodec, which was already destroyed before inside Qt's destructors.

Command: /home/KDE4/bin/nspluginviewer -dbusservice org.kde.nspluginviewer-31115
...


==31123== Invalid read of size 4
==31123==    at 0x5C3806F: QTextCodec::codecForMib(int) (qatomic_i386.h:132)
==31123==    by 0x5C3C2DC: QIconvCodec::QIconvCodec() (qiconvcodec.cpp:96)
==31123==    by 0x5C374C7: setup() (qtextcodec.cpp:761)
==31123==    by 0x5C37695: QTextCodec::codecForLocale() (qtextcodec.cpp:1188)
==31123==    by 0x5B49776: QString::toLocal8Bit() const (qstring.cpp:3510)
==31123==    by 0x5B87489: locale_encode(QString const&) (qfile.cpp:71)
==31123==    by 0x5B8722A: QFile::encodeName(QString const&) (qfile.cpp:482)
==31123==    by 0x5BD6463: QFSFileEnginePrivate::nativeInitFileName() (qfsfileengine_unix.cpp:203)
==31123==    by 0x5BCEF5D: QFSFileEngine::QFSFileEngine(QString const&) (qfsfileengine.cpp:215)
==31123==    by 0x5B786F4: QAbstractFileEngine::create(QString const&) (qabstractfileengine.cpp:203)
==31123==    by 0x5B7D834: QDirPrivate::initFileEngine(QString const&) (qdir.cpp:328)
==31123==    by 0x5B839BB: QDirPrivate::setPath(QString const&) (qdir.cpp:160)
==31123==    by 0x5B7E128: QDir::QDir(QString const&) (qdir.cpp:527)
==31123==    by 0x5849463: KConfigIniBackend::createEnclosing() (kconfigini.cpp:528)
==31123==    by 0x5832301: KConfig::sync() (kconfig.cpp:297)
==31123==    by 0x5831880: KConfig::~KConfig() (kconfig.cpp:194)
==31123==    by 0x58AC469: KDebugPrivate::~KDebugPrivate() (kdebug.cpp:247)
==31123==    by 0x58AAE21: ._160::destroy() (kdebug.cpp:671)
==31123==    by 0x584D652: KCleanUpGlobalStatic::~KCleanUpGlobalStatic() (kglobal.h:62)
==31123==    by 0x5F99110: ??? (in /lib/libc-2.10.1.so)
==31123==    by 0x5F9916C: exit (in /lib/libc-2.10.1.so)
==31123==    by 0x5F81AD5: (below main) (in /lib/libc-2.10.1.so)
==31123==  Address 0x66b0110 is 8 bytes inside a block of size 32 free'd
==31123==    at 0x40265BD: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==31123==    by 0x5B1C0D6: QHashData::free_helper(void (*)(QHashData::Node*)) (qhash.cpp:282)
==31123==    by 0x5C39143: QHash<int, QTextCodec*>::~QHash() (qhash.h:567)
==31123==    by 0x5F99110: ??? (in /lib/libc-2.10.1.so)
==31123==    by 0x5F9916C: exit (in /lib/libc-2.10.1.so)
==31123==    by 0x5F81AD5: (below main) (in /lib/libc-2.10.1.so)


Reproducible: Didn't try
Comment 1 Maksim Orlovich 2010-06-11 23:17:42 UTC
What locale are you using? And what Qt? I can't find use of QHash in the version I have (kde-qt @ 4.6.2)

This sounds like something that would potentially affect all KDE apps, too..
Comment 2 Martin Koller 2010-06-11 23:58:23 UTC
That was with LANG=de_DE.UTF-8
Qt is 4.6.3 (libqt4-4.6.3+4.6.20100427-1.4.i586) on openSuse 11.2
Comment 3 Maksim Orlovich 2010-06-12 00:22:28 UTC
Looks like it's new in 4.6.3, indeed:
http://qt.gitorious.org/qt/qt/blobs/76353f177cd84327c692ea31ec644df683643194/src/corelib/codecs/qtextcodec.cpp#line1036

(4.6.2 just has the for loop)

plus:
http://qt.gitorious.org/qt/qt/commit/b3b7796178f6a94fc46ef827b01a46420dae5a50

well, at least I know who to bug.
Comment 4 Martin Koller 2018-12-23 20:28:57 UTC
closing as NPAPI is no longer relevant