GetProxyForObject preventing windows shutdown

UNCONFIRMED
Unassigned

Status

()

Core
XPCOM
UNCONFIRMED
7 years ago
4 months ago

People

(Reporter: Alexey Svetlyakov, Unassigned)

Tracking

2.0 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

I'm using XPCOM proxies for dispatching JS-callbacks from my DLL to main GUI thread. It works but prevents windows system shutdown/log-off after using it.

I have following code in my XPCOM component:

nsresult rv;
nsCOMPtr<nsIProxyObjectManager> proxyManager;
proxyManager = do_GetService(NS_XPCOMPROXY_CONTRACTID,&rv);
nsCString acc_id;

acc_id.Assign(account->identify);

if (NS_SUCCEEDED(rv))
{
        nsCOMPtr<nsISPCallbacks> prox;
	proxyManager->GetProxyForObject(NS_PROXY_TO_MAIN_THREAD,                NS_GET_IID(nsISPCallbacks),(nsISPCallbacks*)sip_callbacks, NS_PROXY_SYNC | NS_PROXY_ALWAYS, getter_AddRefs(prox));
	prox->OnRegisterSuccessCallback(acc_id.get());
}

Without this, windows is shutdown normally.

Reproducible: Always

Comment 1

7 years ago
Probably the wrong component to move this to but I'll choose Core::XPCOM at random.
Component: Developer Tools → XPCOM
Product: Firefox → Core
QA Contact: developer.tools → xpcom
Version: unspecified → 2.0 Branch

Comment 2

7 years ago
Do you have a Firefox stack trace after "shutdown" when the Firefox process isn't actually shutting down?

Are you using these proxies during the shutdown process? That's probably bad. I highly recommend never using XPCOM proxies because they are prone to deadlocks unless used extremely carefully: it's generally better to just write a custom nsIRunnable and post it to the main thread.
(Reporter)

Comment 3

7 years ago
(In reply to comment #2)
> Do you have a Firefox stack trace after "shutdown" when the Firefox process
> isn't actually shutting down?
No i haven't. How can i get it? Just with MSVC gebugger or something else?

> Are you using these proxies during the shutdown process? That's probably
> bad. I highly recommend never using XPCOM proxies because they are prone to
> deadlocks unless used extremely carefully: it's generally better to just
> write a custom nsIRunnable and post it to the main thread.
Hm, unregistration callback is called after shutdown beginning. I'll try to disable it and check again.

Comment 4

7 years ago
Yes, the MSVC debugger using the symbol server.

What unregistration callback?
(Reporter)

Comment 5

7 years ago
(In reply to comment #4)
> What unregistration callback?
This is our callback called on closing/shutdown event.
We're developing voip plug-in for firefox and other browsers.

I disabled it and windows couldn't to shutdown again. No more callbacks are called.

I'll try to provide stack trace.
You need to log in before you can comment on or make changes to this bug.