-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The root cause of the problem is the need to handle the dl_cache.
//--------------------------------------------------------------
// Initialize the dyld cache, which is required with macOS 11 (Big Sur) and onwards
// as some system libraries aren't provided on the disk anymore
// p: none
//--------------------------------------------------------------
# if defined(VGO_darwin) && DARWIN_VERS >= DARWIN_11_00
VG_(dyld_cache_init)();
# endif
This triggers some mmaps which in turn causes
static
void drd_start_using_mem_w_perms(const Addr a, const SizeT len,
const Bool rr, const Bool ww, const Bool xx,
ULong di_handle)
{
DRD_(thread_set_vg_running_tid)(VG_(get_running_tid)());
drd_start_using_mem(a, len, False);
DRD_(suppress_relocation_conflicts)(a, len);
}
To be called.
At this point the running tid is 0 (which is INVALID). The set running tid function has an assert to check that the tid is not INVALID.
Boom!
I tried faking a running tid of 1 for the call to dyld_cache_init. But DRD also maintains a record of the running tid in DRD_(g_threadinfo) so that isn't enough.
So the question is how to we get the two calls to ML_(notify_core_and_tool_of_mmap) in try_to_init_header to not cause this assert in DRD that is assuming that a thread is running.
Metadata
Metadata
Assignees
Labels
No labels