Community
Participate
Working Groups
From bug 340535 comment #1: > For the remote attach case, I ran into a deadlock. The reason is that for a > remote attach, the connect action (GdbConnectCommand) needs to prompt the user > for the path to the binary (not needed for local attach), which can deadlock > because GdbReverseToggleCommand also locks the UI thread. To reproduce: 1- start gdbserver --multi :9999 2- start a remote attach session 3- press 'connect' and choose a binary 4- press 'connect' again, and choose a binary (the same one is fine) => there is a deadlock as described above.
The deadlock is because the connect command, which is running in the DSF executor needs to UI thread to prompt the user for the path of the binary; while at the same time, the ReverseDebuggingPropertyTester, calls GdbReverseToggleCommand.isReverseToggled() on the UI thread and locks it waiting for the DSF executor.
Created attachment 194880 [details] Use a job instead of locking the executor This patch uses a job to prompt the user for the binary path.
Created attachment 194895 [details] Use a job instead of locking the executor (2) Update on the patch to properly complete the RequestMonitor.
I committed the last patch to HEAD. Pawel can you review? The patch simply moves the long prompting operation to a job so it can free the executor.
*** cdt cvs genie on behalf of mkhouzam *** Bug 344892: Deadlock when trying to attach to more than one process on a remote target [*] GdbConnectCommand.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java?root=Tools_Project&r1=1.7&r2=1.8
Wow, I had to span across two screens to see the whole patch ;-) The fix looks fine to me. If you want it a little cleaner, you can use a UIJob, which internally does a Display.syncExec().
Created attachment 194995 [details] Patch using UIJob
(In reply to comment #7) > Created attachment 194995 [details] > Patch using UIJob Much appreciated, I will use it!
(In reply to comment #8) > (In reply to comment #7) > > Created attachment 194995 [details] [details] > > Patch using UIJob > > Much appreciated, I will use it! I committed Pawel patch to HEAD. Thanks again.
*** cdt cvs genie on behalf of mkhouzam *** Bug 344892: Deadlock when trying to attach to more than one process on a remote target [*] GdbConnectCommand.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java?root=Tools_Project&r1=1.8&r2=1.9
*** cdt cvs genie on behalf of mkhouzam *** Bug 344892: Deadlock when trying to attach to more than one process on a remote target. Small cleanup [*] GdbConnectCommand.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java?root=Tools_Project&r1=1.9&r2=1.10