-
Notifications
You must be signed in to change notification settings - Fork 566
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
i#95: Detach on Linux #6513
i#95: Detach on Linux #6513
Conversation
(Please request review when this is ready.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing this feature! I think it will be very useful as some users had wanted it for a long time.
I had a few questions and suggestions: see the review comments.
(With holidays and traveling there may be delays in reviews) |
Enjoy your holidays and travels. |
Thanks for your advice. My codes are ready now, could you merge it if you think there's no problem? |
The client.detach_test added here is flaky, making the automated tests red in 2 out of 4 PR's yesterday. Filed as #6536. @onroadmuwl have you seen that in local testing -- can you reproduce that? |
Hello, i am trying to use attach/detach/reattach feature on Ubuntu 20.04 AArch64 for some single thread application and currently it crashes. i built dynamorio in debug mode and enabled full logging: 87048:dispatch_enter_fcache_stats: Entry into F2(0x0000ffffab42755c).0x0000aaaa929fb170 87612:main_signal_handler_C: i added code that implements unlink of fragment that nudge detach signal hit at the end of unlink_fragment_for_signal() function at signal.c file: static bool
} 87830:flush_fragments_unlink_shared: FLUSH STAGE 2: unlink_shared(thread 4042305): flusher is 4042305 After return from signal handler thread gets back to dynamorio dispatch and starts instrumenting code and building code cache again: 88054:d_r_dispatch: Should detach code like: handle_nidge() -> call_switch_stack(dcontext, (byte )((ptr_uint_t)d_r_detachstack + DYNAMORIO_STACK_SIZE), (void ()(void *))detach_externally_on_new_stack, NULL, true); Thanks, |
Enable the feature of detachment on Linux.
nudged_sigcxt
is used to save thesigcxt
of nudged thread.dcontext == GLOBAL_DCONTEXT
is added to cover the new code path that won't be executed before during the process of thread exit.is_detach_external
variable for the smooth resumption of nudged thread on X64 ISA.Issue: #95