#1 2015-01-25 13:47:54

ComingNine
Member
Registered: 2010-07-29
Posts: 294

TestSQL3 for Kylix ?

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 yet

Thus,
(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 ?
big_smile

Last edited by ComingNine (2015-01-25 14:01:28)

Offline

#2 2015-01-25 14:37:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

(1) Yes. All features are available, and now the HTTP server seems stable enough to work on production.

(2) Just use

program Test;

{$APPTYPE CONSOLE}

uses
  FastMM4,
  mORMotSelfTests;

begin
  SQLite3ConsoleTests;
end.

3) 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...

Offline

#3 2015-01-25 15:12:29

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: TestSQL3 for Kylix ?

ab wrote:

(1) Yes. All features are available, and now the HTTP server seems stable enough to work on production.

Excellent news !

ab wrote:

(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.@start
ab wrote:

3) 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 ? big_smile

Offline

#4 2015-01-25 16:32:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

1) In the current version, you will have to copy the *.json files from a Windows TestSQL3.exe folder.
Then it should work.

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.

Offline

#5 2015-01-26 01:56:20

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: TestSQL3 for Kylix ?

ab wrote:

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)
ab wrote:

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.

Last edited by ComingNine (2015-01-26 02:01:41)

Offline

#6 2015-01-26 10:27:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

You can check http://synopse.info/fossil/info/f73c00ef4e

Now on my side, all tests do pass.

user@xubuntu:~/lib/SQLite3/kylix$ ./Test

   Synopse mORMot Framework Automated tests
  ------------------------------------------


1. Synopse libraries

 1.1. Low level common: 
  - System copy record: 22 assertions passed  666us
  - TRawUTF8List: 110,007 assertions passed  63.59ms
  - TDynArray: 1,027,708 assertions passed  127.12ms
  - TDynArrayHashed: 1,200,629 assertions passed  110.60ms
  - TObjectListHashed: 999,894 assertions passed  341.80ms
  - TObjectDynArrayWrapper: 167,501 assertions passed  24.23ms
  - Fast string compare: 7 assertions passed  611us
  - IdemPropName: 30 assertions passed  4.05ms
  - Url encoding: 132 assertions passed  902us
  - GUID: 9,005 assertions passed  1.56ms
  - IsMatch: 599 assertions passed  173us
  - Soundex: 35 assertions passed  90us
  - Numerical conversions: 1,116,303 assertions passed  444.88ms
  - crc32c: 20,020 assertions passed  57.99ms
      pas 21.22ms 281.1 MB/s fast 3.59ms 1.6 GB/s
  - Curr 64: 20,053 assertions passed  935us
  - CamelCase: 11 assertions passed  79us
  - Bits: 4,774 assertions passed  102us
  - Ini files: 7,004 assertions passed  32.94ms
  - UTF8: 81,105 assertions passed  992.60ms
  - Iso 8601 date and time: 36,015 assertions passed  4.22ms
  - Url decoding: 1,100 assertions passed  388us
  - Mime types: 23 assertions passed  121us
  - TSynTable: 875 assertions passed  3.79ms
  - TSynCache: 404 assertions passed  139us
  - TSynFilter: 1,005 assertions passed  3.20ms
  - TSynValidate: 677 assertions passed  840us
  - TSynLogFile: 36 assertions passed  554us
  Total failed: 0 / 4,804,974  - Low level common PASSED  2.22s

 1.2. Low level types: 
  - RTTI: 58 assertions passed  467us
  - Url encoding: 200 assertions passed  623us
  - Encode decode JSON: 271,131 assertions passed  122.17ms
  - Variants: 5 assertions passed  84us
  - Mustache renderer: 142 assertions passed  6.18ms
  - TDocVariant: 71,670 assertions passed  156.40ms
  - BSON: 245,048 assertions passed  16.93ms
  - TSynTableStatement: 205 assertions passed  245us
  Total failed: 0 / 588,459  - Low level types PASSED  303.98ms

 1.3. Cryptographic routines: 
  - Adler32: 1 assertion passed  499us
  - MD5: 1 assertion passed  211us
  - SHA1: 5 assertions passed  381us
  - SHA256: 5 assertions passed  89us
  - AES256: 12,177 assertions passed  585.85ms
  - RC4: 1 assertion passed  82us
  - Base64: 11,994 assertions passed  63.20ms
  - CompressShaAes: 1,683 assertions passed  3.25ms
  Total failed: 0 / 25,867  - Cryptographic routines PASSED  654.50ms

 1.4. Compression: 
  - In memory compression: 12 assertions passed  115.92ms
  - GZIP format: 19 assertions passed  210.69ms
  - SynLZO: 3,006 assertions passed  63.85ms
  - SynLZ: 30,219 assertions passed  571.48ms
  Total failed: 0 / 33,256  - Compression PASSED  962.45ms


