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

Don't fail if some thread exit during attach. #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rashchupkinr
Copy link
Collaborator

Thread creation during attach was correctly processed.
This commit adds processing of cases when some threads exit during attach without failing to patch. Threads are added to list only if they been correctly attached to.

(void *)(uintptr_t)status);
if (ret < 0) {
kplogerror("can't cont tracee\n");
return -1;
}
} while (1);

pctx = kpatch_ptrace_ctx_alloc(proc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of failure here you leave the thread attached but unaccounted. Please fix restore the allocations before the attachment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved pctx allocation before SIGSTOP processing, but after successfull PTRACE_ATTACH.

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

Successfully merging this pull request may close these issues.

2 participants