From 9767073b3225af9736c5e528bb0eaa2fc930338e Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:35:25 +0000 Subject: [PATCH 1/2] GP-5553: Disable timing out when we have a ProgressService. --- .../debug/gui/control/TargetActionTask.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java index 24fda8c170..cb3a3b1f4b 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/control/TargetActionTask.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -136,6 +136,16 @@ public class TargetActionTask extends Task { /** * Execute an {@link ActionEntry} * + *
+ * If the {@link ProgressService} is available, we will not enforce a timeout, because it should
+ * be relatively easy for the user to manage the pending tasks. Otherwise, we'll enforce the
+ * timeout. The rationale here is that some tasks do actually take a good bit of time. For
+ * example, some targets just have a large module list. Often a GUI component is asking for a
+ * reason, and if we time it out, that thing doesn't get what it needs. Furthermore, the entry
+ * disappears from the task list, even though the back-end is likely still working on it. That's
+ * not good, actually. Since we have a cancel button, let the user decide when it's had enough
+ * time.
+ *
* @param tool the tool in which to execute
* @param title the title, often {@link ActionEntry#display()}
* @param entry the action to execute
@@ -144,11 +154,13 @@ public class TargetActionTask extends Task {
*/
public static CompletableFuture
+ * This is generally not a recommended course of action, except that sometimes the back-end
+ * crashes and fails to close a transaction. It should only be invoked by a relatively hidden
+ * menu option, and mediated by a warning of some sort. Closing a transaction prematurely, when
+ * the back-end actually does still need it may cause a host of other problems.
+ */
+ void forciblyCloseTransactions();
}
diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/tracermi/TraceRmiConnection.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/tracermi/TraceRmiConnection.java
index 8e0ad284ff..9afc226bf0 100644
--- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/tracermi/TraceRmiConnection.java
+++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/tracermi/TraceRmiConnection.java
@@ -171,8 +171,19 @@ public interface TraceRmiConnection extends AutoCloseable {
/**
* Check if the given target has a transaction open
*
- * @param target
+ * @param target the target
* @return true if busy
*/
boolean isBusy(Target target);
+
+ /**
+ * Forcibly commit all transactions this connection has on the given trace
+ *
+ *
+ * This may cause undefined behavior in the back-end, especially if it still needs the
+ * transaction.
+ *
+ * @param target the the target
+ */
+ void forciblyCloseTransactions(Target target);
}
diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiConnectionManagerPlugin/TraceRmiConnectionManagerPlugin.html b/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiConnectionManagerPlugin/TraceRmiConnectionManagerPlugin.html
index 9547a6a869..1462f39b71 100644
--- a/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiConnectionManagerPlugin/TraceRmiConnectionManagerPlugin.html
+++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiConnectionManagerPlugin/TraceRmiConnectionManagerPlugin.html
@@ -105,5 +105,15 @@
Stop the server. This closes the persistent server. This does not affect pending acceptors
or established connections. Forcibly close all the back-end's transactions on the target trace. This is generally not a
+ recommended course of action, except that sometimes the back-end crashes and fails to close a
+ transaction. Un-closed transactions from the back-end can leave most, if not all, of the UI in
+ a stale state, since event processing on the trace is disabled. If there is good reason to
+ believe the back-end has forgotten to close a transaction, this action will forcibly close all
+ of them and re-enable event processing. If, however, the back-end was in fact still doing work
+ with that transaction, it may crash and/or corrupt the connection.Forcibly Close Transactions
+
+