Rev 1167 fails to start under linux

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Shade
Above Average
Above Average
Posts: 31
Joined: Sun Jun 24, 2007 7:29 pm

Rev 1167 fails to start under linux

Post by Shade »

Rev 1167 fails to start under linux, after building the debian (For Unstable) packages. It seems to be an assert in the Javascript engine. The console tells me:

oolite: src/Core/Scripting/OOJavaScriptEngine.m:565: -[OOJavaScriptEngine init]: Assertion `JS_CStringsAreUTF8()' failed.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

New code for JavaScript has been incorporated by Ahruman very recently. The requirement to run this new code is to utilize the SpiderMonkey JavaScript library version 1.70, compiled with the JS_C_STRINGS_ARE_UTF8 macro defined.

This means, that you will have to rebuild libjs (I don't remember exactly how it is called in Linux). The 1.70 JavaScript source code is already inserted in the SVN main tree, but as far as I know there is no Linux binary version available yet. Any versions older than 1.70 will most likely fail to work.
User avatar
Shade
Above Average
Above Average
Posts: 31
Joined: Sun Jun 24, 2007 7:29 pm

Post by Shade »

another_commander wrote:
New code for JavaScript has been incorporated by Ahruman very recently. The requirement to run this new code is to utilize the SpiderMonkey JavaScript library version 1.70, compiled with the JS_C_STRINGS_ARE_UTF8 macro defined.

This means, that you will have to rebuild libjs (I don't remember exactly how it is called in Linux). The 1.70 JavaScript source code is already inserted in the SVN main tree, but as far as I know there is no Linux binary version available yet. Any versions older than 1.70 will most likely fail to work.
I have version 1.8.1-- It must not have that macro defined. I suppose I could rebuild that .deb from source...
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

It seems to be a little bit more complicated than this. The Debian maintainers have done something to the code. Frankly it's a little (lottle?) bit over my head:

http://groups.google.com/group/mozilla. ... f7a0999b12

I'm going to try and uninstall the Debian version and get the "official" version from Sourceforge.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

That message refers to another issue, which is caused by a change in the data layout used by SpiderMonkey. It is important to build against the same headers used to build the SpiderMonkey library, in particular the same jsautocfg.h. I’d suggest building it as a static library using the source in {oolite-src}/deps/Cross-platform-deps/SpiderMonkey/js. (Sorry, should’ve mentioned that earlier.)
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

Thanks. However Please, I need some more help.

I ran make in that directory, seems to have gone OK. I then ran
dpkg-buildpackage in the oolite trunk directory and installed the debs. I still got the same error.

Having run make on the js, is there something else I need to do? I'm sure there is but don't know/cannot remember what.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

I do not know how exactly you have built it, so I will try to give some basic guidance. Please forgive me if instructions below sound too simplistic or self evident.

As a first step, I would recommend doing a full rebuild of Oolite. This way, no previously compiled object files can possibly cause problems.
Then, ensure that somewhere in your makefile, where you set the compiler options, you add this definition:
-DJS_C_STRINGS_ARE_UTF8

This is necessary, because the macro is not defined anywhere, although there are plenty of places where #ifdefs containing it exist. Also note, that the file called makefile that resides in deps/Cross-platform-deps/SpiderMonkey/js/src is made for Windows and certain defines in it will need to be changed accordingly for Linux. If you just used that, without any modification, then complications are very likely. But you can use it to see how things have to be set. Remember that before building the js shared library, you must build fdlibm.

If you were using a different makefile, please post it here. Maybe we can find out what could be wrong with it.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

You’re probably still linking against the shared-library version of libjs installed on your system. You will probably need to modify the makefile for libjs to produce a static library, and modify the Oolite makefile to use it. Since I don’t use makefiles, I can’t really offer any more specific advice.
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

This is something I'm going to have to study. I've never played here before.

However, is this something that will come right in the fullness of time or am I stuck until I (or somebody) work out a solution?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I knew there was something I’d forgotten to say… the issue mentioned in the Usenet post you linked to is controlled by the macro MOZILLA_1_8_BRANCH, which should be defined when building both libjs and Oolite, or not defined when building either, but definitely must not be defined when building one but not when building the other. I recommend defining it, although I think it will work without.
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

I'm lost in witch space and need a Leviathan to rescue me!

Despite having time on my hands (enforced "take it easy" after a minor procedure) I have not been able to get anywhere with this problem.

My present situation: Any version after 1155 exits on startup because of this issue.

My question: Could somebody please expand on the info above to enable me to run the later builds of Oolite.
Then, ensure that somewhere in your makefile, where you set the compiler options, you add this definition:
-DJS_C_STRINGS_ARE_UTF8
This is in the makefile.
Remember that before building the js shared library, you must build fdlibm.
What's this please and how do I do it?
It is important to build against the same headers used to build the SpiderMonkey library, in particular the same jsautocfg.h. I’d suggest building it as a static library using the source in {oolite-src}/deps/Cross-platform-deps/SpiderMonkey/js.
I assume that this means that I need to do more than run Make.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

davcefai wrote:
Remember that before building the js shared library, you must build fdlibm.
What's this please and how do I do it?
fdlibm is a math library for machines that support IEEE 754 floating point arithmetic. libjs is using it as a dependency and therefore requires it in order to build. I am actually a bit surprised that you got to build libjs without building fdlibm first. As Ahruman has already pointed out earlier, are you absolutely sure that you are not linking against any previously installed libraries? The source of this library is included in the trunk under deps/Cross-platform-deps/SpiderMonkey/js/src/fdlibm. You build this, then you point the libjs makefile to where the library has been created in order for libjs to use it to link. Have a look at the makefile in the above folder, but be aware that it contains Windows specific defines.

In addition, be sure that all headers and libraries from the SVN version of libjs are visible to the compiler before any other, previously installed version equivalents.

I am sorry I cannot be more specific, I am afraid I don't know that much about Linux. If you can, please post the makefile you are using, just in case there is something very obviously strange with it.
Post Reply