Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

thread_init and inheritance

10 views
Skip to first unread message

algra...@gmail.com

unread,
Sep 16, 2024, 9:30:46 AM9/16/24
to DynamoRIO Users
We have a client where a new thread needs to inherit some configuration
from the thread that created it. Is there any way for a thread_init callback
to get details of the creating thread? E.g. its drcontext_t or the values of
its TLS slots?

I realise that there's a risk of a race condition, where the creating thread
exits immediately before the new thread's thread_init gets to run.

Currently our fallback is to intercept the return from SYS_clone to get the
thread id, and stash some details that will be picked up when we see a
thread_init with that thread id, but it would be cleaner to have something
more direct.

Derek Bruening

unread,
Sep 16, 2024, 12:32:17 PM9/16/24
to algra...@gmail.com, DynamoRIO Users
One issue is that such parent-child relationships are not cross-platform: e.g., Windows has no formal relationship even with a process's parent let alone a thread's creator.  This makes it harder to recommend as a new DR API addition as we would prefer it to be cross-platform.  That said, we do have a UNIX-only dr_get_parent_id() API today.

--
You received this message because you are subscribed to the Google Groups "DynamoRIO Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dynamorio-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dynamorio-users/cb0b2a4f-46f2-462c-abff-5383f3859d53n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages