#1 2015-04-09 13:16:40

jaclas
Member
Registered: 2014-09-12
Posts: 215

mORMot and ScaleMM = AV

I wrote a REST server. Everything works fine, but the performance in the threads is low. I changed the memory manager from FastMM to ScaleMM and now performance is high, but I have a new problem. When I close the application I get the AV:

q6Bk5U0a.png

Error raise this code (after press F8):

WMSgnedG.png


Callstack:

mORMot.JSONObject(TClass($649B740),-1,[cpWrite])
mORMot.TJSONSerializer.WriteObject($649B700,[woFullExpand])
mORMot.TJSONSerializer.WriteObject($649BC00,[woFullExpand])
SynCommons.TTextWriter.Add((105495552, False, #0, $649BC00, $649BC00 {':ź'#0#0'·I'#6#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'ŕąI'#6'ŕ–Ş'#3'”yj'#0#0#0#0#0'PŞ2'#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0}, $649BC00, '|:ź', $649BC00, TClass($649BC00), '?', '?'#$009F'??', $649BC00, $649BC00, $649BC00, $649BC00, $649BC00, $649BC00, $649BC00, 105495552, 7),twOnSameLine)
SynCommons.TTextWriter.Add('%.Destroy -> %',(...),twOnSameLine)
SynLog.TSynLog.LogInternal(sllInfo,'%.Destroy -> %',(...),nil)
SynLog.TSynLog.Log(sllInfo,'%.Destroy -> %',(...),nil)
mORMot.TSQLRest.Destroy

best regards

Offline

#2 2015-04-09 15:41:28

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

Re: mORMot and ScaleMM = AV

The error is raised during accessing the RTTI.
Since this RTTI is not computed by the framework, but generated by the compiler, this RTTI should by itself be immutable, and would not be affected by multi thread issues.
We run the full set of regression tests with FastMM4 in FullDebugMode, without any reported issue so far - so I guess the problem may not be in the framework itself, but how it is used.

So the problem may be in the application code itself, not in the framework itself.
The problem comes from an invalid object pointer, probably a class instance still accessed in your code after a call to Free.

1) Which version of ScaleMM are you using?

2) How did you protect your code from concurrent issues with multi threading?

3) Run the application with FastMM4 in FullDebugMode, to track potential invalid memory access, i.e. any class instance still accessed in your code after a call to Free.

Offline

#3 2015-04-09 17:24:23

jaclas
Member
Registered: 2014-09-12
Posts: 215

Re: mORMot and ScaleMM = AV

After few hours debugging... yes, you are right! :-)

I destroyed TSQLModel before TSQLRestServer which used it!

But why at FastMM I had no error? It was set to full debug mode. This is magic ;-)

ps. I use ScaleMM3 (not stable version 2).

ps. SynScaleMM is ready/stable and I can use it?

thx for support
best regards

Offline

Board footer

Powered by FluxBB