#1 2015-01-05 19:57:09

FabricioAraujo
Member
Registered: 2015-01-05
Posts: 8

TestSQL3.dpr tests abend on invalid Variant

The GIT test simply exploded with an access violation (I put an EXIT at the start of method
since where I use Delphi does not use GIT and the port maybe is blocked).

But on the

procedure CheckNestedDoc

(SynSelfTests.pas) the following code gives an invalid variant operation exception (Lines 5644-5648):

  if discogs<>'' then begin
    FileFromString(JSONReformat(discogs),ChangeFileExt(discogsFileName,'2.json'));
    Disco := _JSON(discogs,aOptions); // returns an Unassigned variant - line 5646
    Check(Disco.releases._count<=Disco.pagination.items); // this line blows because Disco is unassigned
    for i := 0 to Disco.Releases._count-1 do begin

On SynCommons.pas (procedure _Json, line 29711), the line 5646 above triggers this code:

  if not TDocVariantData(Value).InitJSON(JSON,Options) then begin
    VarClear(Value);
    result := false;

What I should do?

Environment:
Nightly build expanded to c:\Sources\mormot
SQLLite3 obj put on folder C:\Sources\mormot\SQLite3
Embarcadero® Delphi® XE2 Version 16.0.4504.48759 Enterprise (Upd 4 Hotfix 1)
--> 32bit target (Debug config)   
Windows 7 Professional SP 1 64-bit with 8Gb Ram

Last edited by FabricioAraujo (2015-01-05 19:57:55)

Offline

#2 2015-01-05 21:22:37

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

Re: TestSQL3.dpr tests abend on invalid Variant

Delete the local json files.

Offline

#3 2015-01-07 17:41:36

FabricioAraujo
Member
Registered: 2015-01-05
Posts: 8

Re: TestSQL3.dpr tests abend on invalid Variant

ab wrote:

Delete the local json files.

No changes.

Offline

#4 2015-01-07 18:00:57

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

Re: TestSQL3.dpr tests abend on invalid Variant

What is the disco json file in the executable" folder?

Offline

#5 2015-01-07 18:12:09

FabricioAraujo
Member
Registered: 2015-01-05
Posts: 8

Re: TestSQL3.dpr tests abend on invalid Variant

Which one? In the folder, there's:

  • discogs.json

  • discogs2.json

  • discoExtract.json

Offline

#6 2015-01-07 18:16:20

FabricioAraujo
Member
Registered: 2015-01-05
Posts: 8

Re: TestSQL3.dpr tests abend on invalid Variant

Content of last of *.log files on the folder:
C:\Fontes\mormot\SQLite3\TestSQL3.exe 0.0.0.0 (2015-01-07 16:14:53)
Host=FABRICIO User=fabricio CPU=4*9-6-14857 OS=13.1=6.1.7601 Wow64=1 Freq=3117998
TSQLLog 1.18.674 2015-01-07T16:15:38

20150107 16153821 warn  Test failed:
20150107 16153821 fail  TTestLowLevelTypes(02096918) Low level types: Mustache renderer "" stack trace API 004C9386 004D16B7 004CFAC7 00694674 004D0B80 006E8A07 006EFA05 774833AA 77E49EF2 77E49EC5
20150107 16153824 warn  Test failed:
20150107 16153824 fail  TTestLowLevelTypes(02096918) Low level types: Mustache renderer "" stack trace API 004C9386 004D16B7 004CFAC7 00694674 004D0B80 006E8A07 006EFA05 774833AA 77E49EF2 77E49EC5
20150107 16153829 warn  Test failed:
20150107 16153829 fail  TTestLowLevelTypes(02096918) Low level types: Mustache renderer "" stack trace API 004C9386 004D16B7 004CFAC7 00694674 004D0B80 006E8A07 006EFA05 774833AA 77E49EF2 77E49EC5
20150107 16153833 warn  Test failed:
20150107 16153833 fail  TTestLowLevelTypes(02096918) Low level types: Mustache renderer "" stack trace API 004C9386 004D16B7 004CFAC7 00694674 004D0B80 006E8A07 006EFA05 774833AA 77E49EF2 77E49EC5
20150107 16153839 warn  Test failed:
20150107 16153839 fail  TTestLowLevelTypes(02096918) Low level types: Mustache renderer "" stack trace API 004C9386 004D16B7 004CFAC7 00694674 004D0B80 006E8A07 006EFA05 774833AA 77E49EF2 77E49EC5
20150107 16153839 EXC   EVariantInvalidOpError ("Invalid variant operation") at 00430140  stack trace 006E8A07 00408BF0 006EFA05 774833AA 77E49EF2 77E49EC5

Offline

#7 2015-01-07 20:05:41

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

Re: TestSQL3.dpr tests abend on invalid Variant

Enable detailed map for having the line numbers, and try to identify what is wrong.

Offline

#8 2015-01-09 18:04:03

FabricioAraujo
Member
Registered: 2015-01-05
Posts: 8

Re: TestSQL3.dpr tests abend on invalid Variant

What is the most dangerous scenario if I use the lib with this tests don't working?

Offline

#9 2015-01-09 18:46:19

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

Re: TestSQL3.dpr tests abend on invalid Variant

You may have an exception at runtime, but you would not loose any data.

Those "mustache" tests probably means that the test process was not able to retrieve the Mustache official regression tests from the Internet.
Nothing to worry about.

Offline

#10 2016-01-06 18:24:12

wienani
Member
Registered: 2012-08-31
Posts: 29

Re: TestSQL3.dpr tests abend on invalid Variant

Hi Ab, I have same error using _Count and _Kind if JSON per line ( _(n) ) is not dvArray or dvObject.

Example:
- "Test" : "abc" --> this will raise 'invalid variant operation'
- "Test" : [{..},{..}] --> not raise error
- "Test" : {"..":".."} --> not raise error

Maybe same problem with above

Offline

Board footer

Powered by FluxBB