Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Jini George
Going forward, we should remove the libpthread_db dependency for the threads discovery and only depend on /proc//task/s for this (https://bugs.openjdk.java.net/browse/JDK-8181313). It's great news! I will help you :-) Sure -- and thank you for the review! -Jini.

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Yasumasa Suenaga
Your webrev.02 looks good to me! Yasumasa 2018年12月13日(木) 14:05 Yasumasa Suenaga : > > Hi Jini, > > 2018年12月13日(木) 12:14 Jini George : > > > > Thank you very much for looking into this, Yasumasa! > > > > The 'pid' used in process_doesnt_exist() is actually the lwpid of the > > thread to be attache

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Yasumasa Suenaga
Hi Jini, 2018年12月13日(木) 12:14 Jini George : > > Thank you very much for looking into this, Yasumasa! > > The 'pid' used in process_doesnt_exist() is actually the lwpid of the > thread to be attached to. > > From Pgrab(), we call ptrace_attach() first for the pid at line 448. In > which case, we e

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Jini George
Thanks, JC! Will add the comments. Thanks, - Jini. On 12/13/2018 12:09 AM, JC Beyler wrote: Hi Jini, Fair enough, thanks for the explanation. It makes sense to me. I imagine that it is a conservative approach, ie can't find the information then assume still live. Perhaps a small comment ab

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Jini George
Thank you very much for looking into this, Yasumasa! The 'pid' used in process_doesnt_exist() is actually the lwpid of the thread to be attached to. From Pgrab(), we call ptrace_attach() first for the pid at line 448. In which case, we end up calling process_doesnt_exist() through ptrace_att

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Yasumasa Suenaga
Hi Jini, I have a comment for your webrev.02 . You added process_doesnt_exist() to check process / thread liveness from /proc/, but it is not enough. Information of threads (LWP) will be stored in /proc//task/. So you should check /proc//task/status for threads. Thanks, Yasumasa On 2018/1

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Jini George
On 12/12/2018 10:47 PM, JC Beyler wrote: Hi Jini, Should your return not be return !found_state instead of false here: 257   if (!found_state) { 258     // Assuming the thread exists. 259     print_error("Could not find the 'State:' string in the /proc/%d/status file\n", pid); 260   } 261   f

Re: RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-12 Thread Jini George
Thank you very much for looking into this, JC! I have a revised webrev addressing your comments at: http://cr.openjdk.java.net/~jgeorge/8202884/webrev.02/index.html Requesting one more review for this. My comments inline: On 12/12/2018 2:53 AM, JC Beyler wrote: Hi Jini, I saw a few nits: htt

RFR: JDK-8202884: SA: Attach/detach might fail on Linux if debugee application create/destroy threads during attaching

2018-12-11 Thread Jini George
Hello ! Requesting reviews for: https://bugs.openjdk.java.net/browse/JDK-8202884 Webrev: http://cr.openjdk.java.net/~jgeorge/8202884/webrev.00/index.html Details: For attaching to the threads in a process, we first go ahead and do a ptrace attach to the main thread. Later, we use the libthread