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

linux attach: support attaching to processes with non-pthreads threads #764

Open
derekbruening opened this issue Nov 28, 2014 · 3 comments

Comments

@derekbruening
Copy link
Contributor

From [email protected] on May 03, 2012 13:12:32

Splitting from issue #38 and issue #722 .

Our current approach for discovering threads in the current process is to look in /proc/self/task, which contains thread ids for all threads in the current thread group. If a process uses vfork or clone without CLONE_THREAD, then we'll miss them. Other threads will be executing in the current address space, and bad things are likely to happen.

Original issue: http://code.google.com/p/dynamorio/issues/detail?id=764

@derekbruening
Copy link
Contributor Author

From [email protected] on May 03, 2012 16:33:55

figuring out whether signal handlers are shared or not is an additional challenge, as not having them all shared will lead to failing to take over all the threads even if we can list them all. this was one of the main challenges listed up front in issue #38 , partly b/c back then NPTL wasn't everywhere

@derekbruening
Copy link
Contributor Author

From [email protected] on May 03, 2012 17:00:17

I noticed that for all threads in the current thread group, CLONE_SIGHAND is mandatory according to the clone manpage. As long as we're limiting ourselves to a single thread group by looking at /proc/self/task, we can be certain that they share signal handlers.

@derekbruening
Copy link
Contributor Author

From [email protected] on May 03, 2012 17:16:27

CLONE_SIGHAND is mandatory according to the clone manpage

hmmm, that was not true when I last looked at such things. shows how old I am I guess.

we can be certain that they share signal handlers

right, but only if we don't want to support legacy linux kernels

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

No branches or pull requests

1 participant