You are not logged in.
Pages: 1
Windows XP PT SP3 + Delphi XE3 compiler Update 2
mORMot 2014-05-02 11:17
libnspr4.dll 361 KB 2014-03-29 13:04:00
mozjs-24.dll 2.8 MB 2014-04-25 09:22:34
--------------------------------------------
I would like to play with mustache tmpl but doesn't work for me.
==> 22 - JavaScript HTTPApi web server
http://localhost:888/root/mustache.md
http://localhost:888/root/readme.md
Server Error 500: Internal Server Error
EExternalException Exception raised:
External exception 80000003
Synopse mORMot 1.18 http://synopse.info
---------------------------------------------------
Server is now running on http://localhost:888/root
Press [Enter] to quitAssertion failure: lock != NULL, at c:/nspr/pr/src/threads/combined/prulock.c:198
Assertion failure: lock != NULL, at c:/nspr/pr/src/threads/combined/prulock.c:198
------------------------------------------------------
==> 23 - JavaScript Tests
SynSM Automated tests
-----------------------
1. SynSMAPI
1.1. Syn SMAPI:
! Exception EAccessViolation raised with messsage:
! Access violation at address 005E0509 in module 'mozjs-24.dll'. Read of address 000D4034
Generated with: Delphi XE3 compiler
Time elapsed for all tests: 36.94ms
Tests performed at 2/5/2014 17:34:42
Total assertions failed for all test suits: 0 / 0
! Some tests FAILED: please correct the code.
Done - Press ENTER to Exit
------------------------------------------------------
==> TestSQL3.exe
------------
1.2. Low level types:
- RTTI: 58 assertions passed 8.02ms
- Url encoding: 200 assertions passed 1.79ms
- Encode decode JSON: 261,910 assertions passed 3.17s
! - Mustache renderer: 5 / 44 FAILED 180.75ms
- TDocVariant: 70,457 assertions passed 547.56ms
- BSON: 245,034 assertions passed 24.45ms
Total failed: 5 / 577,703 - Low level types FAILED 3.93s
---------------------------------------------------------
Offline
I just tried all those projects with Delphi XE4, and the dll from synsm.7z (the one you are using, according to the time stamps).
With the latest nightly source code from the trunk.
Without any problem.
Are you sure your source code is in synch or that the dll are in the same folder than the executable (and there is no old version in the system path)?
Offline
it's working here when I tried it about a week ago.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
About project 22 - JavaScript HTTPApi web server
It's working fine with Delphi 7. The same project with Delphi XE3 Update 2 raises an exception (Server Error 500: Internal Server Error). At least I can test some mustache templates!
About project 23 - JavaScript Tests
Neither D3 nor D7 worked for me with the latest nightly code.
I think there's an issue in procedure TTestSynSMAPI.CompilationRoutines; (unit SynSMSelfTest.pas)
I suspect there's something weird with line 256, I put some comments at line 256 and others and I get I better result.
I don't know maybe... I realized that I do not have these "testCompileUnicode.js", "testCompileUTF8.js", "jslint.js"
// check error, which was in SM17
line 256 Check( JS_EvaluateScript(cx, global, PCChar(ansiScriptStrConcatUndefPlusNum), length(ansiScriptStrConcatUndefPlusNum), 'test', 1, rval) = JS_TRUE, 'ansiScriptStrConcatUndefPlusNum');
uString := AnyTextFileToSynUnicode(scriptDir + '\testCompileUnicode.js');
Check(JS_CompileUCScript(cx, global, Pjschar(uString), length(uString), 'test', 1) <> nil, 'compile unicode file');
uString := AnyTextFileToSynUnicode(scriptDir + '\testCompileUTF8.js');
Check(JS_CompileUCScript(cx, global, Pjschar(uString), length(uString), 'test', 1) <> nil, 'compile utf8 file');
About project TestSQL3.dpr
Unfortunately D7 and D3 always show this error on item
1.2. Low level types:
--> ! - Mustache renderer: 5 / 44 FAILED 180.75ms
I suspect that line 3358 SynSelfTests.pas
for spec := 0 to High(MUSTACHE_SPECS) do begin
mustacheJsonFileName := MUSTACHE_SPECS[spec]+'.json'; (i think I don't have this file)
Offline
I tested those samples with Delphi 7, Delphi 2007 and Delphi XE4, without any problem.
Without the stack trace of the errors, it is difficult to tell what's wrong.
Could you please enable detailed map file for debug information, and check the logs?
About project 23, some .js files are indeed missing -also for me (mpv did never send all the .js).
I remember I downloaded mustache.js from github.
Those tests are not 100% validated - this is a work in progress, to be seen as a sample.
About TestSQL3.dpr, the .json files are downloaded from the Internet, directly from GitHub.
Those files are the official regression tests of mustache.
You need to be connected to Internet in order to let all TestSQL3.dpr tests pass.
Once downloaded, they won't download it later (the program checks if the file is already there locally).
Offline
I also get the error External Exception 80000003 when I open the executable file name "TestMustache.exe",my ide is xe3 up2,system is win7,but in xp sp3,it also display.
Offline
I suppose you are not using the latest .dll files.
{
-------------------------------------------------------------------------
Download the SpiderMonkey library at http://synopse.info/files/synsm.7z
and put mozjs-24.dll and libnspr4.dll files with your TestMustache.exe
-------------------------------------------------------------------------
}
Offline
program SynSMPractise;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
SynSM;
var
engMan: TSMEngineManager;
jsEng: TSMEngine;
begin
try
engMan := TSMEngineManager.Create();
jsEng := engMan.ThreadSafeEngine;
jsEng.Evaluate('var a = 0;');
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
engMan.Free();
end.
These are my practice codes,when I run it without ide,is display
"Assertion failure: lock != NULL, at c:/nspr/pr/src/threads/combined/prulock.c:198
EExternalException: External exception 80000003",if I run it in ide debug mode,it crashed in this line: "fCx.Options := [jsoVarObjFix,jsoBaseLine,jsoTypeInference,jsoIon,jsoAsmJs];".
Offline
I suppose you are not using the latest .dll files.
source code wrote:{
-------------------------------------------------------------------------
Download the SpiderMonkey library at http://synopse.info/files/synsm.7z
and put mozjs-24.dll and libnspr4.dll files with your TestMustache.exe
-------------------------------------------------------------------------
}
Yes, I just download dll from this url, and the source are from github, https://github.com/synopse/mORMot(download zip button).
Offline
All right, I will try more.
Offline
I also have a problem when starting TestMustache in Delphi XE3 .
constructor TSMEngine.Create(aManager: TSMEngineManager);
...
fCx.Options := [jsoVarObjFix,jsoBaseLine,jsoTypeInference,jsoIon,jsoAsmJs];
Error in line JS_SetOptions(@self,uint32(Value))
procedure JSContext.SetOptions(const Value: TJSOptions);
begin
JS_SetOptions(@self,uint32(Value))
end;
Value: (from debuger)
[jsoUnused5,jsoUnused11,jsoNoScriptRVal,jsoUnrootedGlobal,jsoBaseLine,jsoPcCount,(out of bound) 22,(out of bound) 25]
Offline
I also have a problem when starting TestMustache in Delphi XE3 .
constructor TSMEngine.Create(aManager: TSMEngineManager); ... fCx.Options := [jsoVarObjFix,jsoBaseLine,jsoTypeInference,jsoIon,jsoAsmJs];
Error in line JS_SetOptions(@self,uint32(Value))
procedure JSContext.SetOptions(const Value: TJSOptions); begin JS_SetOptions(@self,uint32(Value)) end;
Value: (from debuger)
[jsoUnused5,jsoUnused11,jsoNoScriptRVal,jsoUnrootedGlobal,jsoBaseLine,jsoPcCount,(out of bound) 22,(out of bound) 25]
Yes, like to me.
Offline
There are no problems in XE6, sample TestMustacheUnit runs very well!
Offline
I can confirm the exception for JS_SetOptions on Delphi XE 3
Offline
Somebody REALLY need SM for XE3?
No but it's not reassuring that a specific Delphi version crashes
Anything we can do to try to debug this issue ?
Also, perhaps this should be prominently written somewhere to avoid people thinking either they got the wrong DLLs or the code is not working at all.
Offline
Sounds really like a XE3 bug.
Did you try with diverse compilation options (like debug/release mode, with or without optimization, etc...).
Could you try
JS_SetOptions(@self,uint32(Value) and pred(1 shl (ord(high(TJSOption))+1)));
But if what you show is real, then XE3 seems to pass a totally wrong/random value to the method...
So this won't be enough.
Offline
I've tried multiple compilation options without any success. I've also tried disabling IDEFixPack without success.
The new code doesn't change anything either. And indeed, it looks like a wrong value is passer to the method.
So this is what I tried and it fixed the problem is:
- Make JSContext.SetOptions public
- In TSMEngine.Create call it instead of assigning to the property
Not sure how this can be explained.
Offline
I've made the following modification for XE3:
http://synopse.info/fossil/info/af94b213a1
BTW, did you try to define the method as such:
procedure JSContext.SetOptions(Value: TJSOptions);
(i.e. without the "const")
Offline
BTW, did you try to define the method as such:
procedure JSContext.SetOptions(Value: TJSOptions);
(i.e. without the "const")
Unfortunately this still produces an exception in XE3.
Offline
Pages: 1