2. mORMot

 2.1. File based: 
  - Database direct access: 10,136 assertions passed  313.83ms
  - Virtual table direct access: 12 assertions passed  4.27ms
  - TSQLTableJSON: 106,068 assertions passed  233.14ms
  - TSQLRestClientDB: 310,071 assertions passed  1.18s
  Total failed: 0 / 426,287  - File based PASSED  1.73s

 2.2. File based memory map: 
  - Database direct access: 10,136 assertions passed  358.56ms
  - Virtual table direct access: 12 assertions passed  5.06ms
  - TSQLTableJSON: 106,068 assertions passed  233.63ms
  - TSQLRestClientDB: 310,071 assertions passed  1.17s
  Total failed: 0 / 426,287  - File based memory map PASSED  1.77s

 2.3. File based WAL: 
  - Database direct access: 10,136 assertions passed  349.77ms
  - Virtual table direct access: 12 assertions passed  3.00ms
  - TSQLTableJSON: 106,068 assertions passed  139.24ms
  - TSQLRestClientDB: 310,071 assertions passed  1.75s
  Total failed: 0 / 426,287  - File based WAL PASSED  2.25s

 2.4. Memory based: 
  - Database direct access: 10,136 assertions passed  265.40ms
  - Virtual table direct access: 12 assertions passed  2.76ms
  - TSQLTableJSON: 106,068 assertions passed  69.29ms
  - TSQLRestClientDB: 402,407 assertions passed  1.45s
  - RTree: 140,000 assertions passed  795.70ms
  Total failed: 0 / 658,623  - Memory based PASSED  2.59s

 2.5. Basic classes: 
  - TSQLRecord: 77 assertions passed  499us
  - TSQLRecordSigned: 200 assertions passed  3.32ms
  - TSQLModel: 3 assertions passed  112us
  - TSQLRestServerFullMemory: 562,308 assertions passed  943.23ms
  Total failed: 0 / 562,588  - Basic classes PASSED  948.08ms

 2.6. Client server access: 
  - TSQLHttpServer: 2 assertions passed  30.91ms
     using Synopse CrossPlatform Socket Layer.514
  - TSQLHttpClient: 3 assertions passed  72.45ms
     using TSQLHttpClientWinSock
  - HTTP client keep alive: 387 assertions passed  21.53ms
  - HTTP client multi connect: 387 assertions passed  40.73ms
  - HTTP client encrypted: 387 assertions passed  24.60ms
  - Direct in process access: 356 assertions passed  19.13ms
  - HTTP several DB servers: 1,504 assertions passed  5.09s
  Total failed: 0 / 3,026  - Client server access PASSED  5.30s

 2.7. Service oriented architecture: 
  - Weak interfaces: 56 assertions passed  1.02ms
  - Service initialization: 243 assertions passed  33.73ms
  - Direct call: 574,986 assertions passed  44.91ms
  - Server side: 575,005 assertions passed  33.86ms
  - Client side REST: 575,010 assertions passed  398.79ms
  - Client side REST result as object: 575,004 assertions passed  405.40ms
  - Client side REST locked: 575,007 assertions passed  413.06ms
  - Client side REST synchronized: 575,007 assertions passed  2.17s
  - Client side REST background thread: 575,007 assertions passed  811.74ms
  - Client side REST weak authentication: 575,004 assertions passed  365.43ms
  - Client side http basic authentication: 575,004 assertions passed  486.64ms
  - Client side REST custom record layout: 575,004 assertions passed  425.36ms
  - Client side JSONRPC: 575,004 assertions passed  431.85ms
  - Test over HTTP: 9,425 assertions passed  4.99s
  - Security: 135 assertions passed  5.73ms
  - Mocks and stubs: 30,029 assertions passed  85.27ms
  Total failed: 0 / 6,364,930  - Service oriented architecture PASSED  11.12s

 2.8. External database: 
  - TQuery: 2,003 assertions passed  54.56ms
  - SynDBRemote: 20,063 assertions passed  5.10s
  - External records: 2 assertions passed  874us
  - Auto adapt SQL: 543 assertions passed  88.91ms
  - Crypted database: 176,192 assertions passed  390.27ms
  - External via REST: 170,353 assertions passed  15.68s
  - External via virtual table: 170,353 assertions passed  29.97s
  - External via REST with change tracking: 180,453 assertions passed  40.55s
  Total failed: 0 / 719,962  - External database PASSED  91.86s

 2.9. Multi thread process: 
  - Create thread pool: 1 assertion passed  740us
  - TSQLRestServerDB: 4,822 assertions passed  3.73s
     1=625/s  2=590/s  5=668/s  10=610/s  30=795/s  50=639/s  
  - TSQLRestClientDB: 4,822 assertions passed  3.15s
     1=586/s  2=711/s  5=800/s  10=847/s  30=939/s  50=835/s  
  - TSQLHttpClientWinSock_WinSock: 4,822 assertions passed  7.68s
     1=582/s  2=913/s  5=835/s  10=792/s  30=756/s  50=629/s  
  - Locked: 4,822 assertions passed  2.94s
     1=562/s  2=780/s  5=885/s  10=895/s  30=1102/s  50=970/s  
  - Unlocked: 4,822 assertions passed  3.62s
     1=593/s  2=586/s  5=571/s  10=703/s  30=850/s  50=801/s  
  - Background thread: 4,822 assertions passed  3.54s
     1=654/s  2=863/s  5=716/s  10=729/s  30=711/s  50=522/s  
  - Main thread: 4,822 assertions passed  1.19s
     1=1932/s  2=2051/s  5=2076/s  10=2083/s  30=2349/s  50=1974/s  
  Total failed: 0 / 33,755  - Multi thread process PASSED  25.88s


