Spidermonkey compilation failure

@ricardo , amazing, thanks!

If you happen to use or check my Gist, keep in mind that I tried both debug and release builds with no success.

But really, thank you!

@ricardo, do you know when will you be able to help with the compilation? I know it’s busy times, but I’d really appreciate it. :smile:

Thank you anyways!

perhaps today :slight_smile: … let me try …

@ruluk:
I didn’t have to change the target in order to make it work on tvOS.
I’ve just tried js-tests (with and changes in the js-code, not in spidermonkey) and it works on tvOS

Oh, @ricardo, really sorry. My problem is not with tvOS (that was another user), my issue is that I need a debug version of Spidermonkey to run with Cocos2D-JS for Android, especially version 3.5, which is the one I use right now.

@ruluk ha… sorry :slight_smile: I’ll try it tomorrow.

@ricardo , sorry to be so bothersome, but have you had any chance to try it yet? I know how holidays work, don’t worry. :smile:

sorry, I’ll try it right now :smile:

@ruluk
Ok. I tried compiling it but I think the master branch of my spidermonkey repo is outdated.

@pandamicro
For v3.10, which SpiderMonkey repo are we using ? Thanks.
I think we should stop using my repo, and move it to github.com/cocos2d/spidermonkey

@ricardo, wait, I’m not using Cocos 3.10. Don’t worry, your Spidermonkey (v33 or 34) is fine for my needs because I am using Cocos 3.5, which supposedly used that version. In fact, if you are remotely able to test your Spidermonkey in Android with Cocos2D-JS 3.5, that would be awesome!

@ruluk sorry, but I don’t test things cocos2d-x v3.5, not because I cannot, but basically we don’t patch those versions. Even if there is a bug, we wouldn’t fix it in v3.5… we would fix in v3.10.

my suggestion is that you post the traceback here… I might know what’s happening by taking a look at it.
thank you for your understanding.

@ricardo, don’t worry bud. BUT read on, please. Bear with me just a little more. :persevere:

The issue won’t be solved because it is from a deprecated feature (Facebook plugin-x). And that is fine, I’m not asking anyone, nor you, to help me in the issue itself. After some particular events with the plugin, the app crashes and no useful message is given, except some hints that it may be a garbage-collection issue from Spidermonkey, i.e. some bad C++ code from the Facebook plugin-x. That is why I need a debug version of Spidermonkey 33 or 34, to know where and how is that GC crash happening.

That is still fine, I can build a debug version of Spidermonkey myself, and it seems to run when I test it in a standalone Android app. But that leads me to where all this conversation began. When I test even the non-debug build of Spidermonkey 33 (your commit, that one we discussed several weeks ago) by replacing the original library files in Cocos2D, the app crashes at startup.

And I don’t understand how it can be. If Cocos2D-JS v 3.5 uses the exact same Spidermonkey 33 version you have in your repository, building my own copy shouldn’t make the app crash. That was my original question from this thread.

My new question is this: do you know where can I find the source files of the Spidermonkey version they have *actually been using?*

Sorry again to be so bothersome, but you may be my only help at making this work.

@Ruluk
I’m not 100% sure that cocos2d-x v3.5 is using spidermonkey 33.

In fact, this thread triggered this issue: we are not tagging the spidermonkey versions so we cannot reproduce bugs. Will be fixed in v3.10 onwards.

So, my guess is that it is crashing because it is not using the correct version. If you compile in release mode, does it work ?

@pandamicro any idea which spidermonkey is being used by cocos2d-x v3.5?

Oh, well, @ricardo , it seems @pandamicro is pretty busy. As for your question, yeah, I did try in release mode with no success. I guess I could try downloading several versions of Spidermonkey to see if one of them does it. But I imagine the version in your repository has some changes that the standard Spidermonkey doesn’t, so I’m very skeptic about this.

so, if release doesn’t work then it is not a bug in the debug-mode version.
I think you are just using the incorrect version.

So, v3.5 was released in March 2015, about 10 ~ 11 months ago.
So, try @pandamicro repo from that date:

@ricardo , it didn’t work either. It also crashes before starting, just like your version. I also tried using v34 but the compiler gives an error at compile time, so version 33 is definitely the right one. Nevertheless, it still crashes… :pensive:

Shame @pandamicro is so unavailable and can’t reveal how he actually compiled the version used in Cocos.

Thanks for your help, Ricardo.

@pandamicro is on holidays at the moment (Chinese new year, but I think he will be back next week)

@Ruluk

Really sorry, I was working on another project and haven’t been watching the forum for a while. Just heard from Riq about your problem.

So I have tried to generate the debug version of Android Spidermonkey, I can confirm the same issue that you met, it can successfully compiled, but can’t run with Cocos2d-x project. I receive a Fatal signal 11 (SIGSEGV) at 0x00000001 (code=1) error message which doesn’t help a lot.

However Mac Spidermonkey debug build can run successfully.

I don’t know yet where exactly the problem is, but I will investigate into this problem.

Again, sorry for not noticing about your discussion.

EDIT: I found the crash was caused by JS_NewContext in ScriptingCore::createGlobalContext, but I don’t know what is wrong with it. @Ruluk You mentioned that you have created a standalone application which runs correctly, can you share how you create the context in it ?

@pandamicro

I know I’m sneaking in another topic :frowning: While you are in a mindset for Spidermonkey compilation do you think you could also look at this? I’ve spent hours on it but only coming out with more errors…

Appreciate and again sorry for the cross topic :wink:

@pepeek I have replied in your topic