proot
proot copied to clipboard
"gdb -p" doesn't work with multi-threaded programs
How to reproduce:
./src/proot bash -c 'tests/test-c47aeb7d & gdb -p $!'
where tests/test-c47aeb7d.c was modified this way:
void *print_hello(void *id)
{
+ sleep(999);
pthread_exit(id);
}
Expected result: gdb gives a prompt
Current result: gdb is stalled in the tracing-stop state.
Hypothetical fix: function attach_to_ptracer() should declare all threads from ptracee's thread group as attached by ptracer.