You are not logged in.
The situation remains the same after Updating to mORMot '1.18.2988'...
Using mORMot '1.18.2923', if compiled with Delphi XE or Berlin, SpiderMonkey45Binding gives various errors. Could you help to check ?
The screen shots can be seen at imgur.
http://imgur.com/a/ILNimThe content of SpiderMonkey45Binding_MemoryManager_EventLog.txt is
https://gist.github.com/anonymous/2bcec327762a4a6ff8f28eb9e8d87aa9PS: If compiled with Delphi 7, SpiderMonkey45Binding runs fine.
Using mORMot '1.18.2923', TestSynSM gives "TSMEngine error: [JSError 110] mustache.js (533): function renderSection does not always return a value" at certain circumstances. Could you help to check ?
2. SynSM
2.1. Syn SM:
- Create sm engine: 9 assertions passed 13.39ms
- External object: 43 assertions passed 17.96ms
- Sm value transformation: 90,020 assertions passed 998.53ms
- Script evaluation: 14 assertions passed 1.15ms
! Syn SM - Load mustache template
! Exception ESMException raised with messsage:
! TSMEngine error: [JSError 110] mustache.js (533): function renderSection does not always return a value
! Syn SM - Run mustache template
! Exception ESMException raised with messsage:
! TSMEngine.MakeObject(value: not an object)
- Run techempower template: no assertion 3.14ms
- Array buffer support: 1,698 assertions passed 5.17ms
- Abort on timeout: 4 assertions passed 2.00s
Total failed: 1 / 91,790 - Syn SM FAILED 3.77sThe log files are given in gist:
TestSynSM.exe compiled by Delphi 7 and run in IDE ======= OK
d_7_inIDE
https://gist.github.com/anonymous/8bbae1353fc7648ad14458ad889e203dTestSynSM.exe compiled by Delphi 7 and run in CMD ======= Exception
d_7_inCMD
https://gist.github.com/anonymous/bced428013a81af71bf36dfbd4195ff8TestSynSM.exe compiled by Delphi Berlin and run in IDE with debugger ======= OK
d_berlin_inIDE_debugger
https://gist.github.com/anonymous/b74fb5cc637a2764c8709091ee71d2f1TestSynSM.exe compiled by Delphi Berlin and run in IDE without debugger ======= Exception
d_berlin_inIDE_nodebugger
https://gist.github.com/anonymous/a8d35aa5a75317191ef987dc2ad589ddFpcup now van apply a RTTI patch to get the RTTI needed for mORMot !
fpclazup.exe --fpcURL="trunk" --lazURL="trunk" --installdir="c:\fpctrunkrtti" --getfullrepo --fpcPATCH="fpcrtti.patch"
should give you a full featured FPC/Laz trunk combo capable of running the full mORMot !!
The patch should work on all FPC version >= 3.
It is such a great news from you !
Is it possible to have a CodeTyphon distribution with RTTI out of the box ?
Thank you very much for your information ! After removing the Together Refactoring, navigating through mORMot becomes feasible again ! ![]()
Dear ab and mpv, thank you for your kind help very much !
Dear mpv, sorry that I did not realize that I should not feed BOM into TSynAnsiConvert.UTF8ToAnsi !...
Dear mpv, thank you for our comment ! I have checked but but I do not think AnyTextFile* is related here.
My question is essentially why TSynAnsiConvert.Engine(CODEPAGE_US).UTF8ToAnsi converts the UTF8 five bytes 0xEF, 0xBB, 0xBF, 0xC2, 0xA9 to the UTF8 two bytes 0xC2, 0xA9, instead of the ANSI single byte 0xA9. Could you help to comment ?
The post is edited in order to make things clearer. Thank you for your efforts !
The code page involved is 1252, and the character involved is the Copyright sign.
The file Tiny.pas is ANSI-encoded and contains a single Copyright sign. That is to say, its content is a single byte 0xA9.
The TinyUTF8WithoutBOM.pas contains the UTF8-encoded Copyright sign but without the UTF8 BOM, i.e., two bytes 0xC2, 0xA9.
The TinyUTF8WithBOM.pas contains the UTF8-encoded Copyright sign and with the UTF8 BOM, i.e., five bytes 0xEF, 0xBB, 0xBF, 0xC2, 0xA9.
The call to TSynAnsiConvert.Engine(CODEPAGE_US).AnsiToUTF8 will convert this single byte 0xA9 to two bytes, i.e., 0xC2, 0xA9.
More importantly, the call to TSynAnsiConvert.Engine(CODEPAGE_US).UTF8ToAnsi will convert the two bytes 0xC2, 0xA9 back to the original single byte 0xA9. Everything is perfect till now.
However, the call to TSynAnsiConvert.Engine(CODEPAGE_US).UTF8ToAnsi will convert the five bytes 0xEF, 0xBB, 0xBF, 0xC2, 0xA9 to the two bytes 0xC2, 0xA9 instead of the original single byte 0xA9. Could you help to comment whether this behavior is a bug ?
program Project1;
{$APPTYPE CONSOLE}
uses FastMM4, SynCommons, mORMot, SysUtils;
begin
SynCommons.FileFromString(
TSynAnsiConvert.Engine(CODEPAGE_US).AnsiToUTF8(SynCommons.StringFromFile('Tiny.pas')),
'TinyUTF8WithoutBOM.pas');
SynCommons.FileFromString(
TSynAnsiConvert.Engine(CODEPAGE_US).UTF8ToAnsi(SynCommons.StringFromFile('TinyUTF8WithoutBOM.pas')),
'TinyConvertedBackFromUTF8WithoutBOM.pas');
SynCommons.FileFromString(
TSynAnsiConvert.Engine(CODEPAGE_US).UTF8ToAnsi(SynCommons.StringFromFile('TinyUTF8WithBOM.pas')),
'TinyConvertedBackFromUTF8WithBOM.pas');
end.PS:
Probably the two occurrences of "{$ifdef USESEMTRYWAIT}" in SynCommons.FixedWaitFor source code should be "{$ifndef USESEMTRYWAIT}" ?
Thank you very much for your comment !
It seems that the test code should call "Event.ResetEvent;" in order to work under CentOS 5/6/7 when compiled with Kylix. Not sure why the call to "Event.ResetEvent;" is not needed to work under Windows when compiled with Delphi...
SynCommons.FixedWaitFor(Event, 2 * 1000); Event.ResetEvent;
SynCommons.FixedWaitFor(Event, 2 * 1000);It seems that SynCommons.FixedWaitFor doesn't work under CentOS 5/6/7 when compiled with Kylix:
The following code tries to run a loop for three times, each time outputting a message before calling "FixedWaitFor" for two seconds. However, only the first call to "FixedWaitFor" works, the second and the third calls return immediately.
It should be noted that enable the define USESEMTRYWAIT in SynCommons.pas does not change the situation.
Could you help to solve this problem ? Thank you very much for your efforts !
program TestWaitFor;
{$APPTYPE CONSOLE}
{$I Synopse.inc} // define HASINLINE USETYPEINFO CPU32 CPU64 OWNNORMTOUPPER
uses
FastMM4, SynCommons, SyncObjs, SysUtils;
var I: Integer; Event: TSimpleEvent;
begin
Event := TSimpleEvent.Create;
try
for I := 1 to 3 do begin
Writeln(FormatDateTime('yyyy_mm_dd_hh_nn_ss', Now));
SynCommons.FixedWaitFor(Event, 2 * 1000);
end;
finally
Event.Free;
end;
end.In case it might be useful, the following link contains an working example of signal trapping for Kylix (not just Ctrl+C). ![]()
http://homepage3.nifty.com/isayan/kxsigroute.html
// http://homepage3.nifty.com/isayan/kylixTips.html
// http://homepage3.nifty.com/isayan/kxsigroute.html
program Kylix_Signal;
{$APPTYPE CONSOLE}
uses
LibC, SysUtils;
procedure SignalSet(func:TSignalHandler);
var
smask: TSigset;
act: TSigAction;
begin
(* Signal mask setting *)
sigemptyset(smask);
sigaddset(smask,SIGINT);
sigaddset(smask,SIGTERM);
act.__sigaction_handler := func;
act.sa_mask := smask;
act.sa_flags := 0;
(* Signal exit function registered *)
sigaction(SIGINT, @act, nil);
sigaction(SIGTERM, @act, nil);
end;
procedure SignalHandle(sig_num: integer);
begin
// Writeln('(* sig_num *) : ' + IntToStr(sig_num));
// Writeln('(* SIGTERM *) : ' + IntToStr(SIGTERM));
// Writeln('(* SIGINT *) : ' + IntToStr(SIGINT));
case (sig_num) of
-4, SIGTERM:
begin
Writeln('(* kill *)');
end;
SIGINT:
begin
Writeln('(* Ctrl+C *)');
end;
end;
end;
begin
// Setting signal
SignalSet(@SignalHandle);
Repeat
WriteLn('heheheheheeheheh');
Sleep(10000);
Until False;
end.@ab
@AOG
I have found the reason:
For the "UrlDecodeValue" case, the function need its second argument to be upper case, which I have clearly overlooked.
For the "UrlDecodeExtended" case, it should be noted first that the while-loop needs to be run multiple times. That is to say, one and only one variable gets assigned at one time. At the first time of the while-loop, the variable B could contain an extremely large or small number, and thus crashing the format function called by ILog.Log.
All in all, there is nothing wrong with mORMot ! Sorry for the confusion that I have brought. mORMot rocks ! ![]()
It is found that my problem is actually caused by a mistake, i.e., forget to publish properties... It can be solved as shown below:
Thank you very much for your help ! ![]()
TOuterObject = class(TSynPersistent)
private
FNestedObjects: TNestedObjectList;
published
property NestedObjects: TNestedObjectList read FNestedObjects write FNestedObjects;
public
constructor Create; override;
destructor Destroy; override;
end;Dear ab,
I now understand your design principle better.
Specifically, for my problem, both calls below will register a "global parser" with the key "TNestedRecord". That is to say, there will not be a "global parser" with the name ''TNestedRecordArray".
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecord), __TNestedRecord);
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecordArray), __TNestedRecord);The problem can be solved by modifying the definition of the layout of the TOuterRecord as shown below:
type
TOuterRecord = packed record
NestedRecordArray: TNestedRecordArray;
end;
const
// __TOuterRecord = 'NestedRecordArray: TNestedRecordArray';
__TOuterRecord = 'NestedRecordArray: array of TNestedRecord';Thank you very much for your efforts to help ! ![]()
Dear ab, I do not think I made the situation clear to you.
The direct cause of the problem described in the first post, i.e., failure of the line below:
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TOuterRecord), __TOuterRecord); , is the failure of the line below (which is isolated and shown in the fourth post):
TJSONCustomParserRTTI.CreateFromTypeName('NestedRecordArray', 'TNestedRecordArray'); This latter line is in your library, i.e., SynCommons.pas.
Therefore, I do not see how I can use TypeInfo(TNestedRecordArray) as input.
I wonder if you could be kind enough to try the sample code as in the first post ?
Dear ab,
the problem can be described with a much shorter program as shown below.
Could you please help to comment whether the second call to TJSONCustomParserRTTI.CreateFromTypeName should return nil by design ?
If not, could you please help me with this problem ?
program Project2;
{$APPTYPE CONSOLE}
uses
FastMM4,
SynCommons, // mORMot,
Contnrs, SysUtils;
type
TNestedRecord = packed record
Description: RawUTF8;
end;
TNestedRecordArray = array of TNestedRecord;
const
__TNestedRecord = 'Description: RawUTF8';
__TNestedRecordArray = '[Description: RawUTF8]';
var
Parser: TJSONCustomParserRTTI;
begin
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecord), __TNestedRecord);
// Make no difference.
// TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecordArray), __TNestedRecordArray);
// TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecordArray), __TNestedRecord);
// Parser created !
Parser := TJSONCustomParserRTTI.CreateFromTypeName('NestedRecord', 'TNestedRecord');
Assert(Assigned(Parser), 'Parser is nil');
// Parser = nil !
Parser := TJSONCustomParserRTTI.CreateFromTypeName('NestedRecordArray', 'TNestedRecordArray');
Assert(Assigned(Parser), 'Parser is nil');
end.Thank you for your efforts to help !
I still get the same exception:
Project Project1.exe raised exception class ESynException with message
'Unregistered ptCustom for TJSONRecordTextDefinition.AddItem(NestedRecordArray: TNESTEDRECORDARRAY)'. Process stopped. Could you please help me with this problem ?
Dear ab,
when a TSQLRecord descendant contains an array of record, which contains another array of record, I could not figure how to customize JSON serializer for nested record array from text . Could you help to comment ? Many thanks !
When using the code at the end of this post, the exception is raised as shown below:
Project Project1.exe raised exception class ESynException with message
'Unregistered ptCustom for TJSONRecordTextDefinition.AddItem(NestedRecordArray: TNESTEDRECORDARRAY)'. Process stopped. program Project1;
{$APPTYPE CONSOLE}
uses
FastMM4,
SynCommons, SynLog, SynTests, SynSQLite3, SynSQLite3Static, mORMot, mORMotSQLite3,
Contnrs, SysUtils;
type
TNestedRecord = packed record
Description: RawUTF8;
end;
TNestedRecordArray = array of TNestedRecord;
const
__TNestedRecord = 'Description: RawUTF8';
__TNestedRecordArray = '[Description: RawUTF8]';
type
TOuterRecord = packed record
NestedRecordArray: TNestedRecordArray;
end;
TOuterRecordArray = array of TOuterRecord;
const
__TOuterRecord = 'NestedRecordArray: TNestedRecordArray';
type
TSQLMainRecord = class(TSQLRecord)
private
FOuterRecordArray: TOuterRecordArray;
published
property OuterRecordArray: TOuterRecordArray read FOuterRecordArray write FOuterRecordArray;
end;
TTestManipulateNestedRecordArray = class(TSynTestCase)
published
procedure Test;
end;
TTestSuite = class(TSynTests)
published
procedure MyTestSuite;
end;
procedure TTestManipulateNestedRecordArray.Test;
var
ILog: ISynLog;
DBFileName: string;
Model: TSQLModel;
Rest: TSQLRest;
Rec: TSQLMainRecord;
RecID: Int64;
NestedRecord: TNestedRecord;
OuterRecord: TOuterRecord;
GroupA: TDynArray;
begin
ILog := TSynLog.Enter;
DBFileName := ChangeFileExt(ChangeFileExt(ExeVersion.ProgramFileName, '') +
'_' + FormatDateTime('yyyy_mm_dd_hh_nn_ss_zzz', Now),'.db3');
Model := TSQLModel.Create([TSQLMainRecord]);
try
Rest := TSQLRestClientDB.Create(Model, nil, DBFileName, TSQLRestServerDB, False);
try
TSQLRestClientDB(Rest).Server.CreateMissingTables;
Rec := TSQLMainRecord.Create;
try
RecordClear(OuterRecord, TypeInfo(TOuterRecord));
GroupA.Init(TypeInfo(TNestedRecordArray), OuterRecord.NestedRecordArray);
RecordClear(NestedRecord, TypeInfo(TNestedRecord));
NestedRecord.Description := 'string 1';
GroupA.Add(NestedRecord);
RecordClear(NestedRecord, TypeInfo(TNestedRecord));
NestedRecord.Description := 'string 2';
GroupA.Add(NestedRecord);
Rec.DynArray('OuterRecordArray').Add(OuterRecord);
RecID := Rest.Add(Rec, True);
Assert(RecID > 0, 'Error adding the data');
SynCommons.FileFromString(ObjectToJSON(Rec, [woHumanReadable, woObjectListWontStoreClassName]), 'Project1.json');
finally
Rec.Free;
end;
Rec := TSQLMainRecord.Create(Rest, RecID);
try
Check(Rec.DynArray('OuterRecordArray').Count = 1);
Check(Length(Rec.OuterRecordArray[0].NestedRecordArray) = 2);
Check(Rec.OuterRecordArray[0].NestedRecordArray[0].Description = 'string 1');
Check(Rec.OuterRecordArray[0].NestedRecordArray[1].Description = 'string 2');
finally
Rec.Free;
end;
finally
Rest.Free;
end;
finally
Model.Free;
end;
end;
procedure TTestSuite.MyTestSuite;
begin
AddCase([TTestManipulateNestedRecordArray]);
end;
begin
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecord), __TNestedRecord);
// makes no difference
// TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TNestedRecordArray), __TNestedRecordArray);
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TOuterRecord), __TOuterRecord);
with TSynLog.Family do
begin
Level := LOG_VERBOSE;
PerThreadLog := ptIdentifiedInOnFile;
RotateFileCount := 5;
RotateFileSizeKB := 20*1024; // rotate by 20 MB logs
end;
with TTestSuite.Create do
begin
try
Run;
readln;
finally
Free;
end;
end;
end.Thank you for your efforts very much !
The woObjectListWontStoreClassName does not help. The generated JSON looks like below:
{
"ID": 1,
"OuterObjects":
[{
},{
}
]
}More importantly, the nested object list can not be persisted by the ORM, as can be seen from the generated .db3 file.
Could you help to comment ?
Dear ab,
when a TSQLRecord descendant contains a TObjectList of TSynPersistent descendant, which contains a TObjectList of another TSynPersistent descendant, I could not figure how to get the correct JSON representation of the TSQLRecord. Could you help to comment ? Many thanks !
When using the code at the end of this post, the incorrect JSON representation is obtained. Specifically, the info of the NestedObject is lost. ![]()
{
"ID": 1,
"OuterObjects":
[{
"ClassName":"TOuterObject"
},{
"ClassName":"TOuterObject"
}
]
}program Project1;
{$APPTYPE CONSOLE}
uses
FastMM4,
SynCommons, SynLog, SynTests, SynSQLite3, SynSQLite3Static, mORMot, mORMotSQLite3,
Contnrs, SysUtils;
type
TNestedObject = class(TSynPersistent)
private
FDescription: RawUTF8;
published
property Description: RawUTF8 read FDescription write FDescription;
end;
TNestedObjectList = class(TObjectList)
protected
procedure SetObject (Idx: Integer; Item: TNestedObject);
function GetObject (Idx: Integer): TNestedObject;
public
function Add (Obj: TNestedObject): Integer;
procedure Insert (Idx: Integer; Obj: TNestedObject);
property Objects [Idx: Integer]: TNestedObject read GetObject write SetObject; default;
end;
TOuterObject = class(TSynPersistent)
private
FNestedObjects: TNestedObjectList;
public
property NestedObjects: TNestedObjectList read FNestedObjects write FNestedObjects;
constructor Create; override;
destructor Destroy; override;
end;
TOuterObjectList = class(TObjectList)
protected
procedure SetObject (Idx: Integer; Item: TOuterObject);
function GetObject (Idx: Integer): TOuterObject;
public
function Add (Obj: TOuterObject): Integer;
procedure Insert (Idx: Integer; Obj: TOuterObject);
property Objects [Idx: Integer]: TOuterObject read GetObject write SetObject; default;
end;
TSQLMainRecord = class(TSQLRecord)
private
FOuterObjects: TOuterObjectList;
public
constructor Create; override;
destructor Destroy; override;
published
property OuterObjects: TOuterObjectList read FOuterObjects write FOuterObjects;
end;
TTestManipulateNestedObjectList = class(TSynTestCase)
published
procedure AddNestedObjectList;
end;
TTestSuite = class(TSynTests)
published
procedure MyTestSuite;
end;
function TNestedObjectList.Add(Obj: TNestedObject): Integer;
begin
Result := inherited Add (Obj);
end;
procedure TNestedObjectList.Insert(Idx: Integer; Obj: TNestedObject);
begin
inherited Insert(Idx, Obj);
end;
procedure TNestedObjectList.SetObject(Idx: Integer; Item: TNestedObject);
begin
inherited SetItem (Idx, Item);
end;
function TNestedObjectList.GetObject(Idx: Integer): TNestedObject;
begin
Result := inherited GetItem (Idx) as TNestedObject;
end;
constructor TOuterObject.Create;
begin
inherited Create;
FNestedObjects := TNestedObjectList.Create(True);
end;
destructor TOuterObject.Destroy;
begin
FNestedObjects.Free;
inherited Destroy;
end;
function TOuterObjectList.Add(Obj: TOuterObject): Integer;
begin
Result := inherited Add (Obj);
end;
procedure TOuterObjectList.Insert(Idx: Integer; Obj: TOuterObject);
begin
inherited Insert(Idx, Obj);
end;
procedure TOuterObjectList.SetObject(Idx: Integer; Item: TOuterObject);
begin
inherited SetItem (Idx, Item);
end;
function TOuterObjectList.GetObject(Idx: Integer): TOuterObject;
begin
Result := inherited GetItem (Idx) as TOuterObject;
end;
constructor TSQLMainRecord.Create;
begin
inherited Create;
FOuterObjects := TOuterObjectList.Create(True);
end;
destructor TSQLMainRecord.Destroy;
begin
FOuterObjects.Free;
inherited Destroy;
end;
procedure TTestManipulateNestedObjectList.AddNestedObjectList;
var
ILog: ISynLog;
DBFileName: string;
Model: TSQLModel;
Rest: TSQLRest;
Rec: TSQLMainRecord;
RecID: Int64;
OuterObject: TOuterObject;
NestedObject: TNestedObject;
begin
ILog := TSynLog.Enter;
DBFileName := ChangeFileExt(ChangeFileExt(ExeVersion.ProgramFileName, '') +
'_' + FormatDateTime('yyyy_mm_dd_hh_nn_ss_zzz', Now),'.db3');
Model := TSQLModel.Create([TSQLMainRecord]);
try
Rest := TSQLRestClientDB.Create(Model, nil, DBFileName, TSQLRestServerDB, False);
try
TSQLRestClientDB(Rest).Server.CreateMissingTables;
Rec := TSQLMainRecord.Create;
try
OuterObject := TOuterObject.Create;
Rec.OuterObjects.Add(OuterObject);
NestedObject := TNestedObject.Create;
OuterObject.NestedObjects.Add(NestedObject);
NestedObject.Description := 'string 1';
NestedObject := TNestedObject.Create;
OuterObject.NestedObjects.Add(NestedObject);
NestedObject.Description := 'string 2';
OuterObject := TOuterObject.Create;
Rec.OuterObjects.Add(OuterObject);
NestedObject := TNestedObject.Create;
OuterObject.NestedObjects.Add(NestedObject);
NestedObject.Description := 'string 3';
RecID := Rest.Add(Rec, True);
Assert(RecID > 0, 'Error adding the data');
SynCommons.FileFromString(ObjectToJSON(Rec, [woHumanReadable]), 'Project1.json');
finally
Rec.Free;
end;
Rec := TSQLMainRecord.Create(Rest, RecID);
try
Check(Rec.OuterObjects.Count = 2);
Check(Rec.OuterObjects[0].NestedObjects.Count = 2);
Check(Rec.OuterObjects[0].NestedObjects[0].Description = 'string 1');
Check(Rec.OuterObjects[0].NestedObjects[1].Description = 'string 2');
Check(Rec.OuterObjects[1].NestedObjects.Count = 1);
Check(Rec.OuterObjects[1].NestedObjects[0].Description = 'string 3');
finally
Rec.Free;
end;
finally
Rest.Free;
end;
finally
Model.Free;
end;
end;
procedure TTestSuite.MyTestSuite;
begin
AddCase([TTestManipulateNestedObjectList]);
end;
begin
TJSONSerializer.RegisterClassForJSON([TOuterObject, TNestedObject]);
with TSynLog.Family do
begin
Level := LOG_VERBOSE;
PerThreadLog := ptIdentifiedInOnFile;
RotateFileCount := 5;
RotateFileSizeKB := 20*1024; // rotate by 20 MB logs
end;
with TTestSuite.Create do
begin
try
Run;
readln;
finally
Free;
end;
end;
end.Dear Arnaud,
Right now I could not find any compilable sample or test concerning the documented JsonGet / JsonSet / JsonHas. I wonder if you could add some ? They would be of great help ! Many thanks !
test_vm1@MICROSO-ABC3D4O /cygdrive/d/Dev/Lib/mORMot
$ find . -name \*.pas -print0 | xargs -0 grep -irw JsonGet
./SQLite3/mORMot.pas: // - content may be searched using JsonGet/JsonHas SQL functions on a
./SQLite3/mORMot.pas: // - content may be searched using JsonGet/JsonHas SQL functions on a
./SynSQLite3.pas:begin // JsonGet() would return the raw JSON for Delphi 5
./SynSQLite3.pas:begin // JsonGet(VariantField,'PropName') returns the value of a JSON object
./SynSQLite3.pas: // JsonGet(VariantField,'Obj1.Obj2.PropName') to search by path
./SynSQLite3.pas: // JsonGet(VariantField,0) returns the 1st item in the JSON array
./SynSQLite3.pas: // JsonGet(VariantField,'Prop1,Prop2') returns the values as a JSON object
./SynSQLite3.pas: // JsonGet(VariantField,'Prop*') returns the values as a JSON object
./SynSQLite3.pas: // JsonGet(VariantField,'Obj1.Obj2.Prop1,Obj1.Prop2') to search by path
./SynSQLite3.pas: // JsonGet(VariantField,'Obj1.Obj2.Prop*,Obj1.Prop2') to search by path
./SynSQLite3.pas: sqlite3.create_function(DB,'JSONGET',2,SQLITE_ANY,nil,InternalJsonGet,nil,nil);
test_vm1@MICROSO-ABC3D4O /cygdrive/d/Dev/Lib/mORMot
$ find . -name \*.pas -print0 | xargs -0 grep -irw JsonSet
./SynSQLite3.pas:begin // JsonSet(VariantField,'PropName','abc') to set a value
./SynSQLite3.pas: // JsonSet(VariantField,'Obj1.Obj2.PropName','def') to set by path
./SynSQLite3.pas: sqlite3.create_function(DB,'JSONSET',3,SQLITE_ANY,nil,InternalJsonSet,nil,nil);
test_vm1@MICROSO-ABC3D4O /cygdrive/d/Dev/Lib/mORMot
$ find . -name \*.pas -print0 | xargs -0 grep -irw JsonHas
./SQLite3/mORMot.pas: // - content may be searched using JsonGet/JsonHas SQL functions on a
./SQLite3/mORMot.pas: // - content may be searched using JsonGet/JsonHas SQL functions on a
./SynSQLite3.pas:begin // JsonHas(VariantField,'PropName') returns TRUE if matches a JSON object property
./SynSQLite3.pas: // JsonHas(VariantField,'Obj1.Obj2.PropName') to search by path
./SynSQLite3.pas: // JsonHas(VariantField,0) returns TRUE if the JSON array has at least one item
./SynSQLite3.pas: sqlite3.create_function(DB,'JSONHAS',2,SQLITE_ANY,nil,InternalJsonHas,nil,nil);Dear ab,
sorry for the trouble but could you help to comment whether it is possible for the " 2.10. Multi thread process:" test suite to succeed on legacy kernels of 2.6.18 ?
I mean, could you help to confirm whether the failure of the " 2.10. Multi thread process:" test suite is crucial ?
Further comparison was made and shown below:
(1) As shown in the above post, the " 2.10. Multi thread process:" test suite fails complaining "Segmentation fault" on RHEL 5.5 with kernel version 2.6.18-194.el5.
(2) The " 2.10. Multi thread process:" test suite hangs on CentOS 5.11 with kernel version 2.6.18-400.1.1.el5.
(3) The " 2.10. Multi thread process:" test suite passes on CentOS 6.5 with kernel version 2.6.32.12-x86_64-linode15 (Linode VM).
(4) The " 2.10. Multi thread process:" test suite passes on CentOS 5.6 or CentOS 6.5 with kernel version 4.1.0-x86_64-linode59 (Linode VM).
Therefore, the issue seems to be related to the kernel again...
Could you help to comment whether it is possible for the " 2.10. Multi thread process:" test suite to succeed on legacy kernels of 2.6.18 ?
Thank you for your efforts very much ! ![]()
Thanks for your efforts very much ! Now TestSQL3 proceeds much further. However, there is a segment fault at "2.10. Multi thread process". Could you help to comment about the problem ? The output and the log with line numbers have been provided... ![]()
Synopse mORMot Framework Automated tests
------------------------------------------
1. Synopse libraries
1.1. Low level common:
- System copy record: 83 assertions passed 29.00s
- TRawUTF8List: 130,009 assertions passed 107445.00s
- TDynArray: 1,082,725 assertions passed 132543.00s
- TDynArrayHashed: 1,200,629 assertions passed 70605.00s
- TObjectListHashed: 999,886 assertions passed 257372.00s
- TObjectDynArrayWrapper: 167,501 assertions passed 16932.00s
- TObjArray: 2,016 assertions passed 1116.00s
- Fast string compare: 24 assertions passed 9.00s
- IdemPropName: 189 assertions passed 25.00s
- Url encoding: 150 assertions passed 697.00s
- GUID: 9,005 assertions passed 1194.00s
- IsMatch: 599 assertions passed 105.00s
- Soundex: 35 assertions passed 9.00s
- Numerical conversions: 1,115,424 assertions passed 386694.00s
- crc32c: 30,030 assertions passed 51004.00s
pas 19060.00s 328 B/s fast 2880.00s 2172 B/s sse42 1380.00s 4533 B/s
- Curr 64: 20,053 assertions passed 956.00s
- CamelCase: 11 assertions passed 15.00s
- Bits: 4,774 assertions passed 28.00s
- Ini files: 7,004 assertions passed 60730.00s
- UTF8: 81,122 assertions passed 775938.00s
- Iso 8601 date and time: 36,017 assertions passed 3473.00s
- Time zones: 398 assertions passed 136.00s
- Url decoding: 1,100 assertions passed 174.00s
- Mime types: 23 assertions passed 19.00s
!!! Low level common - TSynTable "Access violation at address 080856E4, accessing address 00000000" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
! - TSynTable: 1 / 50 FAILED 712945.00s
- TSynCache: 404 assertions passed 89.00s
- TSynFilter: 1,005 assertions passed 3409.00s
- TSynValidate: 677 assertions passed 1246.00s
- TSynLogFile: 36 assertions passed 487.00s
Total failed: 1 / 4,890,979 - Low level common FAILED 2585679.00s
1.2. Low level types:
- RTTI: 61 assertions passed 44.00s
- Url encoding: 200 assertions passed 752.00s
- Encode decode JSON: 284,555 assertions passed 109447.00s
- Variants: 46 assertions passed 12.00s
- Mustache renderer: 144 assertions passed 81720.00s
- TDocVariant: 71,771 assertions passed 186739.00s
- BSON: 245,050 assertions passed 36222.00s
- TSynTableStatement: 205 assertions passed 74.00s
Total failed: 0 / 602,032 - Low level types PASSED 415125.00s
1.3. Cryptographic routines:
- Adler32: 1 assertion passed 9.00s
- MD5: 1 assertion passed 7.00s
- SHA1: 10 assertions passed 6497.00s
- SHA256: 8 assertions passed 9332.00s
- AES256: 12,178 assertions passed 550793.00s
- RC4: 1 assertion passed 9.00s
- Base64: 11,994 assertions passed 113557.00s
- CompressShaAes: 1,683 assertions passed 2824.00s
Total failed: 0 / 25,876 - Cryptographic routines PASSED 683087.00s
1.4. Compression:
- In memory compression: 12 assertions passed 231993.00s
- GZIP format: 19 assertions passed 474122.00s
- SynLZO: 3,006 assertions passed 53257.00s
- SynLZ: 32,221 assertions passed 511550.00s
Total failed: 0 / 35,258 - Compression PASSED 1270958.00s
2. mORMot
2.1. File based:
- Database direct access: 20,246 assertions passed 275284.00s
- Virtual table direct access: 12 assertions passed 1027.00s
- TSQLTableJSON: 144,070 assertions passed 108955.00s
- TSQLRestClientDB: 310,071 assertions passed 1497442.00s
- TRecordVersion: 20,060 assertions passed 139405.00s
Total failed: 0 / 494,459 - File based PASSED 2022171.00s
2.2. File based memory map:
- Database direct access: 20,246 assertions passed 268353.00s
- Virtual table direct access: 12 assertions passed 2941146.00s
- TSQLTableJSON: 144,070 assertions passed 104388.00s
- TSQLRestClientDB: 310,071 assertions passed 1262594.00s
- TRecordVersion: 20,060 assertions passed 136532.00s
Total failed: 0 / 494,459 - File based memory map PASSED 4713077.00s
2.3. File based WAL:
- Database direct access: 20,246 assertions passed 229259.00s
- Virtual table direct access: 12 assertions passed 957.00s
- TSQLTableJSON: 144,070 assertions passed 92167.00s
- TSQLRestClientDB: 310,071 assertions passed 1596096.00s
- TRecordVersion: 20,060 assertions passed 1665422.00s
Total failed: 0 / 494,459 - File based WAL PASSED 3583953.00s
2.4. Memory based:
- Database direct access: 20,246 assertions passed 237607.00s
- Virtual table direct access: 12 assertions passed 924.00s
- TSQLTableJSON: 144,070 assertions passed 95665.00s
- TSQLRestClientDB: 402,407 assertions passed 1837980.00s
- TRecordVersion: 20,060 assertions passed 142092.00s
- RTree: 140,000 assertions passed 2437929.00s
Total failed: 0 / 726,795 - Memory based PASSED 4752251.00s
2.5. Basic classes:
- TSQLRecord: 77 assertions passed 214.00s
- TSQLRecordSigned: 200 assertions passed 4066.00s
- TSQLModel: 16 assertions passed 21.00s
- TSQLRestServerFullMemory: 562,308 assertions passed 900038.00s
Total failed: 0 / 562,601 - Basic classes PASSED 904398.00s
2.6. Client server access:
- TSQLHttpServer: 2 assertions passed 22523.00s
using Synopse CrossPlatform Socket Layer.514
- TSQLHttpClient: 3 assertions passed 60905.00s
using TSQLHttpClientWinSock
- HTTP client keep alive: 3,087 assertions passed 206976.00s
4818 B, first 74984.00s, done 118559.00s i.e. 0/s, aver. 118.55s, 41 B/s
- HTTP client multi connect: 3,087 assertions passed 199975.00s
4818 B, first 243.00s, done 182961.00s i.e. 0/s, aver. 182.96s, 26 B/s
- HTTP client encrypted: 3,087 assertions passed 149923.00s
4818 B, first 256.00s, done 137116.00s i.e. 0/s, aver. 137.11s, 35 B/s
- Direct in process access: 3,056 assertions passed 102685.00s
4818 B, first 52.00s, done 27199.00s i.e. 0/s, aver. 27.19s, 180 B/s
- HTTP several DB servers: 9,604 assertions passed 753108.00s
4818 B, first 345.00s, done 133607.00s i.e. 0/s, aver. 133.60s, 36 B/s
4818 B, first 616.00s, done 139394.00s i.e. 0/s, aver. 139.39s, 35 B/s
4818 B, first 790.00s, done 155638.00s i.e. 0/s, aver. 155.63s, 31 B/s
Total failed: 0 / 21,926 - Client server access PASSED 1496240.00s
2.7. Service oriented architecture:
- Weak interfaces: 56 assertions passed 37.00s
- Service initialization: 255 assertions passed 72874.00s
- Direct call: 579,186 assertions passed 33877.00s
- Server side: 579,206 assertions passed 23806.00s
- Client side REST: 772,274 assertions passed 793079.00s
- Client side REST as JSON object: 772,268 assertions passed 1948470.00s
- Client side REST sessions stats: 772,268 assertions passed 1221145.00s
- Client side REST locked: 772,272 assertions passed 1955988.00s
- Client side REST main thread: 772,272 assertions passed 3633614.00s
- Client side REST background thread: 772,272 assertions passed 1980965.00s
- Client side REST weak authentication: 772,268 assertions passed 1080264.00s
- Client side REST basic authentication: 772,268 assertions passed 1147049.00s
- Client side REST custom record layout: 772,268 assertions passed 1119175.00s
- Client side REST service log to DB: 772,268 assertions passed 2282099.00s
- Client side JSONRPC: 772,268 assertions passed 1888977.00s
- Test over HTTP: 9,661 assertions passed 499727.00s
- Security: 135 assertions passed 156607.00s
- Mocks and stubs: 30,029 assertions passed 42813.00s
Total failed: 0 / 9,693,494 - Service oriented architecture PASSED 19880852.00s
2.8. Bidirectional remote connection:
- Websockets JSON protocol: 60 assertions passed 35.00s
- Websockets binary protocol: 240 assertions passed 182.00s
- Run http server: 2 assertions passed 339.00s
- SOA callback on server side: 4,452 assertions passed 963.00s
- SOA callback via JSON websockets: 4,455 assertions passed 97303.00s
- SOA callback via binary websockets: 4,455 assertions passed 106139.00s
- TRecordVersion: 20,068 assertions passed 5477462.00s
Total failed: 0 / 33,732 - Bidirectional remote connection PASSED 5682527.00s
2.9. External database:
- TQuery: 2,003 assertions passed 34810.00s
- SynDBRemote: 25,079 assertions passed 5307366.00s
- DB properties persistence: 7 assertions passed 835.00s
- External records: 2 assertions passed 168.00s
- Auto adapt SQL: 708 assertions passed 107295.00s
- Crypted database: 176,192 assertions passed 173950.00s
- External via REST: 170,354 assertions passed 20052879.00s
- External via virtual table: 170,354 assertions passed 22895000.00s
- External via REST with change tracking: 180,454 assertions passed 21897830.00s
Total failed: 0 / 725,153 - External database PASSED 27520576.04s
2.10. Multi thread process:
- Create thread pool: 1 assertion passed 2364.00s
Runtime error 231 at 0805B929
Segmentation fault/test/mormot/TestSQL3 0.0.0.0 (2015-07-27 22:19:47)
Host=login01 User=tes CPU=12/12 OS=Linux-2.6.18-194.el5#1-SMP-Tue-Mar-16-21:52:39-EDT-2010 Wow64=0 Freq=1000
TSQLLog 1.18.1699 PRTL FTS3 2015-07-27T23:43:29
20150727 23432951 EXCOS EAccessViolation (FBEE0101) at 080856E4 SynCommons.MoveX87 (30326) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0804E83C System.@WStrSetLength 080764CA SynCommons.TSynAnsiConvert.AnsiToUnicodeString (13834) 080A9A49 SynTests.TSynTestCase.RandomUnicode (666) 0814A872 SynSelfTests.TTestLowLevelCommon._TSynTable (3436) 080AA4C8 SynTests.TSynTests.Run (969) 08183AAD mORMotSelfTests.SQLite3ConsoleTests (180) 08183DF8 TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 23432952 EXCOS EAccessViolation (FBEE0101) at 080856E4 SynCommons.MoveX87 (30326) stack trace 0804D7B1 System.@LStrClr 0804D0A5 System.@HandleFinally 080A9A5C SynTests.TSynTestCase.RandomUnicode (666) 0814A872 SynSelfTests.TTestLowLevelCommon._TSynTable (3436) 080AA4C8 SynTests.TSynTests.Run (969) 08183AAD mORMotSelfTests.SQLite3ConsoleTests (180) 08183DF8 TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 23432953 fail #50 Access violation at address 080856E4, accessing address 00000000 stack trace 080A9AAC SynTests.TSynTestCase.TestFailed (729) 080A970A SynTests.TSynTestCase.Check (550) 0814B593 SynSelfTests.TTestLowLevelCommon._TSynTable (3500) 080AA4C8 SynTests.TSynTests.Run (969) 08183AAD mORMotSelfTests.SQLite3ConsoleTests (180) 08183DF8 TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 23432953 fail TTestLowLevelCommon(5588B420) Low level common: TSynTable "Access violation at address 080856E4, accessing address 00000000" stack trace 080AB084 SynTests.TSynTestsLogged.Failed (1135) 080A9ABC SynTests.TSynTestCase.TestFailed (731) 080A970A SynTests.TSynTestCase.Check (550) 0814B593 SynSelfTests.TTestLowLevelCommon._TSynTable (3500) 080AA4C8 SynTests.TSynTests.Run (969) 08183AAD mORMotSelfTests.SQLite3ConsoleTests (180) 08183DF8 TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 00A4AEA9 stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 080A2D56 SynCommons.FixedWaitFor (32280) 0804E3E7 System.@LStrSetLength 08182480 SynSelfTests.TTestMultiThreadProcessThread.Execute (13434) 08072ADE Classes.ThreadProc 0804D71A System.ThreadWrapper
20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 00A4AEA9 stack trace 0804D0A5 System.@HandleFinally 081826F7 SynSelfTests.TTestMultiThreadProcessThread.Execute (13481) 08072ADE Classes.ThreadProc 0804D71A System.ThreadWrapper
20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 00A4AEA9 stack trace 0804D0A5 System.@HandleFinally 08182726 SynSelfTests.TTestMultiThreadProcessThread.Execute (13483) 08072ADE Classes.ThreadProc 0804D71A System.ThreadWrapper
20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 00A4AEA9 stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 080A2D56 SynCommons.FixedWaitFor (32280) 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 080A2D56 SynCommons.FixedWaitFor (32280) 0804E3E7 System.@LStrSetLength 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter
20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452655 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter
20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace 20150727 23452658 EXCOS EAccessViolation (FBEE0101) at 080A55C5 SynLog.IsBadReadPtr (2009) stack trace
I just checked and run the tests: I did not have any problem with Ubuntu.
Here I tested with a 3.13 kernel revision.I guess the problem may be about the kernel you use.
It is displayed as 2.6.18, and sounds a bit old to me.
Your system ages from 2010-03-30, as told by https://access.redhat.com/articles/3078
Not a good idea at all on production.Please try with a newer RHEL version.
To be more precise, we use CLOCK_MONOTONIC_COARSE for GetTickCount64 implementation, which requires a 2.6.32 kernel.
See http://man7.org/linux/man-pages/man2/cl … ime.2.html
and http://lwn.net/Articles/347811It may be the cause of the issue.
Thanks for your efforts very much ! I have tried on a CentOS 6.x and indeed the exception did not show.
According to the "End-of-support schedule" as shown https://en.wikipedia.org/wiki/CentOS , v5.x is going to be supported till 2017. More importantly, that my application does not run does not mean much to the linux administrators. ![]()
Could you help to comment since which version of mORMot did you make the change ? More importantly, is it possible to allow mORMot to run on old kernel again ? ![]()
TestSQL3 was compiled from latest mORMot with CrossKylix but failed on RHEL5.5 x64. The output and the log with line numbers have been provided. Could you help to comment what could be the cause and how to work around ? Many thanks !
Synopse mORMot Framework Automated tests
------------------------------------------
1. Synopse libraries
1.1. Low level common:
- System copy record: 83 assertions passed 17.00s
- TRawUTF8List: 130,009 assertions passed 255102.00s
- TDynArray: 1,082,725 assertions passed 142117.00s
- TDynArrayHashed: 1,200,629 assertions passed 77837.00s
- TObjectListHashed: 999,910 assertions passed 275084.00s
- TObjectDynArrayWrapper: 167,501 assertions passed 17344.00s
- TObjArray: 2,016 assertions passed 1126.00s
- Fast string compare: 24 assertions passed 9.00s
- IdemPropName: 189 assertions passed 20.00s
- Url encoding: 150 assertions passed 711.00s
- GUID: 9,005 assertions passed 1210.00s
- IsMatch: 599 assertions passed 161.00s
- Soundex: 35 assertions passed 19.00s
- Numerical conversions: 1,116,350 assertions passed 398819.00s
- crc32c: 30,030 assertions passed 52334.00s
pas 19364.00s 323 B/s fast 3022.00s 2070 B/s sse42 1444.00s 4332 B/s
- Curr 64: 20,053 assertions passed 978.00s
- CamelCase: 11 assertions passed 6.00s
- Bits: 4,774 assertions passed 28.00s
- Ini files: 7,004 assertions passed 20485.00s
- UTF8: 81,122 assertions passed 831377.00s
- Iso 8601 date and time: 36,017 assertions passed 3663.00s
- Time zones: 398 assertions passed 146.00s
- Url decoding: 1,100 assertions passed 172.00s
- Mime types: 23 assertions passed 15.00s
!!! Low level common - TSynTable "Access violation at address 08085620, accessing address 00000000" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
! - TSynTable: 1 / 50 FAILED 1688134.00s
- TSynCache: 404 assertions passed 106.00s
- TSynFilter: 1,005 assertions passed 1768.00s
- TSynValidate: 677 assertions passed 686.00s
- TSynLogFile: 36 assertions passed 470.00s
Total failed: 1 / 4,891,929 - Low level common FAILED 3770499.00s
1.2. Low level types:
- RTTI: 61 assertions passed 2515.00s
- Url encoding: 200 assertions passed 434.00s
- Encode decode JSON: 282,109 assertions passed 342193.00s
- Variants: 46 assertions passed 27.00s
- Mustache renderer: 144 assertions passed 309995.00s
- TDocVariant: 71,771 assertions passed 192936.00s
- BSON: 245,050 assertions passed 58528.00s
- TSynTableStatement: 205 assertions passed 147.00s
Total failed: 0 / 599,586 - Low level types PASSED 906992.00s
1.3. Cryptographic routines:
- Adler32: 1 assertion passed 9.00s
- MD5: 1 assertion passed 6.00s
- SHA1: 10 assertions passed 6482.00s
- SHA256: 8 assertions passed 9096.00s
- AES256: 12,178 assertions passed 571025.00s
- RC4: 1 assertion passed 8.00s
- Base64: 11,994 assertions passed 315242.00s
- CompressShaAes: 1,683 assertions passed 3004.00s
Total failed: 0 / 25,876 - Cryptographic routines PASSED 904972.00s
1.4. Compression:
- In memory compression: 12 assertions passed 241714.00s
- GZIP format: 19 assertions passed 502109.00s
- SynLZO: 3,006 assertions passed 56586.00s
- SynLZ: 32,221 assertions passed 567578.00s
Total failed: 0 / 35,258 - Compression PASSED 1368043.00s
2. mORMot
2.1. File based:
- Database direct access: 20,246 assertions passed 294497.00s
- Virtual table direct access: 12 assertions passed 2196.00s
- TSQLTableJSON: 144,070 assertions passed 142336.00s
!!! File based - TSQLRestClientDB "" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
!!! File based - TSQLRestClientDB "" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
!!! File based - TSQLRestClientDB "" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
!!! File based - TSQLRestClientDB "" failed !!!
Press [Enter] to continue, or Ctrl+C to abort
!!! File based - TSQLRestClientDB "" failed !!!
Press [Enter] to continue, or Ctrl+C to abort ! File based - TSQLRestClientDB
! Exception EControlC raised with messsage:
! Control-C hit
Using mORMot 1.18.1694 PRTL FTS3
Running on Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010
TSQLite3LibraryDynamic 3.8.10.2 with internal MM
Generated with: Kylix 3 compiler
Time elapsed for all tests: 10242552.00s
Tests performed at 07/27/2015 12:10:44 PM
Total assertions failed for all test suits: 1 / 5,552,649
! Some tests FAILED: please correct the code./test/mormot/TestSQL3 0.0.0.0 (2015-07-27 00:44:39)
Host=login01 User=test CPU=12/12 OS=Linux-2.6.18-194.el5#1-SMP-Tue-Mar-16-21:52:39-EDT-2010 Wow64=0 Freq=1000
TSQLLog 1.18.1694 PRTL FTS3 2015-07-27T12:10:36
00000000 00000000 EXCOS EAccessViolation (FBEE0101) at 08085620 SynCommons.MoveX87 (30316) stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0804E83C System.@WStrSetLength 08076406 SynCommons.TSynAnsiConvert.AnsiToUnicodeString (13824) 080A9985 SynTests.TSynTestCase.RandomUnicode (666) 0814A76E SynSelfTests.TTestLowLevelCommon._TSynTable (3436) 080AA404 SynTests.TSynTests.Run (969) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12103627 EXCOS EAccessViolation (FBEE0101) at 08085620 SynCommons.MoveX87 (30316) stack trace 0804D7B1 System.@LStrClr 0804D0A5 System.@HandleFinally 080A9998 SynTests.TSynTestCase.RandomUnicode (666) 0814A76E SynSelfTests.TTestLowLevelCommon._TSynTable (3436) 080AA404 SynTests.TSynTests.Run (969) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12103627 fail #50 Access violation at address 08085620, accessing address 00000000 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 0814B48F SynSelfTests.TTestLowLevelCommon._TSynTable (3500) 080AA404 SynTests.TSynTests.Run (969) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12103628 fail TTestLowLevelCommon(5588B420) Low level common: TSynTable "Access violation at address 08085620, accessing address 00000000" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 0814B48F SynSelfTests.TTestLowLevelCommon._TSynTable (3500) 080AA404 SynTests.TSynTests.Run (969) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104132 fail #25 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 0817642C SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10909) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104133 fail TTestFileBased(55819A20) File based: TSQLRestClientDB "" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 0817642C SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10909) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104245 fail #26 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 08176485 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10911) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104246 fail TTestFileBased(55819A20) File based: TSQLRestClientDB "" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 08176485 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10911) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104310 fail #27 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 081764A2 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10912) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104310 fail TTestFileBased(55819A20) File based: TSQLRestClientDB "" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 081764A2 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10912) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104332 fail #28 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 081764BD SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10913) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104332 fail TTestFileBased(55819A20) File based: TSQLRestClientDB "" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 081764BD SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10913) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104352 fail #29 stack trace 080A99E8 SynTests.TSynTestCase.TestFailed (729) 080A9646 SynTests.TSynTestCase.Check (550) 081764D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10914) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104352 fail TTestFileBased(55819A20) File based: TSQLRestClientDB "" stack trace 080AAFC0 SynTests.TSynTestsLogged.Failed (1135) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 081764D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10914) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 0805B929 SysUtils.RaiseSignalException 0805B95E SysUtils.SignalConverter 0804B499 System.TextIn 0804BB97 System.@ReadChar 0804BD26 System.@ReadLn 080AB060 SynTests.TSynTestsLogged.Failed (1140) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 081764D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10914) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 0804D0A5 System.@HandleFinally 080AB07D SynTests.TSynTestsLogged.Failed (1140) 080A99F8 SynTests.TSynTestCase.TestFailed (731) 080A9646 SynTests.TSynTestCase.Check (550) 081764D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10914) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 0804D0A5 System.@HandleFinally 08177F90 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (11285) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 0804C987 System.TObject.Free 0804D0A5 System.@HandleFinally 08177FD8 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (11296) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 0804D7B1 System.@LStrClr 0804D0A5 System.@HandleFinally 08178089 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (11296) 080AA404 SynTests.TSynTests.Run (969) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 080AA4BF SynTests.TSynTests.Run (978) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
20150727 12104416 EXCOS EControlC (FBEE0101) at FFFFE410 stack trace 080AA516 SynTests.TSynTests.Run (982) 081761D4 SynSelfTests.TTestSQLite3Engine._TSQLRestClientDB (10876) 081839B1 mORMotSelfTests.SQLite3ConsoleTests (180) 08183CFC TestSQL3 (187) 0805413E SysInit.@main 08054194 SysInit.@start
If you like to experiment .... you could try this:
1)
Use fpcup to install the special branch of fpc, that includes an RTTI extension.
fpcup --fpcURL="rtti" --installdir="myspecialfpcdir"
https://github.com/LongDirtyAnimAlf/Reiniero-fpcup......
I could not run your fpcup_linux_x86 or fpcup_linux_x64 on my CentOS 5.11 x64.
[test@localhost i386-linux]$ ./fpcup_linux_x86 --fpcURL="rtti" --installdir="/home/test/fpclazarus_x86/" --verbose
......
/home/test/fpclazarus_x86/lazarus/components/lazutils/lazfglhash.pas(83,6) Error: (5000) Identifier not found "FHashTableSize"
/home/test/fpclazarus_x86/lazarus/components/lazutils/lazfglhash.pas(84,17) Error: (5000) Identifier not found "FHashTableSize"
......
[test@localhost i386-linux]$ cat /home/test/fpclazarus_x86/lazarus/components/lazutils/lazfglhash.pas
......
{$if not(defined(ver2) or defined(ver3_0))}
function TLazFPGHashTable.ForEachCall(aMethod: TGIteratorMethod): THTGNode;
var
i, j: Longword;
continue: boolean;
begin
Result:=nil;
continue:=True;
if FHashTableSize>0 then
for i:=0 to FHashTableSize-1 do
if Assigned(Chain(i)) then
if chain(i).Count>0 then
for j:=0 to Chain(i).Count-1 do
begin
aMethod(THTGNode(Chain(i)[j]).Data, THTGNode(Chain(i)[j]).Key, continue);
if not continue then
begin
Result:=THTGNode(Chain(i)[j]);
Exit;
end;
end;
end;
......
[test@localhost i386-linux]$ It seems to be related to the ver2 or ver3_0. Could you help to comment what is the correct way to work around this ? ... ![]()
AFAIK this is a dedicated branch.
Do you mean that --fpcURL="rtti" will always fetch the latest revision of this dedicated branch ?
Sorry for the trouble. Problem solved by adding a symbolic link....
[test@localhost i386-linux]$ ldd fpcup_linux_x86
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00a10000)
libdl.so.2 => /lib/libdl.so.2 (0x00a09000)
libc.so.6 => /lib/libc.so.6 (0x00880000)
/usr/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00861000)
[test@localhost i386-linux]$
[test@localhost i386-linux]$ ls /usr/lib/ld-linux.so.2
ls: /usr/lib/ld-linux.so.2: No such file or directory
[test@localhost i386-linux]$
[test@localhost i386-linux]$ ls -l /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 9 Nov 20 2014 /lib/ld-linux.so.2 -> ld-2.5.so
[test@localhost i386-linux]$
[test@localhost i386-linux]$ sudo ln -s /lib/ld-2.5.so /usr/lib/ld-linux.so.2
[test@localhost i386-linux]$
[test@localhost i386-linux]$ ls -l /usr/lib/ld-linux.so.2
lrwxrwxrwx 1 root root 14 Jul 1 00:11 /usr/lib/ld-linux.so.2 -> /lib/ld-2.5.so
[test@localhost i386-linux]$ Could you help to comment another question ?
If you like to experiment .... you could try this:
1)
Use fpcup to install the special branch of fpc, that includes an RTTI extension.
fpcup --fpcURL="rtti" --installdir="myspecialfpcdir"
https://github.com/LongDirtyAnimAlf/Reiniero-fpcup
......
Is this "rtti" a specific revision, or always the latest revision that contains the "rtti" feature ?
If you like to experiment .... you could try this:
1)
Use fpcup to install the special branch of fpc, that includes an RTTI extension.
fpcup --fpcURL="rtti" --installdir="myspecialfpcdir"
https://github.com/LongDirtyAnimAlf/Reiniero-fpcup2)
enable fpc RTTI inside of synopse.inc
{.$define HASINTERFACERTTI} ... remove dotNote: this additional RTTI is (at the moment) only available for i386, X86_64 and ARM.
I could not run your fpcup_linux_x86 on my CentOS 5.11 x64. The i686 version of glibc has already installed. Could you help to comment how to work around ? ... ![]()
[test@localhost i386-linux]$ pwd
/home/test/DEV/Reiniero-fpcup-master/bin/i386-linux
[test@localhost i386-linux]$
[test@localhost i386-linux]$ cat /etc/redhat-release
CentOS release 5.11 (Final)
[test@localhost i386-linux]$
[test@localhost i386-linux]$ uname -a
Linux localhost.localdomain 2.6.18-398.el5 #1 SMP Tue Sep 16 20:50:52 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
[test@localhost i386-linux]$
[test@localhost i386-linux]$ ./fpcup_linux_x86 --fpcURL="rtti" --installdir="/home/test/fpclazarus_x86/"
bash: ./fpcup_linux_x86: /usr/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
[test@localhost i386-linux]$
[test@localhost i386-linux]$ sudo yum -y install glibc.i686
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* c5-media:
Setting up Install Process
Package glibc-2.5-123.i686 already installed and latest version
Nothing to do
[test@localhost i386-linux]$ Could you help to comment the reason why you do not use CodeTyphon anymore ? ![]()
In fact, for FPC, I guess the standard FPC functions of exception interception and stack trace should be used.
Someone has to take a little time and include the features already available within the FPC RTL, and described at
http://wiki.freepascal.org/Logging_exceptions
After reading the "#Handling thread exceptions" section, I really hope that you, who know every detail of mORMot threading, could do the work ... ![]()
Exception logging and Stack trace do work now on Linux with Kylix/CrossKylix!!!!
I took inspiration from the code you supplied!
Thanks!
Could you help to comment whether you would provide built-in "Exception logging and Stack trace" for mORMot with FPC/(Win32,Linux) ? ![]()
If not, could you help to comment on the best alternative to enable "Exception logging and Stack trace" for mORMot with FPC/(Win32,Linux) ?
Thank you very much for your efforts to help !
The files to be in CrossKylix/bin folder is about to get rid of a compilation warning:
[CrossKylix] Writing configuration... [CrossKylix] Building Test.dpr... [CrossKylix] Warning: File not found: 'libz.so' [CrossKylix] Created Linux binary in d:\dev\lib\SQLite3\Kylix\TestDo you have any warning during compilation?
Yes, I understand your point exactly. After I put libz.so and librt.so.1, there is no more warninig.
Putting the .so with the executable does not mean anything in Linux, AFAIK.
The .so have to be installed as system library.
Yes. But a CrossKylix-compiled executable is supposed to be able to load .so libraries in the same directory, isn't it ?
Could you check the "Kylix application deployment" section of the CrossKylix page http://crosskylix.untergrund.net/#deploy ?
See what ldd shows on my configuration:
user@xubuntu:~/lib/SQLite3/kylix$ ldd Test linux-gate.so.1 => (0xb76eb000) libz.so => /usr/lib/i386-linux-gnu/libz.so (0xb76b9000) librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb76b0000) libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7693000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb768e000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74df000) /lib/ld-linux.so.2 (0xb76ec000)
My point of showing what ldd outputs is to show the distribution does not have 32bit ZLib pre-installed at the /lib or /usr/lib, because the problem is to load libz.so in the same directory as the application.
What is your distribution?
It is CentOS 6.3 X86_64, as shown in the screen snapshot (the output of the command "cat /etc/redhat-release").
I do not understand why your executable is searching for libz.so.1.
I do not understand either.
However, it should be noted that :(1) if there are no "libz.so and librt.so.1" in the CrossKylix bin, running the executable compiled will complain that it cannot find "libz.so" instead of "libz.so.1", even if the "libz.so" is under the same directory. (2) if there are "libz.so and librt.so.1" in the CrossKylix bin, running the executable compiled will complain that it cannot find "libz.so.1" instead of "libz.so", even if the "libz.so.1" is under the same directory.
In SynZip.pas you have:
{$ifdef linux} const ZLIB_VERSION = '1.2.5'; libz='libz.so'; ...
Thank you for your comment ! It seems the reason why libsqlite3.so can be loaded in the same directory is that libsqlite3.so is loaded via SafeLoadLibrary call which utilizes CrossKylix's ckLibc.pas, and the reason why libz.so cannot be loaded in the same directory is that libz.so is loaded via external keyword which does not seem to utilize CrossKylix's ckLibc.pas... Could you consider whether it would be better (or not) to make SynZip load libz.so also via SafeLoadLibrary call ?
Are you sure your source code is up to date?
Yes.
Our low-level socket library is not able to use https, just raw http.
Or some json files are needed by the regression tests, to be downloaded from https directly from the official repositories of those reference sets.
Thank you very much for your comments and efforts !
You have to copy the missing .so from your distribution to your CrossKylix bin folder.
I've added librt.so.1 and libz.so files.
I have copied the files both to the CrossKylix installation bin directory before compilation, and to the application directory after complication. 

