summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-02-18 00:06:41 +0100
committerMichael Stahl <mstahl@redhat.com>2012-02-18 00:07:31 +0100
commit29177b1d04b845e8e6bf8edc8beb34b76a95d9c3 (patch)
tree1e38c31c5b2ab43268a8bb88c5477185fc9c026a /pyuno
parent962d0500c4debaef43e5f146e47e08c66d851562 (diff)
pyuno: decreaseRefCount: valgrind warning:
Apparently the thread spawned in decreaseRefCount runs and deletes itself before the "m_hThread != 0" from osl::Thread::create is executed; try a lame workaround for that. ==1877== Invalid read of size 8 ==1877== at 0x2A70E546: osl::Thread::create() (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A70E351: pyuno::decreaseRefCount(_is*, _object*) (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A7092B4: pyuno::Adapter::~Adapter() (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A709393: pyuno::Adapter::~Adapter() (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x5EF2F64: cppu::OWeakObject::release() (weak.cxx:213) ==1877== by 0x2A70DE69: ==1877== Address 0x1ee30818 is 8 bytes inside a block of size 32 free'd ==1877== at 0x4A0662E: free (vg_replace_malloc.c:366) ==1877== by 0x4C44B62: rtl_freeMemory_SYSTEM(void*) (alloc_global.cxx:285) ==1877== by 0x4C44DC7: rtl_freeMemory (alloc_global.cxx:355) ==1877== by 0x2A70E41E: osl::Thread::operator delete(void*) (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A70E6EF: pyuno::GCThread::~GCThread() (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A70E303: pyuno::GCThread::onTerminated() (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x2A70E671: threadFunc (in pyuno/unxlngx6/lib/libpyuno.so) ==1877== by 0x4C2E242: osl_thread_start_Impl (thread.c:292) ==1877== by 0x3C26607D8F: start_thread (pthread_create.c:309) ==1877== by 0x3C262EF48C: clone (clone.S:115)
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/source/module/pyuno_gc.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index 61eaabafe7f6..6ee657e17835 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -112,7 +112,10 @@ void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
// interpreter lock is held or not
// TODO: Look for a more efficient solution
osl::Thread *t = new GCThread( interpreter, object );
- t->create();
+ // don't call create() because Valgrind complains about invalid read in
+ // the rather bizarre GCThread::onTerminated; try a lame workaround:
+ t->createSuspended();
+ t->resume();
}
}