On Jul 24, 12:08 am, Richard Crowley <[EMAIL PROTECTED]> wrote:
> I have a XULRunner app that needs a background thread functioning as a
> job queue. I found [1] and have integrated Steve's AsynchEventQueue
> (sic) into my app. It works flawlessly in OS X but crashes and
> core-dumps in Windows. I have isolated the line that causes the problem
> below.
>
> [1]http://skrul.com/blog/projects/threaddemo
>
> this.proxy = this.pom.getProxyForObject(this.eq,
> Ci.tdIAsynchService, this,
> Ci.nsIProxyObjectManager.INVOKE_ASYNC);
>
> Here are a few preceding lines to give context:
>
> const Cc = Components.classes
> const Ci = Components.interfaces
> //...
> start: function(callback) {
> this.pom = Cc["@mozilla.org/xpcomproxy;1"].getService(
> Ci.nsIProxyObjectManager);
> this.eqs = Cc["@mozilla.org/event-queue-service;1"].getService(
> Ci.nsIEventQueueService);
> this.callback = this.pom.getProxyForObject(
> this.eqs.getSpecialEventQueue(Ci.UI_THREAD_EVENT_QUEUE),
> Ci.tdICallback, callback,
> Ci.nsIProxyObjectManager.INVOKE_ASYNC);
> this.thread = Cc["@mozilla.org/thread;1"].createInstance(
> Ci.nsIThread);
> this.thread.init(this, 0, Ci.nsIThread.PRIORITY_NORMAL,
> Ci.nsIThread.SCOPE_GLOBAL, Ci.nsIThread.STATE_UNJOINABLE);
this shouldn't be legal in js. it is but only because I didn't spend
the time trying to make it illegal. Unjoinable means that it can stick
around past app exit. JS code can't stick around past xpconnect
shutdown let alone app exit. please remove this flag.
> var mainThread = Cc["@mozilla.org/thread;1"].createInstance(
> Ci.nsIThread).currentThread;
> var i = 0;
> while(!this.eq && i < 10) mainThread.sleep(10);
> if(!this.eq) throw Error("Event queue not found");
> this.proxy = this.pom.getProxyForObject(this.eq,
> Ci.tdIAsynchService, this,
> Ci.nsIProxyObjectManager.INVOKE_ASYNC);
> return this.proxy;},
>
> //...
>
> I've checked that this.pom is created and has the function
> getProxyForObject, that this.eq gets created properly, and that the
> interfaces tdIAsynchService and nsIProxyObjectManager exist. I have run
> the app under XULRunner 1.8.1.3 and 1.8.0.4, with both causing the same
> crash and core dump.
>
> This smells like a bug in the Win32 version of XULRunner, but I don't
> know how to dig deeper into this problem. Suggestions?
a stack trace would be nice. I presume you built yourself, if you
didn't, please do (--enable-debug is a good start, --enable-debugger-
info-modules can be used once things work and you're just afraid they
might crash).
note that for trunk the threading story has been rewritten, although I
don't think that's really going to fix most underlying problems.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom