You are not logged in.
Pages: 1
Just updated the sources (was 2 months old).
Trying TServiceFactory.Get().Add(TObjectList) got:
Access violation at address 00000000009E139F in module '.exe'. Read of address FFFFFFFFFFFFFFFF
at mORMot.pas line 31130:
tkClass: begin
Obj := pointer(GetOrdProp(Value,pointer(P))); // works also for CPU64 <- AV here
It happens only on x64 build, 32bit works fine, and is due to something changed last few months (worked fine before source update).
Can debug further if needed.
Offline
Had to go out of the office now, tomorrow will isolate simple code, test data and figure out the problem, if still needed.
Offline
Multithreaded x64 debugging is so hard ... ide crashes at random
Anyway, trying to ObjectToJSON() an object, which contains TObjectList as a property.
The AV is on the next line 31130 at TJSONSerializer.WriteObject:
if (not TSQLRecord(Value).fFill.JoinedFields) and (P^.PropType^^.ClassSQLFieldType=sftID) then
here Value if of class TObjectList, recognized as Kind tkClass.
but why you try to cast this object as TSQLRecord and try to access a field of it (fFill in this case)? this definitely will lead to random AV ...
Simple fix works if compiler optimizations is turned on and exchange the if's AND statements like:
if (P^.PropType^^.ClassSQLFieldType=sftID) and (not TSQLRecord(Value).fFill.JoinedFields) then
At run-time first will be checked P^.PropType^^.ClassSQLFieldType which is sftUnknown and skip erroneous cast and go the else clause and finally return json without the AV
Hope my explanations are understandable and will help.
Offline
Oups... this was just awful!
Should be fixed by now.
See http://synopse.info/fossil/info/bebd8a2ce7
Thanks for the report.
Online
Pages: 1