uti: Make tracer not call mcexec_terminate_thread() when tracee is killed by signal
Change-Id: I5878c7d623ce182a7cb9578c9d5c430c1bee8e1e
This commit is contained in:
@ -3027,14 +3027,30 @@ create_tracer()
|
||||
term_param[1] = uti_desc->tid;
|
||||
term_param[3] = uti_desc->key;
|
||||
code = st;
|
||||
/* exit_group case. Note that killing-signal kills mcexec and tracer in terminate(),
|
||||
so this won't be reached. */
|
||||
if (exited == 2) {
|
||||
|
||||
if (exited == 2) { /* exit_group */
|
||||
code |= 0x0000000100000000;
|
||||
}
|
||||
term_param[2] = code;
|
||||
if (ioctl(fd, MCEXEC_UP_TERMINATE_THREAD, term_param) != 0) {
|
||||
fprintf(stderr, "%s: ERROR: MCEXEC_UP_TERMINATE_THREAD returned %d\n", __FUNCTION__, errno);
|
||||
|
||||
/* How return_syscall() is called depends on how utility thread exits:
|
||||
exit:
|
||||
create_tracer()
|
||||
MCEXEC_UP_TERMINATE_THREAD
|
||||
return_syscall()
|
||||
exit_group:
|
||||
create_tracer()
|
||||
MCEXEC_UP_TERMINATE_THREAD
|
||||
return_syscall()
|
||||
killed by signal:
|
||||
release_handler()
|
||||
return_syscall()
|
||||
*/
|
||||
if (exited == 1 || exited == 2) {
|
||||
fprintf(stderr, "%s: calling MCEXEC_UP_TERMINATE_THREAD,exited=%d,code=%lx\n", __FUNCTION__, exited, code);
|
||||
if (ioctl(fd, MCEXEC_UP_TERMINATE_THREAD, term_param) != 0) {
|
||||
fprintf(stderr, "%s: INFO: MCEXEC_UP_TERMINATE_THREAD returned %d\n", __FUNCTION__, errno);
|
||||
}
|
||||
}
|
||||
__dprintf("%s: WIFEXITED=%d,WIFSIGNALED=%d,WTERMSIG=%d,exited=%d\n", __FUNCTION__, WIFEXITED(st), WIFSIGNALED(st), WTERMSIG(st), exited);
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user