Using mORMot 1.18.749 PRTL FTS3
Running on Linux 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:23:46 UTC 2014
TSQLite3LibraryDynamic running 3.8.7.4 with internal MM
Generated with: Kylix 3 compiler
Tests performed at 26/01/2015 11:39:43

Total assertions failed for all test suits:  0 / 15,074,301
! All tests passed successfully.

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

Offline

#7 2015-01-26 14:53:03

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: TestSQL3 for Kylix ?

ab wrote:

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 directory

I 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 ?

ab wrote:

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 ? ....

Last edited by ComingNine (2015-01-26 14:56:51)

Offline

#8 2015-01-26 16:40:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

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.

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.

Offline

#9 2015-01-26 17:40:06

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: TestSQL3 for Kylix ?

The Kylix IDE is still 99.999% dead, but mORMot with Crosskylix is far from Dead. Now SOA tests DO PASS with CrossKylix!!! hein this is really nice indeed. I was able to reproduce some issue with External database in TestSQL3 and TSynTable.

I would like to create a web app using Kylix, zeoslib and SmartMobileStudio, but I suspect that zeoslib 7.2 with Kylix 3 it is not supported anymore...

Synopse mORMot Framework Automated tests
  ------------------------------------------


1. Synopse libraries

1.1. Low level common:
!  - TSynTable: 1 / 50 FAILED  115.00ms


2.8. External database:
  - TQuery: 2,003 assertions passed  32.90ms
  - SynDBRemote: 20,063 assertions passed  5.51s
  - External records: 2 assertions passed  522us
  - Auto adapt SQL: 543 assertions passed  218.28ms
  - Crypted database: 176,192 assertions passed  594.27ms
!  - External via REST: 21,981 / 170,353 FAILED  329.80s
!  - External via virtual table: 21,981 / 170,353 FAILED  318.98s
!  - External via REST with change tracking: 22,992 / 180,453 FAILED  316.63s

  Total failed: 66,954 / 719,962  - External database FAILED  971.78s

