#1 Yesterday 13:13:20

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

got av in mormot.core.unicode after update

Hi Arnaud,

after update (since Februar) I got under linux/fpc 3.2.0 with -02/-03 following av:

An unhandled exception occurred at $000000000052D2F4:
EAccessViolation: Access violation
  $000000000052D2F4  CASECOPY,  line 7632 of ../../mORMot2/src/core/mormot.core.unicode.pas
  $0000000000415F24
  $0000000000CA7401  ADDIMPLEMENTATION,  line 1803 of ../../mORMot2/src/soa/mormot.soa.server.pas
  $000000000051ADAA  SERVICEREGISTER,  line 7400 of ../../mORMot2/src/rest/mormot.rest.server.pas

With -01 it works. Under Windows/Delphi 10.4 it works too.

Greetings,
Daniel

Offline

#2 Yesterday 14:19:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,000
Website

Re: got av in mormot.core.unicode after update

Weird.
I am not able to reproduce it here.
What is the interface type name?

Do the mormot2tests regressions pass with this compiler?

Try to disable inlining of this function in mormot.core.unicode.pas by adding a comment:

function LowerCase(const S: RawUtf8): RawUtf8;
//  {$ifdef HASINLINE} inline; {$endif}

and/or in mormot.core.base.pas:

function FastNewString(len: PtrInt; codepage: PtrInt = CP_RAWBYTESTRING): pointer;
//  {$ifdef HASINLINE}inline;{$endif}

Offline

#3 Yesterday 14:33:17

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

Re: got av in mormot.core.unicode after update

disable inlining in FastNewString was it! Thanks a lot.

(mormot2tests doesn't compile, I don't know what's wrong. No error, just Error in ./build_fpc.sh on line 117)

Offline

#4 Yesterday 14:52:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,000
Website

Re: got av in mormot.core.unicode after update

Seems like a compiler bug to me.

Weird that it was not reported sooner.

Please try with
https://github.com/synopse/mORMot2/commit/e56527786

Offline

#5 Yesterday 16:57:29

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

Re: got av in mormot.core.unicode after update

Perfect!

Test are also successfully.
(mget was missing, in build_fpc.sh before compiling test a line for building mget works for me:

>fpc -MDelphi -Sci -Ci -g -gl -gw2 -Xg -k'-rpath=$ORIGIN' -k-L$BIN \
...
-B -Se1 "$LIB2/src/tools/mget/mget.dpr"

But some memleaks were reported:

WARNING! THIS PROGRAM LEAKS MEMORY!
Memory Status:
Small:  33/5KB  including tiny<=128B arenas=8 fed from Medium
Medium: 13MB/117MB    peak=53MB current=11 alloc=94 free=83 sleep=4
Large:  0B/4GB    peak=27MB current=0 alloc=2K free=2K sleep=0
Total Sleep: count=4
Small Blocks since beginning: 54M/5GB (as small=45/46 tiny=56/56)
  48=19M  64=10M  16=5M  80=4M  96=2M  528=1M  112=1M  32=1M
Small Blocks current: 33/5KB
  128=10  32=8  160=4  304=2  48=2  288=2  112=2  352=2

Offline

#6 Yesterday 19:44:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,000
Website

Re: got av in mormot.core.unicode after update

It is weird there is no leak reported for me for mget or mormot2tests.

Offline

#7 Today 12:38:08

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

Re: got av in mormot.core.unicode after update

Memleak reported comes from TTestCoreEcc

Offline

#8 Today 13:19:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,000
Website

Re: got av in mormot.core.unicode after update

No reported on my side, sadly.

No more info about the leak, from fpcmmx64 or heaptrc?

Offline

#9 Today 14:09:25

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

Re: got av in mormot.core.unicode after update

It looks like heaptrc...

Memory Status:
Small:  1/880B  including tiny<=128B arenas=8 fed from Medium
Medium: 2MB/132MB    peak=53MB current=2 alloc=106 free=104 sleep=3
Large:  0B/4GB    peak=27MB current=0 alloc=3K free=3K sleep=0
Total Sleep: count=3
Small Blocks since beginning: 46M/4GB (as small=45/46 tiny=56/56)
  48=16M  64=9M  16=5M  80=4M  96=2M  112=1M  528=1M  32=1M
Small Blocks current: 1/880B
  880=1

Leaks Identified:
small block leak x1 of size=880  (getmem=10373 freemem=10372)
Total small block leaks = 1
probable TEccCertificateSecret leak (808/880 bytes) at $00007FF4FD390CE0
Total objects leaks = 1

Offline

#10 Today 14:37:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,000
Website

Re: got av in mormot.core.unicode after update

I am not able to reproduce it here.

Are you still using FPC 3.2.0 ?

Offline

#11 Today 15:18:19

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 383

Re: got av in mormot.core.unicode after update

fpc -iW shows

3.2.0-r45643

Offline

Board footer

Powered by FluxBB