When stopping vmtoolsd, the code tries to unload all plugins. The
signal TOOLS_CORE_SIG_CAPABILITIES is emitted before really starting
to unload plugins. If the plugin should try to call RpcChannel_Send
while processing the signal and the RPC channel has been shutdown, an
ASSERT is triggered. The fix is to check whether rpc exists and if
unavailable, avoid sending the TOOLS_CORE_SIG_CAPABILITIES signal.
return;
}
- if (state->capsRegistered) {
+ /*
+ * Signal handlers in some plugins may require RPC Channel. Therefore, we don't
+ * emit the signal if RPC channel is not available. See PR 1798412 for details.
+ */
+ if (state->capsRegistered && state->ctx.rpc) {
GArray *pcaps = NULL;
g_signal_emit_by_name(state->ctx.serviceObj,
TOOLS_CORE_SIG_CAPABILITIES,
&pcaps);
if (pcaps != NULL) {
- if (state->ctx.rpc) {
- ToolsCore_SetCapabilities(state->ctx.rpc, pcaps, FALSE);
- }
+ ToolsCore_SetCapabilities(state->ctx.rpc, pcaps, FALSE);
g_array_free(pcaps, TRUE);
}
}