2.9. Multi thread process:
  - Create thread pool: 1 assertion passed  6.17ms
  - TSQLRestServerDB: 4,822 assertions passed  402.61ms
     1=4039/s  2=5945/s  5=6811/s  10=7374/s  30=8609/s  50=7640/s 
  - TSQLRestClientDB: 4,822 assertions passed  712.27ms
     1=1809/s  2=1872/s  5=4554/s  10=6525/s  30=7823/s  50=6684/s 
  - TSQLHttpClientWinSock_WinSock: 4,822 assertions passed  6.18s
     1=1708/s  2=2179/s  5=1124/s  10=2188/s  30=2020/s  50=1594/s 
  - Locked: 4,822 assertions passed  469.70ms
     1=3487/s  2=4978/s  5=5723/s  10=6474/s  30=6821/s  50=6018/s 
  - Unlocked: 4,822 assertions passed  445.23ms
     1=3517/s  2=5071/s  5=6353/s  10=7012/s  30=7794/s  50=6499/s 
  - Background thread: 4,822 assertions passed  1.44s
     1=3320/s  2=1622/s  5=1397/s  10=2524/s  30=1747/s  50=1025/s 
  - Main thread: 4,822 assertions passed  444.70ms
     1=4094/s  2=5965/s  5=5925/s  10=6251/s  30=6586/s  50=5651/s 
  Total failed: 0 / 33,755  - Multi thread process PASSED  10.11s

Using mORMot 1.18.749 PRTL FTS3
Running on Linux 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:12 UTC 2014
TSQLite3LibraryDynamic running 3.8.7.4 with internal MM
Generated with: Kylix 3 compiler
Tests performed at 26-01-2015 12:25:25

/home/warleyalex/myk/proj2/TestSQL3 unknown (2015-01-26T11:56:52)
Host=warleyalex User=unknown CPU=1/1 OS=Linux-3.13.0-32-generic#57-Ubuntu-SMP-Tue-Jul-15-03:51:12-UTC-2014 Wow64=0 Freq=1000000000
TSQLLog 1.18.749 PRTL FTS3 2015-01-26T12:07:39

20150126 12073917 EXCOS EAccessViolation (FBEE0101) at 000370F4 SynCommons.TJSONCustomParserRTTI.ComputeFullPropertyName (27043)  stack trace 0005CE6D SynCrtSock.TWinHttpAPI.Request (5703) 0005D01D SynCrtSock.EWinINet.Create (5756) 0000046A System.QueryPerformanceCounter 000005D7 System.DeleteBlock 00002665 System.TextOpen 0000F5F5 SysUtils.GetLocaleFormatSettings 0000F62A SysUtils.GetLocaleFormatSettings 00029B56 SynCommons.StringToUTF8 (12906) 000CFAD1 SynSQLite3Static.sqlite3_create_collation (1298) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 
20150126 12073920 EXCOS EAccessViolation (FBEE0101) at 000370F4 SynCommons.TJSONCustomParserRTTI.ComputeFullPropertyName (27043)  stack trace 0005CE6D SynCrtSock.TWinHttpAPI.Request (5703) 0005D01D SynCrtSock.EWinINet.Create (5756) 0000046A System.QueryPerformanceCounter 00002D49 System.@WriteSpaces 0000263D System.TextOpen 000CFAD1 SynSQLite3Static.sqlite3_create_collation (1298) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 
20150126 12073922 warn  #50 Access violation at address 080819F4, accessing address 00000000
20150126 12073922 fail  TTestLowLevelCommon(0875AEE8) Low level common: TSynTable "Access violation at address 080819F4, accessing address 00000000" stack trace 000D07E3 SynSQLite3Static.sqlite3_create_collation (1298) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 
20150126 12091106 warn  #4329 
20150126 12091106 fail  TTestExternalDatabase(0875DCD8) External database: External via REST "" stack trace 000F26D7 mORMot.TSQLPropInfoRTTIWide.GetBinary (16044) 000F0D59 mORMot.TSQLPropInfoRTTIDouble.SetFieldSQLVar (15355) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 
20150126 12091107 warn  #4330 
20150126 12091107 fail  TTestExternalDatabase(0875DCD8) External database: External via REST "" stack trace 000F26FA mORMot.TSQLPropInfoRTTIWide.GetHash (16049) 000F0D59 mORMot.TSQLPropInfoRTTIDouble.SetFieldSQLVar (15355) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 
20150126 12091108 warn  #4342 

