From c0ce5c70880b36a21bb74f54a4b046e503953dce Mon Sep 17 00:00:00 2001 From: Phenom Date: Sun, 19 Apr 2020 11:20:33 +0200 Subject: [PATCH] Fix SIGSEGV on RsThread::start mTid could be null while pError is null too. This happens to me always with "gxs integrity". --- libretroshare/src/util/rsthreads.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libretroshare/src/util/rsthreads.cc b/libretroshare/src/util/rsthreads.cc index e4c4866a3..06f774ee9 100644 --- a/libretroshare/src/util/rsthreads.cc +++ b/libretroshare/src/util/rsthreads.cc @@ -194,6 +194,15 @@ bool RsThread::start(const std::string& threadName) print_stacktrace(); return false; } + if(!mTid) + { + RsErr() << __PRETTY_FUNCTION__ << " pthread_create could not create" + << " new thread: " << threadName << " mTid: " << mTid + << std::endl; + mHasStopped = true; + print_stacktrace(); + return false; + } /* Store an extra copy of thread id for debugging */ mLastTid = mTid;