However, I still got
./TestSQL3: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directoryCould you be kind enough to help to comment why CrossKylix-compiled executable cannot load the libz.so* files in the same directory ?
Now on my side, all tests do pass.
Now TestSQL3 runs flawless in my Linux VM ! Thank you very much for your efforts ! Still, Could you help to comment why one needs to copy the .json files beforehand ?
Furthermore, I have another problem, which is more related to Kylix/CrossKylix than to mORMot. When I compile a TestSQL3 using CrossKylix, upload the binary to a Linux without pre-installed ZLib, and run it, it complains
./TestSQL3: error while loading shared libraries: libz.so: cannot open shared object file: No such file or directoryI thought executable compiled with CrossKylix can load libraries in the same directory. However, the error is there even after I upload a libz.so to the same directory. Setting LD_LIBRARY_PATH helps.
It should be noted that libsqlite3.so.0 can be loaded in the same directory.
Could you be kind enough to help to comment about the reason why the libz.so in the same directory cannot be loaded ?
Test coverage is much better than FPC, which fails to run some variant-based tests with late binding.
I just created another bug report to FPC - see http://bugs.freepascal.org/view.php?id=27354
And we still have our long standing problem about RTTI for interface missing - see http://bugs.freepascal.org/view.php?id=26774
Perhaps the wanted help needs to be paid for, one way or another ? ....
1) In the current version, you will have to copy the *.json files from a Windows TestSQL3.exe folder.
Then it should work.
Thank you for your comments very much ! With all the *.json files from a Windows TestSQL3.exe run, the Kylix/CrossKylix Linux TestSQL3 can proceed further. Still, could you help to comment whether this issue can be fixed ?
Then the Kylix/CrossKylix Linux TestSQL3 ran into another exception. Could you help to comment about the solution ?
The command line output is
2.7. Service oriented architecture:
- Weak interfaces: 56 assertions passed 252us
- Service initialization: 243 assertions passed 2.14ms
- Direct call: 574,986 assertions passed 27.22ms
- Server side: 575,005 assertions passed 27.15ms
- Client side REST: 575,010 assertions passed 528.97ms
- Client side REST result as object: 575,004 assertions passed 576.19ms
- Client side REST locked: 575,007 assertions passed 576.21ms
- Client side REST synchronized: 575,007 assertions passed 3.57s
- Client side REST background thread: 575,007 assertions passed 1.57s
- Client side REST weak authentication: 575,004 assertions passed 502.50ms
- Client side http basic authentication: 575,004 assertions passed 622.34ms
- Client side REST custom record layout: 575,004 assertions passed 593.46ms
- Client side JSONRPC: 575,004 assertions passed 595.76ms
- Test over HTTP: 9,425 assertions passed 4.99s
- Security: 135 assertions passed 2.50ms
Runtime error 0 at FFA7711C
Segmentation fault (core dumped)
[root@localhost try]# The log content is
/root/hehe/try/TestSQL3 unknown (2015-01-26T01:34:49)
Host=localhost.localdomain User=unknown CPU=1/1 OS=Linux-3.18.1-x86_64-linode50#1-SMP-Tue-Jan-6-12:14:10-EST-2015 Wow64=0 Freq=1000000000
TSQLLog 1.18.748 PRTL FTS3 2015-01-26T01:52:12
20150126 01521209 EXC EInterfaceFactoryException ("Invalid TInterfacedObjectFake.FakeCall() for ICalculator.Add: TInterfaceStub returned error: expected exception") at 0009A815 mORMot.RaiseError (32372) stack trace 0009A815 mORMot.RaiseError (32372) 000
9A815 mORMot.RaiseError (32372) 0009AA5D mORMot.InternalProcess (32372)
20150126 01521209 EXC EInterfaceFactoryException ("Invalid TInterfacedObjectFake.FakeCall() for ICalculator.Add: TInterfaceStub returned error: expected exception") at 0009A815 mORMot.RaiseError (32372) stack trace 0009A815 mORMot.RaiseError (32372) 000
02729 System.@HandleFinally 0009A828 mORMot.RaiseError (32372) 0009AA5D mORMot.InternalProcess (32372)
20150126 01521209 EXC EInterfaceFactoryException ("Invalid TInterfacedObjectFake.FakeCall() for ICalculator.Add: TInterfaceStub returned error: expected exception") at 0009A815 mORMot.RaiseError (32372) stack trace 0009A815 mORMot.RaiseError (32372) 000
02729 System.@HandleFinally 0009AA71 mORMot.InternalProcess (32372)
20150126 01521209 EXC EInterfaceFactoryException ("Invalid TInterfacedObjectFake.FakeCall() for ICalculator.Add: TInterfaceStub returned error: expected exception") at 0009A815 mORMot.RaiseError (32372) stack trace 0009A815 mORMot.RaiseError (32372) 000
02729 System.@HandleFinally 0009AF8E mORMot.InternalProcess (32372)
20150126 01521209 EXCOS EAccessViolation (FBEE0101) at F7A2CDB6 stack trace 00010F39 SysUtils.RaiseSignalException 00010F6E SysUtils.SignalConverter 0009AF8E mORMot.InternalProcess (32372)3) I tried to configure gcc4, but in vain. It complains about a TEXT section in the file - sounds like a Kylix linker limitation/expectation.
Also tried the bcc compiler supplied with Kylix. Not successfully either.
Perhaps another compiler may work.
I just tried with tcc and it does not support the syntax expected by sqlite3.c.
In the meanwhile, since using a local .so was working well, at least for our testing purpose, it was fine to me.
Your efforts are really appreciated ! The local .so sounds fine for the time being.
(1) Yes. All features are available, and now the HTTP server seems stable enough to work on production.
Excellent news !
(2) Just use
program Test; {$APPTYPE CONSOLE} uses FastMM4, mORMotSelfTests; begin SQLite3ConsoleTests; end.
I get ECrtSocket exception. The command line output and the log content are below. Could you help to comment about the solution ?
The command line output is :
[root@localhost hehe]# ./TestSQL3
libsqlite3.so.0 initialization failed with ESQLite3Exception: Unable to load libsqlite3.so.0 - Invalid or incomplete multibyte or wide character
Synopse mORMot Framework Automated tests
------------------------------------------
1. Synopse libraries
1.1. Low level common:
- System copy record: 22 assertions passed 168us
- TRawUTF8List: 110,007 assertions passed 52.25ms
- TDynArray: 1,027,708 assertions passed 159.73ms
- TDynArrayHashed: 1,200,629 assertions passed 92.12ms
- TObjectListHashed: 999,888 assertions passed 335.05ms
- TObjectDynArrayWrapper: 167,501 assertions passed 18.78ms
- Fast string compare: 7 assertions passed 216us
- IdemPropName: 30 assertions passed 222us
- Url encoding: 132 assertions passed 1.00ms
- GUID: 9,005 assertions passed 1.57ms
- IsMatch: 599 assertions passed 234us
- Soundex: 35 assertions passed 151us
- Numerical conversions: 1,113,654 assertions passed 440.57ms
- crc32c: 30,030 assertions passed 54.92ms
pas 18.23ms 327.1 MB/s fast 3.60ms 1.6 GB/s sse42 1.63ms 3.5 GB/s
- Curr 64: 20,053 assertions passed 1.14ms
- CamelCase: 11 assertions passed 224us
- Bits: 4,774 assertions passed 244us
- Ini files: 7,004 assertions passed 16.27ms
- UTF8: 81,105 assertions passed 1.17s
- Iso 8601 date and time: 36,015 assertions passed 6.02ms
- Url decoding: 1,100 assertions passed 524us
- Mime types: 23 assertions passed 228us
- TSynTable: 875 assertions passed 2.32ms
- TSynCache: 404 assertions passed 286us
- TSynFilter: 1,005 assertions passed 2.54ms
- TSynValidate: 677 assertions passed 1.40ms
- TSynLogFile: 36 assertions passed 377us
Total failed: 0 / 4,812,329 - Low level common PASSED 2.37s
1.2. Low level types:
- RTTI: 58 assertions passed 263us
- Url encoding: 200 assertions passed 824us
! Exception ECrtSocket raised with messsage:
! https is not supported by HttpGet(https://api.github.com/users/zendframework/repos)
Using mORMot 1.18.748 PRTL FTS3
Running on Linux 3.18.1-x86_64-linode50 #1 SMP Tue Jan 6 12:14:10 EST 2015
Generated with: Kylix 3 compiler
Tests performed at 01/25/2015 02:53:43 PM
Total assertions failed for all test suits: 0 / 4,812,329
! Some tests FAILED: please correct the code.
[root@localhost hehe]# The log file content is :
/root/hehe/TestSQL3 unknown (2015-01-25T14:57:47)
Host=localhost.localdomain User=unknown CPU=1/1 OS=Linux-3.18.1-x86_64-linode50#1-SMP-Tue-Jan-6-12:14:10-EST-2015 Wow64=0 Freq=1000000000
TSQLLog 1.18.748 PRTL FTS3 2015-01-25T14:58:38
20150125 14583840 EXC ECrtSocket ("https is not supported by HttpGet(https://api.github.com/users/zendframework/repos)") at 0005B221 SynCrtSock.HttpGet (2880) stack trace 0005B221 SynC
rtSock.HttpGet (2880) 0005B221 SynCrtSock.HttpGet (2880) 000DCD5E SynSelfTests.TTestLowLevelTypes.EncodeDecodeJSON (5205) 000D9808 SynSelfTests.TestJSONSerialization (4670) 000636B1 SynTe
sts.TSynTests.Run (933) 001036D0 mORMotSelfTests.SQLite3ConsoleTests (209) 001039CB TestSQL3 (11) 000097D2 SysInit.@main 00009828 SysInit.@start
20150125 14583841 EXC ECrtSocket ("https is not supported by HttpGet(https://api.github.com/users/zendframework/repos)") at 0005B221 SynCrtSock.HttpGet (2880) stack trace 0005B221 SynC
rtSock.HttpGet (2880) 00002729 System.@HandleFinally 0005B298 SynCrtSock.HttpGet (2885) 000DCD5E SynSelfTests.TTestLowLevelTypes.EncodeDecodeJSON (5205) 000D9808 SynSelfTests.TestJSONSeri
alization (4670) 000636B1 SynTests.TSynTests.Run (933) 001036D0 mORMotSelfTests.SQLite3ConsoleTests (209) 001039CB TestSQL3 (11) 000097D2 SysInit.@main 00009828 SysInit.@start
20150125 14583841 EXC ECrtSocket ("https is not supported by HttpGet(https://api.github.com/users/zendframework/repos)") at 0005B221 SynCrtSock.HttpGet (2880) stack trace 0005B221 SynC
rtSock.HttpGet (2880) 00002E35 System.@LStrClr 00002729 System.@HandleFinally 000DD5A6 SynSelfTests.TTestLowLevelTypes.EncodeDecodeJSON (5285) 000636B1 SynTests.TSynTests.Run (933) 001036
D0 mORMotSelfTests.SQLite3ConsoleTests (209) 001039CB TestSQL3 (11) 000097D2 SysInit.@main 00009828 SysInit.@start3) Not yet.
In fact, Kylix does not want to link with a sqlite3.o compiled with gcc4 - I remember having used gcc2.95, which is not available any more...
That is pity ! A single executable would be much more convenient !
Could you help to comment whether that is because of a bug in Kylix ? Furthermore, can gcc4 be manipulated / configured to produce a compatible format ? Lastly, could TinyCC or Intel CC produce proper sqlite3.o ? ![]()
Dear Arnaud, you have made great efforts in the Kylix/CrossKylix compatibility recently.
2015-01-23 20:42 [f81275a868] Leaf: {748} fix low-level socket access on Linux - now all tests seems to be passing with both FPC and CrossKylix!
2015-01-22 18:18 [0ec0d07b0b] {745} included FastMM4 memory manager, tuned for Kylix3 server applications
2015-01-21 20:22 [c1f8e810d0] {742} fix HTTP keep alive for Linux platforms (FPC/Kylix) after a lot of testing, and some refactoring of the socket-based HTTP server - now I think we can start to use mORMot Linux servers on production
2015-01-18 21:55 [13bacab9f3] {735} Exception logging and Stack trace do work now on Linux with Kylix/CrossKylix
2015-01-13 19:19 [a7fe471e14] {701} now TestSQL3 regression tests compile with Kylix/CrossKylix - still not able to link statically SQLite3 - tests are not all passing yetThus,
(1) I am wondering whether {748} means that all functionalities of mORMot (including interface-based services) work with Kylix/CrossKylix ?
(2) Could you provide the TestSQL3 which has the correct IFDEF to compile with Kylix/CrossKylix ?
(3) Can TestSQL3 statically link SQLite3 with Kylix3/CrossKylix ? ![]()
Exception logging and Stack trace do work now on Linux with Kylix/CrossKylix!!!!
I took inspiration from the code you supplied!
Thanks!
It is excellent, excellent work ! Thank you for your efforts very much ! ![]()
@AOG and @ab, please let me describe the problem, all of which are related with FPC under Linux, again:
Bug #1: UrlDecodeValue.
For HTTP access to method-based services, when there is a single string parameter, the server cannot use urldecodevalue to get the value. 'Context.Parameters' contains the correct value.
InputUTF8 works correctly.
Please download the sample project using the link below.
http://www40.zippyshare.com/v/9181464/file.htmlPlease compile and run server in one terminal, and compile and run client in another terminal, and check the log information from the server.
Bug #2: UrlDecodeExtended.
For HTTP access to method-based services, when there are multiple concurrent clients by running the client concurrently.
Please download the sample project using the link below.
http://www40.zippyshare.com/v/20221523/file.htmlPlease compile and run server in one terminal, and compile and run clients concurrently in another terminal using the following cmd,
for i in `seq 1 8`; do ./JobAnalyzerTcpIpClientLinux uclient.pas > $i.log & doneThe server will give the following exception...
20141123 19462751 # srvr GET root/sum?A=210.5&B=1.5 ERROR=500 (Exception EOverflow: Floating point overflow)If I switch UrlDecodeExtended to InputDouble, the exception goes away.
Request #3:
could you help to change the line feed from #13 to #10 on Linux OS when echoing to the terminal ? When running the programs above, the terminal displays twice the empty lines.
@ComingNine
Found the problem !
If you disable ILog (comment out ILog in your Sum method), then everything works as expected (at least on my system), also with extended !
I do not have a solution however.
I think we have to ask Ab, how and why ILog and extended influence each other (on Linux i386, but perhaps also on other systems).
Greetings, Alfred.
Thank you very much for your efforts !
Could you help to paste your test case here, to discover that both the "UrlDecodeValue" and the "UrlDecodeExtended" are faulty with ILog enabled ?
Sorry about me being not responsive ... !
I was (and still am) very busy with a mORMot application (system abstraction) that uses dataset lookup fields on TID fields.
And this still does not work 100% unfortunately. And I have to finish this first. I expect 2-3 more days of work.
So, I will have a look at your problem next week !!
Greetings, Alfred.
Thank you very much for your efforts !... ![]()
Dear AOG, could you help to comment whether you could reproduce the errors on your x86 ? ![]()
I just checked the two .tar.gz files using CodeTyphon 5.1 on CentOS v5.11 x86.
Only change of the project settings is the library path "/usr/lib/gcc/i386-redhat-linux/4.1.2/" .
(When using Typhon 32 on CentOS x64, this value should be "/usr/lib/gcc/x86_64-redhat-linux/4.1.2/32".)
Same error applies...
Could you help to comment whether you could reproduce the errors on your x86 ?
Thank you very much for your efforts !
If I test on "32bit CentOS", would it be fine for you ? If yes, I will try CentOS V5.11 X86.
Thank you very much for your efforts !
When I install multiArch CodeTyphon v5.1 on CentOS v5.11 X64, the Big IDE cannot be built, but the Small IDE can be built, which is enough. ![]()
Furthermore, if there is linking failure, please try 'ln -s existing_library_name missing_library_name' ... ![]()
If you could not reproduce the bug, please let me know. I could either provide a compiled binary, or even the remote access of mine machine... ![]()