20150126 12251504 warn  #180443 
20150126 12251504 fail  TTestExternalDatabase(0875DCD8) External database: External via REST with change tracking "" stack trace 000F1EEF mORMot.TSQLPropInfoRTTIWinAnsi.GetHash (15843) 000F2085 mORMot.TSQLPropInfoRTTIWinAnsi.CompareValue (15874) 000F3CD3 mORMot.TSQLPropInfoList.Add (16864) 000F0D79 mORMot.TSQLPropInfoRTTIDouble.SetFieldSQLVar (15360) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 

20150126 12251504 warn  #180453 
20150126 12251504 fail  TTestExternalDatabase(0875DCD8) External database: External via REST with change tracking "" stack trace 000F1EEF mORMot.TSQLPropInfoRTTIWinAnsi.GetHash (15843) 000F20A1 mORMot.TSQLPropInfoRTTIWinAnsi.CompareValue (15876) 000F3CD3 mORMot.TSQLPropInfoList.Add (16864) 000F0D79 mORMot.TSQLPropInfoRTTIDouble.SetFieldSQLVar (15360) 00101A28 mORMot.TSQLRest.UpdateField (25444) 00101D13 mORMot.TSQLRest.UpdateBlob (25602) 000096E6 SysUtils.SysConst 0000973C SysUtils.SysConst 

it is wonderful that there is finally some movement again on the kylix project.
Congratulations.

Offline

#10 2015-01-26 18:23:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

Ensure you retrieved by hand the .json files as needed by the regression tests.
See above.

Offline

#11 2015-01-27 01:50:14

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: TestSQL3 for Kylix ?

ab wrote:

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 !

ab wrote:

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.
JL0dzq6.png
PHr0uml.png
However, I still got

./TestSQL3: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

Could you be kind enough to help to comment why CrossKylix-compiled executable cannot load the libz.so* files in the same directory ?

Last edited by ComingNine (2015-01-27 02:13:29)

Offline

#12 2015-01-27 08:10:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,224
Website

Re: TestSQL3 for Kylix ?

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\Test

Do you have any warning during compilation?

Putting the .so with the executable does not mean anything in Linux, AFAIK.
The .so have to be installed as system library.
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)

What is your distribution?

I do not understand why your executable is searching for libz.so.1.
In SynZip.pas you have:

{$ifdef linux}
const
  ZLIB_VERSION = '1.2.5';
  libz='libz.so';
...

Are you sure your source code is up to date?

Offline

#13 2015-01-27 08:23:58

ComingNine
Member
Registered: 2010-07-29
Posts: 294

Re: TestSQL3 for Kylix ?

Thank you very much for your efforts to help !

ab wrote:

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\Test

Do 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.

ab wrote:

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 ?

ab wrote:

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.

ab wrote:

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").

ab wrote:

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.

ab wrote:

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 ?

ab wrote:

Are you sure your source code is up to date?

Yes.

Last edited by ComingNine (2015-01-27 08:39:14)

Offline

#14 2015-01-27 14:34:29

warleyalex
Member
From: Sete Lagoas-MG, Brasil
Registered: 2013-01-20
Posts: 250

Re: TestSQL3 for Kylix ?

Hi. I didn't add the neither librt.so nor libz.so files to CrossKylix bin folder and TestSQL3 worked great. You just have to create links, for instance:
ls -s /lib/i386-linux-gnu/librt-2.19.so  /lib/i386-linux-gnu/librt.so
ls -s /lib/i386-linux-gnu/libz.so.1.2.8  /lib/i386-linux-gnu/libz.so

You can even create links to json files and worked fine.

I was wondering why section (2.8. External database) are so sluggish sad I think you can't use zeoslib 7.2 either.

Offline

Board footer

Powered by FluxBB