protected GdbAndConnection startAndConnectGdb(Function<String, String> scriptSupplier)
			throws Exception {
		TraceRmiAcceptor acceptor = traceRmi.acceptOne(null);
		ExecInGdb exec = execInGdb(scriptSupplier.apply(sockToStringForGdb(acceptor.getAddress())));
		acceptor.setTimeout(CONNECT_TIMEOUT_MS);
		try {
			TraceRmiConnection connection = acceptor.accept();
			return new GdbAndConnection(exec, connection);
		}
		catch (SocketTimeoutException e) {
			exec.gdb.destroyForcibly();
			exec.future.get(TIMEOUT_SECONDS, TimeUnit.SECONDS).handle();
			throw e;
		}
	}
This seems like a bug in gdb. AFAICT, it's a rehash or regression of
https://sourceware.org/bugzilla/show_bug.cgi?id=17247. If I attach to the
hung gdb, I get a similar stack trace, but with Python frames on the
stack. The workaround given in the comments works here, too. I hesitate
to point fingers, though, because I'm testing with a modern gdb-13.1
compiled from source on a rather un-modern distro.
Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/gdb/rmi/AbstractGdbTraceRmiTest.java