Subj : JS_THREADSAFE / assertion failed on rt->gcRunning To : netscape.public.mozilla.jseng From : smaraux Date : Thu Mar 03 2005 09:29 am I meet some difficulties regarding threads and spidermonkey engine. When I try to allocate a new GC thing object (string, double, object) it may crash on an "assertion failed". I have built a multithreaded DLL project (under vc6) and linked with standard build of js32.lib which seemed to be built as multithreaded DLL too. When I run my program, it crashes after a few seconds, on an assertion failed to know if gc is running: JS_ASSERT(!rt->gcRunning); I have read following post, where you can read that building js with JS_THREADSAFE and NSPR or a small replacement for it could fix my problem : http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&selm=7be32359.0403171719.2ef8666%40posting.google.com However, I don't understand why js is built as multithreaded but without this tag in its default configuration, if it's unsafe. Moreover latest NSPR static binaries are not valid on the ftp (I can link js to dll ones, but not static ones), and I don't want additional dlls in my project. I also mention that however my environement is multithreaded, I am using js only in a single thread of my program but it still crashes. Is there a way to fix this without compiling js with NSPR or its "patch replacement"? If someone had the required files mentionned in the above post for win32 plateforms (win98/2k), it would be great, because I don't have a great experience with threads under windows, and I am not able to rewrite all these 12 functions. Also, is there some detailed doc on how to use JS_BeginRequest / JS_EndRequest other than js-c api reference ? I understand that it should be placed to bracket maximum non blocking chunk of code, but for example if I set members of an object from another , without knowing their number in advance, can it be considered as non blocking (or short enough) calls ? Or should I test for array size before calling JS_BeginRequest. If their is too many elements, must I break it in several smaller calls (this could be an issue as I have to handle a lot of different arrays types). I'll now try older versions of NSPR, but I am afraid that it will greatly increase my code footprint to link with NSP lib. Thanks for reading, and for any help Sebastien MARAUX .