Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

js crashes in MarkRangeConservatively when JS_GC is called from other thread

71 views
Skip to first unread message

Ankur rungta

unread,
Aug 21, 2012, 11:40:13 AM8/21/12
to mozilla.dev.t...@googlegroups.com, dev-tech-...@lists.mozilla.org
Hi,

I am currently integrating js 1.8.5 with our environment.
While integration when JS_GC API call is called then there is a crash in js::MarkRangeConservatively

I have written a small program in which I created a new thread and called JS_GC in that.
It was still crashing in js::MarkRangeConservatively.

Please can anyone help me to know the correct usage where can we call JS_GC in js1.8.5.

Thanks & Regards,
Ankur.

Dave Mandelin

unread,
Aug 28, 2012, 7:51:46 PM8/28/12
to dev-tech-...@lists.mozilla.org
There aren't particularly any restrictions on when JS_GC can be called--SpiderMonkey can internally trigger GCs all over the place. Maybe we can help you if you provide a reduced test case?

Dave

Dave Mandelin

unread,
Aug 28, 2012, 7:51:46 PM8/28/12
to mozilla.dev.t...@googlegroups.com, dev-tech-...@lists.mozilla.org
On Tuesday, August 21, 2012 8:40:13 AM UTC-7, Ankur rungta wrote:

unknow...@gmail.com

unread,
Aug 29, 2012, 6:35:31 AM8/29/12
to dev-tech-...@lists.mozilla.org
Hi,

The problem that was happening is that we build js libs with single thread and we were using 1 thread to create the context and the global object and the other thread to call GC.
When JS_THREADSAFE is not used while building js in case we use 2 threads then it will result into the above crash.

Now I am using JS_THREADSAFE always while building

Thanks,
Ankur.

Dave Mandelin

unread,
Aug 29, 2012, 2:26:46 PM8/29/12
to dev-tech-...@lists.mozilla.org
Cool. Note that in newer versions (Firefox 12 and later), JSRuntimes are single-threaded, so working with objects on one thread and calling GC on another will not work.

Dave

Dave Mandelin

unread,
Aug 29, 2012, 2:26:46 PM8/29/12
to mozilla.dev.t...@googlegroups.com, dev-tech-...@lists.mozilla.org
On Wednesday, August 29, 2012 3:35:32 AM UTC-7, unknow...@gmail.com wrote:
0 new messages