#1 2010-08-15 06:27:08

CodeMonkey
Member
Registered: 2010-08-15
Posts: 4

Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

I am using SynopseSQLite3 v1.8 with Delphi2010 Professional on Windows 7 x32.

I can compile TestSQL3 with no problems but when I try to run it I get a variety of errors.

SynZip.TZipRead.Create()
Throws 'Range check error' exception on line 675 -called by line 183 of SynSelfTests.TTestCompression.ZipFormat()

I wanted to see if this was the only issue so I commented out the ZipRead test and hit the next error:
Sqlite3.CreateSQLEncryptTableBytes()
Throws 'Integer overflow' exception on line 1620 for variable 'k'

If I redeclare variable k as int64 I can proceed to next error.

SynCrtSock.GetCardinal()
Throws 'Range check error' exception on line 1379

at this point I stopped.

Has anyone else run into these issues with Delphi 2010?

Last edited by CodeMonkey (2010-08-15 06:52:17)

Offline

#2 2010-08-15 06:44:03

CodeMonkey
Member
Registered: 2010-08-15
Posts: 4

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

After making the 2 code changes mentioned above I found I can get the rest of the tests to run.
Added comments to reports below.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Synopse SQLite3 Framework Automated tests
  -------------------------------------------


1. Synopse libraries

1.1. Low level common:
  - System copy record: 22 assertions passed
  - Fast string compare: 7 assertions passed
  - Url encoding: 104 assertions passed
  - Soundex: 29 assertions passed
  - Numerical conversions: 150000 assertions passed
  - Curr64: 20012 assertions passed
  - CamelCase: 5 assertions passed
  - Bits: 4614 assertions passed
  - Ini files: 7000 assertions passed
  - UTF8: 6006 assertions passed
  Total failed: 0 / 187799  - Low level common PASSED

1.2. Low level types:
  - Iso8601 date and time: 24000 assertions passed
  - Url decoding: 1200 assertions passed
  - RTTI: 21 assertions passed
  - Json encode decode: 606 assertions passed
  Total failed: 0 / 25827  - Low level types PASSED

1.3. Cryptographic routines:
  - Adler32: 1 assertion passed
  - MD5: 1 assertion passed
  - SHA1: 5 assertions passed
  - SHA256: 5 assertions passed
  - AES256: 600 assertions passed
  - Base64: 2000 assertions passed
  Total failed: 0 / 2612  - Cryptographic routines PASSED

1.4. Compression:
  - In memory compression: 12 assertions passed
  - Gzip format: 2 assertions passed                <<<<<1st failure, test aborts here unless zipread test is bypassed
  - Zip format: 2 assertions passed
  Total failed: 0 / 16  - Compression PASSED

1.5. Synopse PDF:
  - TPdfDocument: 4 assertions passed
  - TPdfDocumentGDI: 3 assertions passed
  Total failed: 0 / 7  - Synopse PDF PASSED


2. SQLite3

2.1. Basic classes:
  - TSQLCache: 612 assertions passed
  - TSQLRecord: 22 assertions passed
  - TSQLRecordSigned: 200 assertions passed
  - TSQLModel: 3 assertions passed
  Total failed: 0 / 837  - Basic classes PASSED

2.2. File based:                                   <<<<2nd failure with integer overflow, test aborts here unless var 'k' is changed
  - Direct access: 5 assertions passed
  - TSQLTableJSON: 20030 assertions passed
  - TSQLRestClientDB: 16072 assertions passed
  Total failed: 0 / 36107  - File based PASSED

2.3. File based WAL:
  - Direct access: 5 assertions passed
  - TSQLTableJSON: 20030 assertions passed
  - TSQLRestClientDB: 16072 assertions passed
  Total failed: 0 / 36107  - File based WAL PASSED

2.4. Memory based:
  - Direct access: 4 assertions passed
  - TSQLTableJSON: 20030 assertions passed
  - TSQLRestClientDB: 82143 assertions passed
  Total failed: 0 / 102177  - Memory based PASSED

2.5. Client server access:
  - TSQLite3HttpServer: 3 assertions passed
!  - TSQLite3HttpClient: 1 / 1 FAILED
!  - Http client keep alive: 2 / 2 FAILED
     first in 951us,
!  - Http client multi connect: 2 / 2 FAILED
     first in 872us,
  - Named pipe access: 3003 assertions passed
     first in 83.75ms, done in 223.15ms i.e. 4481/s, average 223us
  - Local window messages: 3002 assertions passed
     first in 199us, done in 91.80ms i.e. 10893/s, average 91us
  - Direct in process access: 3001 assertions passed
     first in 51us, done in 45.00ms i.e. 22218/s, average 45us
  Total failed: 5 / 9014  - Client server access FAILED


Synopse framework used: 1.8
SQlite3 engine used: 3.7.0
Generated with: Delphi 2010 compiler

Time elapsed for all tests: 10.07s
Tests performed at 8/14/2010 11:30:17 PM

Total assertions failed for all test suits:  5 / 400503

! Some tests FAILED: please correct the code.
Done - Press ENTER to Exit

Last edited by CodeMonkey (2010-08-15 06:47:11)

Offline

#3 2010-08-15 07:50:12

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

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

You MUST set range checking OFF for using the framework.

Some low-level optimization rely of range checking being OFF, because it access sometimes the trailing #0 in a string, for example, or access to some memory mapped data (in SynZip e.g.). This is not allowed by range checking, but it's 100% correct from the CPU point of view.

So set range checking OFF in your project properties, and everything will be OK. There will be no GPF or overflow problem, and the code will be much faster.

Offline

#4 2010-08-16 17:18:59

CodeMonkey
Member
Registered: 2010-08-15
Posts: 4

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

Still getting 'Integer overflow' exception.

Sqlite3.pas
line 1612
procedure CreateSQLEncryptTableBytes()

If you change var k from Integer to Int64 the Integer overflow exception goes away
and you can run the program with the range checking OFF.

Last edited by CodeMonkey (2010-08-16 17:58:04)

Offline

#5 2010-08-16 20:24:44

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

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

I usually compile the framework with Delphi 2010, and never got this exception.

I really don't know why you can have such an "Integer overflow" with range checking OFF.
I suspect a full "build" of the project must be made.

The code is definitively correct, and overflow in k := k*3+i line is exactly what we want to.
We need random data. And overflow will help randomizing.

Offline

#6 2010-08-17 07:28:58

CodeMonkey
Member
Registered: 2010-08-15
Posts: 4

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

Ah - found the problem. "Overflow checking" must be turned off as well.
Thanks for the help.

Offline

#7 2010-08-17 13:11:39

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

Re: Errors when trying to run v1.8 TestSQL3.dpr compiled with Delphi 2010

smile

Offline

Board footer

Powered by FluxBB