Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All DRD testcases fail on macOS Ventura 13.6 Intel #8

Open
paulfloyd opened this issue Dec 11, 2023 · 0 comments
Open

All DRD testcases fail on macOS Ventura 13.6 Intel #8

paulfloyd opened this issue Dec 11, 2023 · 0 comments

Comments

@paulfloyd
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant