SpiderMonkey works as Debug-build, not as Release-build

Hi,

I have build SpiderMonkey 1.7 as a static library using VS2005 to make a 
macro plugin for Notepad++.

What I did was:
- Downloaded js-1.7.0.tar.gz
- I added a new static library project to my project
- Included the required files (used js.mak as reference for this)
- Added jsautokw.h from a nmake build
- Made some minor modifications to
   - jstypes.h: remove __declspec()
   - jsapi.c: remove DllMain()
   - prmjtime.c: added <windows.h>

As a debug-build, everything works great.

But as a release-build it crashes when JS_EvaluateScript() is called 
even with a script as simple as "var x=0;". When it is called with an 
empty script or only comments the release-build also works.

I have build with all sorts of defines, I have added the JSMiniNSPR 
library as suggested in a post here of June 2007. With everything I 
tried, the debug-build keeps on working, but the release-build keeps on 
crashing.

I assume there is something wrong with the project settings, but I 
haven't got a clue where to look. You probably need more info, but I 
don't know what. Can anyone help?

Regards,
Frank
0
Frank
11/4/2008 1:20:51 PM
mozilla.dev.tech.js-engine 2055 articles. 0 followers. Post Follow

3 Replies
869 Views

Similar Articles

[PageSpeed] 36

On Nov 4, 7:20=A0am, Frank Fesevur <nos...@fesevur.com> wrote:
> I have build with all sorts of defines, I have added the JSMiniNSPR
> library as suggested in a post here of June 2007. With everything I
> tried, the debug-build keeps on working, but the release-build keeps on
> crashing.
>
> I assume there is something wrong with the project settings, but I
> haven't got a clue where to look. You probably need more info, but I
> don't know what. Can anyone help?

You need to figure out where and how it's crashing. Catch the crash in
the debugger and grab a copy of the stack. You can make a release
build with debug symbols, if you poke around in the project settings;
that will provide even better information.

-j
0
Jason
11/4/2008 4:14:02 PM
Jason Orendorff schreef:
> You need to figure out where and how it's crashing. Catch the crash in
> the debugger and grab a copy of the stack. You can make a release
> build with debug symbols, if you poke around in the project settings;
> that will provide even better information.

I found the point of failure! It is in jsparse.c at line 967, 
data->u.var.fun is a null pointer and the next line fun->u.i.nvars is 
called which causes the crash.

According to the comments this has something to do with the declaration 
of variables. So I altered my script and when I remove the "var i;" line 
from it, the program doesn't crash and the script runs.

But the strange part for me is that this part of the code is not used in 
the debug build with the "var i;" line in the script.

Regards,
Frank
0
Frank
11/4/2008 10:46:16 PM
Don't forget two things, when building the JS Library, and builing your 
"host" project.

1- If using DEBUG flag in JS library, some of the JavaScript objects 
change size, so ALL your code using JavaScript API must be coherent: 
JavaScript includes must all be compiled  with DEBUG defined.
You should check that all your Windows compilation is coherent with that 
point.

2- when using debug on Windows, all the "debug code" use Debug Dlls. The 
malloc and the free's MUST be done with the same CRT Library (or it will 
crashe or assert). Check this with "depends.exe". (If you see CRT.DLL 
and CRTD.DLL, you will have troubles by example). On the contrary, if 
the free and the malloc are done by the same debug/release context, it 
works.

So as Jason said, the best is to use the debugger, wich will point the 
problem, but you should also check this two points.

Regards,
S�bastien Marinier

> Hi,
> 
> I have build SpiderMonkey 1.7 as a static library using VS2005 to make a 
> macro plugin for Notepad++.
> 
> What I did was:
> - Downloaded js-1.7.0.tar.gz
> - I added a new static library project to my project
> - Included the required files (used js.mak as reference for this)
> - Added jsautokw.h from a nmake build
> - Made some minor modifications to
>   - jstypes.h: remove __declspec()
>   - jsapi.c: remove DllMain()
>   - prmjtime.c: added <windows.h>
> 
> As a debug-build, everything works great.
> 
> But as a release-build it crashes when JS_EvaluateScript() is called 
> even with a script as simple as "var x=0;". When it is called with an 
> empty script or only comments the release-build also works.
> 
> I have build with all sorts of defines, I have added the JSMiniNSPR 
> library as suggested in a post here of June 2007. With everything I 
> tried, the debug-build keeps on working, but the release-build keeps on 
> crashing.
> 
> I assume there is something wrong with the project settings, but I 
> haven't got a clue where to look. You probably need more info, but I 
> don't know what. Can anyone help?
> 
> Regards,
> Frank
0
Sebastien
11/5/2008 3:42:50 PM
Reply:

Similar Artilces:

CB2007 Debug build the exe is smaller than the Release build.
Any reason why a Debug build using C++ Builder 2007 and TMS Unicode Components results in a smaller exe? Should not the *Release* build be the smaller file? <Jason Goff> wrote in message news:40114@forums.codegear.com... > Any reason why a Debug build using C++ Builder 2007 and TMS Unicode Components > results in a smaller exe? Should not the *Release* build be the smaller file? I think the major reason is that release version contains inlined and possibly non-inlined versions of the functions it decided to inline. Typically debug version is built with all functions out...

VS Builds, and Builds, and Builds
Hello, Has anyone else had this problem?  After a while of developing, and I go to compile, VS takes forever to build and I have to end-task it.  It's definitely after I've been working for a while, then it finally has "had it" and just takes forever to build.  It's annoying as I know its not the machine (2.8 GHZ processor and 1GB RAM).  Has anyone else experienced this problem?  By the way, I do have SP1 installed. Also, after minimizing and switching around screens, when it does this, the building icon in the status bar doesn't show.  And, for more informati...

superreview requested: [Bug 248528] JS strict warnings should be on (at least for chrome) in debug builds : [Attachment 208020] Set showInConsole to true for Firefox debug builds
Daniel Cater <DJCater@Gmail.com> has asked Benjamin Smedberg [:bs] (bsmedberg@) <benjamin@smedbergs.us> for superreview: Bug 248528: JS strict warnings should be on (at least for chrome) in debug builds https://bugzilla.mozilla.org/show_bug.cgi?id=248528 Attachment 208020: Set showInConsole to true for Firefox debug builds https://bugzilla.mozilla.org/attachment.cgi?id=208020&action=edit ------- Additional Comments from Daniel Cater <DJCater@Gmail.com> Yeah, I've changed my mind too, strict isn't useful really, and produces far too many messages. ...

superreview cancelled: [Bug 248528] JS strict warnings should be on (at least for chrome) in debug builds : [Attachment 208020] Set showInConsole to true for Firefox debug builds
Benjamin Smedberg [:bs] (bsmedberg@) <benjamin@smedbergs.us> has cancelled Daniel Cater <DJCater@Gmail.com>'s request for superreview: Bug 248528: JS strict warnings should be on (at least for chrome) in debug builds https://bugzilla.mozilla.org/show_bug.cgi?id=248528 Attachment 208020: Set showInConsole to true for Firefox debug builds https://bugzilla.mozilla.org/attachment.cgi?id=208020&action=edit ...

Help with building SpiderMonkey JS engine
Hi all, I'm currently working on a project involving the integration of the SpiderMonkey JS engine with an Apache module I've made. I'm using Debian sarge currently. I have installed the package libsmjs-dev to get the JS API. Unfortunately, whenever I try to compile even the sample code, it gives me a whole lot of errors in the library files. The first error it gives is /usr/include/smjs/jstypes.h:224:6: #error "Must define one of XP_BEOS, XP_MAC, XP_OS2, XP_WIN or XP_UNIX" I figure this is due to the fact that I've not built the JS engine. Does an...

superreview cancelled: [Bug 248528] JS strict warnings should be on (at least for chrome) in debug builds : [Attachment 207896] Set showInConsole to true for Firefox debug builds and strict to true f
Benjamin Smedberg [:bs] (bsmedberg@) <benjamin@smedbergs.us> has cancelled Daniel Cater <DJCater@Gmail.com>'s request for superreview: Bug 248528: JS strict warnings should be on (at least for chrome) in debug builds https://bugzilla.mozilla.org/show_bug.cgi?id=248528 Attachment 207896: Set showInConsole to true for Firefox debug builds and strict to true for all debug builds https://bugzilla.mozilla.org/attachment.cgi?id=207896&action=edit ------- Additional Comments from Benjamin Smedberg [:bs] (bsmedberg@) <benjamin@smedbergs.us> I agree with AJ: sh...

superreview requested: [Bug 248528] JS strict warnings should be on (at least for chrome) in debug builds : [Attachment 207896] Set showInConsole to true for Firefox debug builds and strict to true f
Daniel Cater <DJCater@Gmail.com> has asked Benjamin Smedberg [:bs] (bsmedberg@) <benjamin@smedbergs.us> for superreview: Bug 248528: JS strict warnings should be on (at least for chrome) in debug builds https://bugzilla.mozilla.org/show_bug.cgi?id=248528 Attachment 207896: Set showInConsole to true for Firefox debug builds and strict to true for all debug builds https://bugzilla.mozilla.org/attachment.cgi?id=207896&action=edit ------- Additional Comments from Daniel Cater <DJCater@Gmail.com> all-thunderbird.js already has showInConsole set to true. I didn...

Debug Build vs Release Build in ASP.NET 2.0
When building an ASP.NET web app with VS2003 I was able to specify whether I wanted a debug build or a release build from either Build|Configuration Manager or using the drop down list on the toolbar. This is turn determined whether the DLL containing the code-behind classes contained debug info, or not.Now that I'm using ASP.NET 2.0 under VS2005 this option isn't obviously available for web projects so assuming that I wanted debug info compiled into the assemblies containing the code-behind classes, am I right to assume this option is now determined by the    <compilation ...

XE6 64bit: Release Build runs, but Debug Build does not. Problem with DLLs?
Hi I have a VCL-form-application project, which is building (compiling and linking) nicely in both, debug mode and release mode. However, the debug executable does immediately quit after pressing F9 (without any warning message), while the release executable brings up the main form as expected and is running perfectly. With the release build I had the same issue before I put two needed DLLs into the release folder. (Why did I get no warnings that the DLLs are missing?) I copied the DLLs into the Debug folder, too, but it does not help in this case. What is going on? Thank you for hel...

WebGL works on debug build but not on normal build with Intel C++. Anyone have any ideas why?
So in FF33, ICC builds no longer work properly as WebGL crashes whenever used. In my attempt to debug this, creating a debug build (with enable-debug) and trying to document a crash, I find that WebGL runs fine on the build. Anyone know if there are possibly any preferences enabled/disable between a debug and a release build that would make WebGL work/not work? ...

build flags for release builds
Hi, We would like to release a preview version of our extension (xforms) to run on FF3 beta 3. However, if we build our extension on a tree we pulled using the beta 3 tag (FIREFOX_3_0b3_RELEASE) and install the extension on the beta3 build that we downloaded from mozilla.org we get varying degrees of success. A windows build will work. A linux one will crash. I can't remember exactly what happened on mac...it didn't work so well, but I don't think it crashed. However, running the .xpi on the tree that we built runs just fine in all instances. So I'm gue...

Building with --noftu on engineering builds
Hi team(s), I've raised a bug about building the Engineering builds with the "--noftu" flag. If this will affect or if you are in favour of it then please comment in this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=876723 Thanks, Zac ...

superreview requested: [Bug 54828] Build should default to non-debug/optimized build. : [Attachment 146531] Build moz optimized & non-debug by default
Chris Seawood <cls@seawood.org> has asked Daniel (Leaf) Nunes <leaf@mozilla.org> for superreview: Bug 54828: Build should default to non-debug/optimized build. http://bugzilla.mozilla.org/show_bug.cgi?id=54828 Attachment 146531: Build moz optimized & non-debug by default http://bugzilla.mozilla.org/attachment.cgi?id=146531&action=edit ...

superreview granted: [Bug 54828] Build should default to non-debug/optimized build. : [Attachment 146531] Build moz optimized & non-debug by default
Daniel (Leaf) Nunes <leaf@mozilla.org> has granted Chris Seawood <cls@seawood.org>'s request for superreview: Bug 54828: Build should default to non-debug/optimized build. http://bugzilla.mozilla.org/show_bug.cgi?id=54828 Attachment 146531: Build moz optimized & non-debug by default http://bugzilla.mozilla.org/attachment.cgi?id=146531&action=edit ------- Additional Comments from Daniel (Leaf) Nunes <leaf@mozilla.org> woot. so --disable-debug is a noop now. has this been announced as upcoming in the newsgroups? (obviously, i haven't been keeping up...

Web resources about - SpiderMonkey works as Debug-build, not as Release-build - mozilla.dev.tech.js-engine

Latest CA ERwin Release Builds Foundation for Strong Data Governance
CSO Australia - News, Industry Blogs, Tools and Resources for Data Security Executives

CyanogenMod 10.1 Moving Out of Release Candidate Phase, Moving Into General Release Builds
Goodbye quasi-beta aka Release Candidate “RC” builds of CyanogenMod 10.1 , hello official general release. Tonight, official general builds are ...

New Apple iOS 8.4 Release Builds Bigger Beats Mystery
New Apple iOS 8.4 Release Builds Bigger Beats Mystery

Facebook Home leak: pre-release build available for download - BGR
Everyone who just can't wait to get their hands on Facebook Home can now download a pre-release version of the software that's apparently "buggy ...

Microsoft Surface 2 tipped as cautious BUILD release
... of a second-generation Surface tablet for Windows 8, readying the device for a reveal at this year’s BUILD developer conference. A release of ...

Microsoft Hints At Faster Windows 10 Build Releases
Microsoft’s Gabe Aul hinted today at faster releases of new builds of the company’s Windows 10 operating system. The company’s public testing ...

Techmeme: Rumor: Apple issuing pre-release builds of OS X 10.4.10 (Justin Berka/Ars Technica)
The web's technology news site of record, Techmeme spotlights the hottest tech stories from all around the web on a single page.

Pressure builds on FAA to release drone rules
Like it or not, private drones are coming to U.S. airspace. The only question is how soon that happens.

AppleCare reps currently installing ‘pre-release’ iTunes 11 builds, wider launch expected soon
We’re getting word that Apple has begun seeding select AppleCare representatives with “PRERELEASE” builds of the upcoming iTunes 11 app. It is ...


Resources last updated: 11/24/2015 5:08:37 PM