Bug 37610

Summary: [Qt] Syntax checking in the QtScript cause a memory leak.
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: JavaScriptCoreAssignee: Jędrzej Nowacki <jedrzej.nowacki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jedrzej.nowacki, kenneth, kent.hansen
Priority: P1 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 31863    
Attachments:
Description Flags
Fix v1 none

Jędrzej Nowacki
Reported 2010-04-14 14:37:33 PDT
Valgrind report few memory leaks in tst_QScriptEngine, connected with syntax checking and QScriptSyntaxCheckResultPrivate. ==7133== 662 (384 direct, 278 indirect) bytes in 16 blocks are definitely lost in loss record 227 of 265 ==7133== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==7133== by 0x50BCB58: WTF::fastMalloc(unsigned long) (FastMalloc.cpp:249) ==7133== by 0x50072FD: WTF::FastAllocBase::operator new(unsigned long) (FastAllocBase.h:96) ==7133== by 0x5020853: OpaqueJSString::create(unsigned short const*, unsigned int) (OpaqueJSString.h:45) ==7133== by 0x50204B3: JSStringCreateWithUTF8CString (JSStringRef.cpp:50) ==7133== by 0x4FFFF34: QScriptConverter::toString(QString const&) (qscriptconverter_p.h:59) ==7133== by 0x5000B38: QScriptEnginePrivate::checkSyntax(QString const&) (qscriptengine_p.cpp:45) ==7133== by 0x4FFFB0E: QScriptEngine::checkSyntax(QString const&) (qscriptengine.cpp:60) ==7133== by 0x407F5E: tst_QScriptEngine::checkSyntax() (tst_qscriptengine.cpp:280) ==7133== by 0x409C55: tst_QScriptEngine::qt_metacall(QMetaObject::Call, int, void**) (tst_qscriptengine.moc:92) ==7133== by 0x64BFF19: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (in /usr/lib/libQtCore.so.4.5.3) ==7133== by 0x64C070E: QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) (in /usr/lib/libQtCore.so.4.5.3) ==6809== 256 (192 direct, 64 indirect) bytes in 8 blocks are definitely lost in loss record 200 of 265 ==6809== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==6809== by 0x50BCB50: WTF::fastMalloc(unsigned long) (FastMalloc.cpp:249) ==6809== by 0x50072F5: WTF::FastAllocBase::operator new(unsigned long) (FastAllocBase.h:96) ==6809== by 0x502084B: OpaqueJSString::create(unsigned short const*, unsigned int) (OpaqueJSString.h:45) ==6809== by 0x50204AB: JSStringCreateWithUTF8CString (JSStringRef.cpp:50) ==6809== by 0x50026C9: QScriptConverter::toString(char const*) (qscriptconverter_p.h:63) ==6809== by 0x5006A1C: QScriptSyntaxCheckResultPrivate::errorLineNumber() const (qscriptsyntaxcheckresult.cpp:140) ==6809== by 0x5006807: QScriptSyntaxCheckResult::errorLineNumber() const (qscriptsyntaxcheckresult.cpp:94) ==6809== by 0x408243: tst_QScriptEngine::checkSyntax() (tst_qscriptengine.cpp:293) ==6809== by 0x409C55: tst_QScriptEngine::qt_metacall(QMetaObject::Call, int, void**) (tst_qscriptengine.moc:92) ==6809== by 0x64BFF19: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (in /usr/lib/libQtCore.so.4.5.3) ==6809== by 0x64C070E: QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) (in /usr/lib/libQtCore.so.4.5.3) ==6809== 216 (72 direct, 144 indirect) bytes in 3 blocks are definitely lost in loss record 192 of 265 ==6809== at 0x4C221A7: malloc (vg_replace_malloc.c:195) ==6809== by 0x50BCB50: WTF::fastMalloc(unsigned long) (FastMalloc.cpp:249) ==6809== by 0x50072F5: WTF::FastAllocBase::operator new(unsigned long) (FastAllocBase.h:96) ==6809== by 0x5023CE7: OpaqueJSString::create(JSC::UString const&) (OpaqueJSString.cpp:38) ==6809== by 0x502202D: JSValueToStringCopy (JSValueRef.cpp:284) ==6809== by 0x50069C3: QScriptSyntaxCheckResultPrivate::errorMessage() const (qscriptsyntaxcheckresult.cpp:128) ==6809== by 0x5006857: QScriptSyntaxCheckResult::errorMessage() const (qscriptsyntaxcheckresult.cpp:116) ==6809== by 0x408551: tst_QScriptEngine::checkSyntax() (tst_qscriptengine.cpp:305) ==6809== by 0x409C55: tst_QScriptEngine::qt_metacall(QMetaObject::Call, int, void**) (tst_qscriptengine.moc:92) ==6809== by 0x64BFF19: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (in /usr/lib/libQtCore.so.4.5.3) ==6809== by 0x64C070E: QMetaObject::invokeMethod(QObject*, char const*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) (in /usr/lib/libQtCore.so.4.5.3) ==6809== by 0x554405B: ??? (in /usr/lib/libQtTest.so.4.5.3)
Attachments
Fix v1 (3.50 KB, patch)
2010-04-14 15:17 PDT, Jędrzej Nowacki
no flags
Jędrzej Nowacki
Comment 1 2010-04-14 15:17:25 PDT
WebKit Commit Bot
Comment 2 2010-04-14 20:07:58 PDT
Comment on attachment 53373 [details] Fix v1 Clearing flags on attachment: 53373 Committed r57626: <http://trac.webkit.org/changeset/57626>
WebKit Commit Bot
Comment 3 2010-04-14 20:08:03 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.