BR ran valgrind on qtbase and there were many errors. Some might be fixed already in git, and many are seemingly internal to Qt and the GTK+ stack (how is GTK involved?). But these probably need to be addressed:
==2322== 16 bytes in 1 blocks are definitely lost in loss record 392 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x101B4A6E: RDynamicQObject::createSlot(char const*) (packages/tests-vg/qtbase/src/RDynamicQObject.cpp:26)
==2322== by 0x101B3988: DynamicQObject::connectDynamicSlot(QObject*, char const*, char const*) (packages/tests-vg/qtbase/src/dynamicqobject.cpp:42)
==2322== by 0x101B2ED5: qt_qconnect (packages/tests-vg/qtbase/src/connect.cpp:21)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==2322== by 0x4C2DCE: Rf_eval (svn/R-devel/src/main/eval.c:655)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
==2322== by 0x4C2A23: Rf_eval (svn/R-devel/src/main/eval.c:674)
==2322== by 0x4C6075: do_set (svn/R-devel/src/main/eval.c:2034)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
Cause: DynamicQObject seems to be missing a destructor...
==2322== 24 bytes in 1 blocks are definitely lost in loss record 596 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x1023C55A: registerSmokeModule (packages/tests-vg/qtbase/src/module.cpp:400)
==2322== by 0x1023C5E5: init_smoke() (packages/tests-vg/qtbase/src/module.cpp:407)
==2322== by 0x1019BEB8: R_init_qtbase (packages/tests-vg/qtbase/src/init.cpp:140)
==2322== by 0x41BF7D: AddDLL (svn/R-devel/src/main/Rdynload.c:569)
==2322== by 0x41C1F6: do_dynload (svn/R-devel/src/main/Rdynload.c:884)
==2322== by 0x4B4210: bcEval (svn/R-devel/src/main/eval.c:5398)
==2322== by 0x4C2A6F: Rf_eval (svn/R-devel/src/main/eval.c:558)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
==2322== by 0x4BB5AA: bcEval (svn/R-devel/src/main/eval.c:5370)
==2322== by 0x4C2A6F: Rf_eval (svn/R-devel/src/main/eval.c:558)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
Cause: We register smoke modules statically. Could free them in .onUnload.
==2322== 32 bytes in 2 blocks are definitely lost in loss record 802 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x101B8796: SmokeMethodCache::insert(MethodCall const&, Smoke::ModuleIndex const&) (packages/tests-vg/qtbase/src/SmokeClass.cpp:39)
==2322== by 0x101B91B7: SmokeClass::findIndex(MethodCall const&) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:132)
==2322== by 0x101B928D: SmokeClass::findMethod(MethodCall const&) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:139)
==2322== by 0x101C13B2: DynamicBinding::invoke(SEXPREC*, SEXPREC*) (packages/tests-vg/qtbase/src/DynamicBinding.cpp:8)
==2322== by 0x101B3160: qt_qinvokeStatic (packages/tests-vg/qtbase/src/invoke.cpp:28)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==2322== by 0x4C2DCE: Rf_eval (svn/R-devel/src/main/eval.c:655)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
==2322== by 0x4C2A23: Rf_eval (svn/R-devel/src/main/eval.c:674)
Cause: We cache smoke methods; could free in .onUnload.
==2322== 16 bytes in 1 blocks are definitely lost in loss record 393 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x101B635D: Class::fromSexp(SEXPREC*, bool) (packages/tests-vg/qtbase/src/Class.cpp:62)
==2322== by 0x101BF3FA: qt_qinitClass (packages/tests-vg/qtbase/src/classes.cpp:20)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==2322== by 0x4C2DCE: Rf_eval (svn/R-devel/src/main/eval.c:655)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
==2322== by 0x4C2A23: Rf_eval (svn/R-devel/src/main/eval.c:674)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
Cause: We cache Class objects; could release them in .onLoad.
=2322== 40 bytes in 1 blocks are possibly lost in loss record 975 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x34FCA98A87: QHashData::detach_helper2(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (in /usr/lib64/libQtCore.so.4.8.6)
==2322== by 0x101BC0CD: QHash<char const*, int>::detach_helper() (/usr/include/QtCore/qhash.h:584)
==2322== by 0x101BC143: QHash<char const*, int>::detach() (in /data/blackswan/ripley/R/packages/tests-vg/qtbase.Rcheck/qtbase/libs/qtbase.so)
==2322== by 0x101BB551: QHash<char const*, int>::operator[](char const* const&) (/usr/include/QtCore/qhash.h:740)
==2322== by 0x101BA070: SmokeClass::createEnumValuesMap() const (packages/tests-vg/qtbase/src/SmokeClass.cpp:255)
==2322== by 0x101B9EE6: SmokeClass::enumValues() const (packages/tests-vg/qtbase/src/SmokeClass.cpp:236)
==2322== by 0x10241B91: qt_qenums (packages/tests-vg/qtbase/src/smoke.cpp:101)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==2322== by 0x4C2DCE: Rf_eval (svn/R-devel/src/main/eval.c:655)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
Cause: We need to release cached enum information in a SmokeClass destructor.
==2322== 40 bytes in 1 blocks are possibly lost in loss record 980 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x34FCA98A87: QHashData::detach_helper2(void (*)(QHashData::Node*, void*), void (*)(QHashData::Node*), int, int) (in /usr/lib64/libQtCore.so.4.8.6)
==2322== by 0x101B459F: QHash<QByteArray, int>::detach_helper() (/usr/include/QtCore/qhash.h:584)
==2322== by 0x101B41FD: QHash<QByteArray, int>::detach() (in /data/blackswan/ripley/R/packages/tests-vg/qtbase.Rcheck/qtbase/libs/qtbase.so)
==2322== by 0x101BE1F7: QHash<QByteArray, int>::insert(QByteArray const&, int const&) (/usr/include/QtCore/qhash.h:756)
==2322== by 0x101BDB06: MocClass::hasMethod(char const*, QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/MocClass.cpp:86)
==2322== by 0x1023FBF8: InstanceObjectTable::methodExists(char const*) const (packages/tests-vg/qtbase/src/InstanceObjectTable.cpp:65)
==2322== by 0x1024001B: InstanceObjectTable::get(char const*, Rboolean*) const (packages/tests-vg/qtbase/src/InstanceObjectTable.cpp:121)
==2322== by 0x1023F215: ObjectTable_get(char const*, Rboolean*, _R_ObjectTable*) (packages/tests-vg/qtbase/src/ObjectTable.cpp:24)
==2322== by 0x54F102: R_subset3_dflt (svn/R-devel/src/main/subset.c:1265)
==2322== by 0x54F4A5: do_subset3 (svn/R-devel/src/main/subset.c:1150)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
Cause: We need to release cached method information in a MocClass destructor.
==2322== 48 bytes in 1 blocks are definitely lost in loss record 1,057 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x101B96B9: SmokeClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:189)
==2322== by 0x101B9953: SmokeClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:205)
==2322== by 0x101BD85D: MocClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/MocClass.cpp:71)
==2322== by 0x101B9953: SmokeClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:205)
==2322== by 0x101BD85D: MocClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/MocClass.cpp:71)
==2322== by 0x101B9953: SmokeClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:205)
==2322== by 0x101BD85D: MocClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/MocClass.cpp:71)
==2322== by 0x101B9953: SmokeClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/SmokeClass.cpp:205)
==2322== by 0x101BD85D: MocClass::methods(QFlags<Method::Qualifier>) const (packages/tests-vg/qtbase/src/MocClass.cpp:71)
==2322== by 0x102414A5: qt_qmethods (packages/tests-vg/qtbase/src/smoke.cpp:47)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
Cause: We need to release cached method information in a SmokeClass destructor.
==2322== 93,235 (96 direct, 93,139 indirect) bytes in 3 blocks are definitely lost in loss record 3,915 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x101B5398: ClassFactory::createClass(Smoke*, int) (packages/tests-vg/qtbase/src/ClassFactory.cpp:13)
==2322== by 0x101B5F68: Class::fromSmokeId(Smoke*, int) (packages/tests-vg/qtbase/src/Class.cpp:27)
==2322== by 0x101B6148: Class::fromSmokeName(Smoke*, char const*) (packages/tests-vg/qtbase/src/Class.cpp:43)
==2322== by 0x101B6331: Class::fromSexp(SEXPREC*, bool) (packages/tests-vg/qtbase/src/Class.cpp:60)
==2322== by 0x10241D64: qt_qparentClasses (packages/tests-vg/qtbase/src/smoke.cpp:123)
==2322== by 0x482A6F: do_dotcall (svn/R-devel/src/main/dotcode.c:1251)
==2322== by 0x4C2DCE: Rf_eval (svn/R-devel/src/main/eval.c:655)
==2322== by 0x4C4E38: do_begin (svn/R-devel/src/main/eval.c:1643)
==2322== by 0x4C2C38: Rf_eval (svn/R-devel/src/main/eval.c:627)
==2322== by 0x4C3E1E: Rf_applyClosure (svn/R-devel/src/main/eval.c:1039)
==2322== by 0x4C2A23: Rf_eval (svn/R-devel/src/main/eval.c:674)
Cause: We need to release the Class cache in .onUnload.
==2322== 102,836 (96 direct, 102,740 indirect) bytes in 2 blocks are definitely lost in loss record 3,919 of 3,962
==2322== at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2322== by 0x1023D256: SmokeObject::fromPtr(void*, Class const*, bool, bool) (packages/tests-vg/qtbase/src/SmokeObject.cpp:23)
==2322== by 0x1023D589: SmokeObject::sexpFromPtr(void*, Class const*, bool, bool) (packages/tests-vg/qtbase/src/SmokeObject.cpp:95)
==2322== by 0x1023D65A: SmokeObject::sexpFromPtr(void*, Smoke*, int, bool, bool) (packages/tests-vg/qtbase/src/SmokeObject.cpp:112)
==2322== by 0x1023D6BC: SmokeObject::sexpFromPtr(void*, SmokeType const&, bool, bool) (packages/tests-vg/qtbase/src/SmokeObject.cpp:119)
==2322== by 0x101A60B2: ptr_to_sexp(void*, SmokeType const&, bool) (packages/tests-vg/qtbase/src/convert.hpp:351)
==2322== by 0x101C3B19: void marshal_to_sexp<SmokeClassWrapper>(MethodCall*) (packages/tests-vg/qtbase/src/type-handlers.cpp:239)
==2322== by 0x101D3A79: void marshal<SmokeClassWrapper>(MethodCall*) (packages/tests-vg/qtbase/src/type-handlers.hpp:176)
==2322== by 0x101C3CB7: marshal_basetype(MethodCall*) (packages/tests-vg/qtbase/src/type-handlers.cpp:299)
==2322== by 0x101C2CF1: MethodCall::marshalItem() (packages/tests-vg/qtbase/src/MethodCall.hpp:138)
==2322== by 0x101C2433: MethodCall::marshal() (packages/tests-vg/qtbase/src/MethodCall.cpp:87)
==2322== by 0x101C25CB: MethodCall::eval() (packages/tests-vg/qtbase/src/MethodCall.cpp:117)
==2322==
Cause: We need to release the SmokeObject cache in .onUnload.
BR ran valgrind on qtbase and there were many errors. Some might be fixed already in git, and many are seemingly internal to Qt and the GTK+ stack (how is GTK involved?). But these probably need to be addressed:
Cause: DynamicQObject seems to be missing a destructor...
Cause: We register smoke modules statically. Could free them in
.onUnload
.Cause: We cache smoke methods; could free in
.onUnload
.Cause: We cache Class objects; could release them in
.onLoad
.Cause: We need to release cached enum information in a
SmokeClass
destructor.Cause: We need to release cached method information in a
MocClass
destructor.Cause: We need to release cached method information in a
SmokeClass
destructor.Cause: We need to release the
Class
cache in.onUnload
.Cause: We need to release the
SmokeObject
cache in.onUnload
.