clear externally released js handles
svalaskevicius opened this issue · 1 comments
svalaskevicius commented
when a QObject tree is released the children are also deleted automatically, however cpgf is still referencing them and is trying to access later:
Invalid read of size 8
at 0x50BE73: cpgf::variant_internal::CastFromReference<void*, cpgf::VarantCastKeepConstRef, void>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x50BCA2: cpgf::variant_internal::CastFromVariant<void*, cpgf::VarantCastKeepConstRef>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x4BCD50D: cpgf::(anonymous namespace)::v8ToObject(v8::Handle<v8::Value>, cpgf::GMetaType*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4BCD300: void cpgf::(anonymous namespace)::weakHandleCallback<v8::Object>(v8::Isolate*, v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >*, cpgf::bind_internal::GGlueDataWrapper*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4F5D09C: v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F8FDD0: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90334: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollector, char const*, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90656: v8::internal::Heap::CollectAllGarbage(int, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F907FE: v8::internal::Heap::AdvanceIdleIncrementalMarking(long) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90AEF: v8::internal::Heap::IdleNotification(int) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4CB359: qtjs_binder::unregisterQt() (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x57752C: (anonymous namespace)::CpgfBinder::~CpgfBinder() (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
Address 0x1259b068 is 24 bytes inside a block of size 64 free'd
at 0x402DF2A: free (vg_replace_malloc.c:469)
by 0xCE44AC6: QListData::dispose(QListData::Data*) (qlist.cpp:160)
by 0xD007F38: QList<QObject*>::dealloc(QListData::Data*) (qlist.h:779)
by 0xD00746B: QList<QObject*>::~QList() (qlist.h:753)
by 0xD062F11: QList<QObject*>::clear() (qlist.h:786)
by 0xD05958B: QObjectPrivate::deleteChildren() (qobject.cpp:1843)
by 0xD057BDA: QObject::~QObject() (qobject.cpp:934)
by 0xC81EAEB: QWindow::~QWindow() (qwindow.cpp:224)
by 0xB62598B: QQuickWindow::~QQuickWindow() (qquickwindow.cpp:1036)
by 0xB7315C9: QQuickWindowQmlImpl::~QQuickWindowQmlImpl() (in /home/sarunas/bin/Qt_HEAD/lib/libQt5Quick.so.5.2.2)
by 0xB732B0B: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
by 0xB732B4F: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
Invalid read of size 8
at 0x50BE73: cpgf::variant_internal::CastFromReference<void*, cpgf::VarantCastKeepConstRef, void>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x50BCA2: cpgf::variant_internal::CastFromVariant<void*, cpgf::VarantCastKeepConstRef>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x4B3C408: cpgf::bind_internal::GObjectInstance::~GObjectInstance() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4B3CD58: cpgf::bind_internal::GObjectGlueData::~GObjectGlueData() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4B3CCE8: cpgf::bind_internal::GObjectGlueData::~GObjectGlueData() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4BD4DF3: cpgf::bind_internal::GGlueDataWrapperImplement<cpgf::GSharedPointer<cpgf::bind_internal::GObjectGlueData> >::~GGlueDataWrapperImplement() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4BCD33C: void cpgf::(anonymous namespace)::weakHandleCallback<v8::Object>(v8::Isolate*, v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >*, cpgf::bind_internal::GGlueDataWrapper*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4F5D09C: v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F8FDD0: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90334: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollector, char const*, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90656: v8::internal::Heap::CollectAllGarbage(int, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F907FE: v8::internal::Heap::AdvanceIdleIncrementalMarking(long) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
Address 0x1259b068 is 24 bytes inside a block of size 64 free'd
at 0x402DF2A: free (vg_replace_malloc.c:469)
by 0xCE44AC6: QListData::dispose(QListData::Data*) (qlist.cpp:160)
by 0xD007F38: QList<QObject*>::dealloc(QListData::Data*) (qlist.h:779)
by 0xD00746B: QList<QObject*>::~QList() (qlist.h:753)
by 0xD062F11: QList<QObject*>::clear() (qlist.h:786)
by 0xD05958B: QObjectPrivate::deleteChildren() (qobject.cpp:1843)
by 0xD057BDA: QObject::~QObject() (qobject.cpp:934)
by 0xC81EAEB: QWindow::~QWindow() (qwindow.cpp:224)
by 0xB62598B: QQuickWindow::~QQuickWindow() (qquickwindow.cpp:1036)
by 0xB7315C9: QQuickWindowQmlImpl::~QQuickWindowQmlImpl() (in /home/sarunas/bin/Qt_HEAD/lib/libQt5Quick.so.5.2.2)
by 0xB732B0B: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
by 0xB732B4F: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
Invalid read of size 8
at 0x50BE73: cpgf::variant_internal::CastFromReference<void*, cpgf::VarantCastKeepConstRef, void>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x50BCA2: cpgf::variant_internal::CastFromVariant<void*, cpgf::VarantCastKeepConstRef>::cast(cpgf::GVariant const&) (in /home/sarunas/priv/dev/build-qtjs-clang_3_4_Qt_5_2_1_HEAD-Release/src/runner/qtjs)
by 0x4B3C6A2: cpgf::bind_internal::GClassPool::objectDestroyed(cpgf::bind_internal::GObjectInstance const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4B3C45D: cpgf::bind_internal::GObjectInstance::~GObjectInstance() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4B3CD58: cpgf::bind_internal::GObjectGlueData::~GObjectGlueData() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4B3CCE8: cpgf::bind_internal::GObjectGlueData::~GObjectGlueData() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4BD4DF3: cpgf::bind_internal::GGlueDataWrapperImplement<cpgf::GSharedPointer<cpgf::bind_internal::GObjectGlueData> >::~GGlueDataWrapperImplement() (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4BCD33C: void cpgf::(anonymous namespace)::weakHandleCallback<v8::Object>(v8::Isolate*, v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >*, cpgf::bind_internal::GGlueDataWrapper*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/cpgf/lib/libcpgf.so)
by 0x4F5D09C: v8::internal::GlobalHandles::PostGarbageCollectionProcessing(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F8FDD0: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GCTracer*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90334: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollector, char const*, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
by 0x4F90656: v8::internal::Heap::CollectAllGarbage(int, char const*) (in /home/sarunas/priv/dev/qtjs-generator-qtHead/lib/node/deps/v8/out/native/lib.target/libv8.so)
Address 0x1259b068 is 24 bytes inside a block of size 64 free'd
at 0x402DF2A: free (vg_replace_malloc.c:469)
by 0xCE44AC6: QListData::dispose(QListData::Data*) (qlist.cpp:160)
by 0xD007F38: QList<QObject*>::dealloc(QListData::Data*) (qlist.h:779)
by 0xD00746B: QList<QObject*>::~QList() (qlist.h:753)
by 0xD062F11: QList<QObject*>::clear() (qlist.h:786)
by 0xD05958B: QObjectPrivate::deleteChildren() (qobject.cpp:1843)
by 0xD057BDA: QObject::~QObject() (qobject.cpp:934)
by 0xC81EAEB: QWindow::~QWindow() (qwindow.cpp:224)
by 0xB62598B: QQuickWindow::~QQuickWindow() (qquickwindow.cpp:1036)
by 0xB7315C9: QQuickWindowQmlImpl::~QQuickWindowQmlImpl() (in /home/sarunas/bin/Qt_HEAD/lib/libQt5Quick.so.5.2.2)
by 0xB732B0B: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
by 0xB732B4F: QQmlPrivate::QQmlElement<QQuickWindowQmlImpl>::~QQmlElement() (qqmlprivate.h:90)
svalaskevicius commented
this is being resolved as cpgf/cpgf#24