379390 unhandled syscall: mach:70 (host_create_mach_voucher_trap)
379473 MIPS: add support for rdhwr cycle counter register
379504 remove TileGX/Linux port
+356374 Assertion 'DRD_(g_threadinfo)[tid].pt_threadid != INVALID_POSIX_THREADID' failed
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
assert(thread_args.detachstate == PTHREAD_CREATE_JOINABLE
|| thread_args.detachstate == PTHREAD_CREATE_DETACHED);
+ /*
+ * The DRD_(set_pthread_id)() from DRD_(init)() may encounter that
+ * pthread_self() == 0, e.g. when the main program is not linked with the
+ * pthread library and when a pthread_create() call occurs from within a
+ * shared library. Hence call DRD_(set_pthread_id)() again to ensure that
+ * DRD knows the identity of the current thread. See also B.Z. 356374.
+ */
+ DRD_(set_pthread_id)();
DRD_(entering_pthread_create)();
CALL_FN_W_WWWW(ret, fn, thread, attr, DRD_(thread_wrapper), &thread_args);
DRD_(left_pthread_create)();
/**
* Store the POSIX thread ID for the specified thread.
*
- * @note This function can be called two times for the same thread -- see also
- * the comment block preceding the pthread_create() wrapper in
+ * @note This function can be called multiple times for the same thread -- see
+ * also the comment block preceding the pthread_create() wrapper in
* drd_pthread_intercepts.c.
*/
void DRD_(thread_set_pthreadid)(const DrdThreadId tid, const PThreadId ptid)
tl_assert(DRD_(g_threadinfo)[tid].pt_threadid == INVALID_POSIX_THREADID
|| DRD_(g_threadinfo)[tid].pt_threadid == ptid);
tl_assert(ptid != INVALID_POSIX_THREADID);
+ if (DRD_(g_threadinfo)[tid].posix_thread_exists) {
+ tl_assert(DRD_(g_threadinfo)[tid].pt_threadid == ptid);
+ return;
+ }
DRD_(g_threadinfo)[tid].posix_thread_exists = True;
DRD_(g_threadinfo)[tid].pt_threadid = ptid;