[Libreoffice-commits] core.git: cppu/source
Stephan Bergmann
sbergman at redhat.com
Wed Dec 7 11:40:07 UTC 2016
cppu/source/threadpool/thread.cxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit de5a8470ca79d549258bf9da1dea7d4a0c183946
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Dec 7 12:33:17 2016 +0100
Prevent self-join in ThreadAdmin::join
Depending on timing, it can apparently happen at least during
JunitTest_unordf_complex that a cppu_threadpool::ORequestThread having executed
a binaryurp::IncomingRequest holds the last binaryurp::Bridge reference:
> #2 0x00007fac4ad6bf97 in __assert_fail_base (fmt=<optimized out>, assertion=assertion at entry=0x7fac4b4e8c22 "false", file=file at entry=0x7fac4b4eaec7 "sal/osl/unx/thread.cxx", line=line at entry=443, function=function at entry=0x7fac4b4eaefd "void osl_joinWithThread(oslThread)") at assert.c:92
> #3 0x00007fac4ad6c042 in __GI___assert_fail (assertion=0x7fac4b4e8c22 "false", file=0x7fac4b4eaec7 "sal/osl/unx/thread.cxx", line=443, function=0x7fac4b4eaefd "void osl_joinWithThread(oslThread)") at assert.c:101
> #4 0x00007fac4b4d5258 in osl_joinWithThread(oslThread) (Thread=0x7fabfc0011d0) at sal/osl/unx/thread.cxx:443
> #5 0x00007fac47fbdde5 in cppu_threadpool::ThreadAdmin::join() (this=0x7fac1c0069e0) at cppu/source/threadpool/thread.cxx:89
> #6 0x00007fac47fc23af in cppu_threadpool::ThreadPool::joinWorkers() (this=<optimized out>) at cppu/source/threadpool/threadpool.cxx:179
> #7 0x00007fac47fc35b7 in uno_threadpool_destroy(uno_ThreadPool) (hPool=<optimized out>) at cppu/source/threadpool/threadpool.cxx:499
> #8 0x00007fac25b03b5c in binaryurp::Bridge::terminate(bool) (this=0x7fac24117078, final=true) at binaryurp/source/bridge.cxx:277
> #9 0x00007fac25b0794e in binaryurp::Bridge::dispose() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:904
> #10 0x00007fac25b07215 in binaryurp::Bridge::~Bridge() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:847
> #11 0x00007fac25b07409 in binaryurp::Bridge::~Bridge() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:838
> #12 0x00007fac25b39ee1 in std::default_delete<binaryurp::IncomingRequest>::operator()(binaryurp::IncomingRequest*) const (this=<optimized out>, __ptr=0x7fabfc00ba50) at /usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../../include/c++/6.2.1/bits/unique_ptr.h:76
> #13 0x00007fac25b38fa8 in std::unique_ptr<binaryurp::IncomingRequest, std::default_delete<binaryurp::IncomingRequest> >::~unique_ptr() (this=0x7fac0bb74ac0) at /usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../../include/c++/6.2.1/bits/unique_ptr.h:236
> #14 0x00007fac25b36d71 in request(void*) (pThreadSpecificData=<optimized out>) at binaryurp/source/reader.cxx:83
> #15 0x00007fac47fbaa95 in cppu_threadpool::JobQueue::enter(long, bool) (this=<optimized out>, nDisposeId=<optimized out>, bReturnWhenNoJob=<optimized out>) at cppu/source/threadpool/jobqueue.cxx:107
> #16 0x00007fac47fbe1f9 in cppu_threadpool::ORequestThread::run() (this=0x7fabfc001160) at cppu/source/threadpool/thread.cxx:165
> #17 0x00007fac47fbf9ca in threadFunc(void*) (param=0x7fabfc001170) at include/osl/thread.hxx:185
> #18 0x00007fac4b4d5a3c in osl_thread_start_Impl(void*) (pData=0x7fabfc0011d0) at sal/osl/unx/thread.cxx:240
> #19 0x00007fac4ab2a5ca in start_thread (arg=0x7fac0bb75700) at pthread_create.c:333
> #20 0x00007fac4ae420ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
while the main thread is already shutting down:
> #19 0x00007fac4b14100f in desktop::Desktop::doShutdown() (this=0x7fff8a6149d0) at desktop/source/app/app.cxx:1783
> #20 0x00007fac4b13f505 in desktop::Desktop::Main() (this=0x7fff8a6149d0) at desktop/source/app/app.cxx:1716
> #21 0x00007fac419a0f79 in ImplSVMain() () at vcl/source/app/svmain.cxx:185
> #22 0x00007fac419a1c14 in SVMain() () at vcl/source/app/svmain.cxx:223
> #23 0x00007fac4b17c773 in soffice_main() () at desktop/source/app/sofficemain.cxx:166
> #24 0x0000000000400916 in sal_main () at desktop/source/app/main.c:48
> #25 0x00000000004008fb in main (argc=<optimized out>, argv=<optimized out>) at desktop/source/app/main.c:47
Change-Id: I34beac40e89f6d522af49f9dcdb3ed2fc1259c4b
diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx
index 06fd30d..0e8b809 100644
--- a/cppu/source/threadpool/thread.cxx
+++ b/cppu/source/threadpool/thread.cxx
@@ -86,7 +86,11 @@ namespace cppu_threadpool {
pCurrent = m_lst.front();
m_lst.pop_front();
}
- pCurrent->join();
+ if (pCurrent->getIdentifier()
+ != osl::Thread::getCurrentIdentifier())
+ {
+ pCurrent->join();
+ }
}
}
More information about the Libreoffice-commits
mailing list