#1 2021-11-30 21:18:55

tbo
Member
Registered: 2015-04-20
Posts: 345

Commit ec0aadf

Delphi 2007, mORMot2 commit ec0aadf

I have two problems with this commit.

1) Only when compiled with debug configuration:

[DCC Warnung] mormot.rest.client.pas(1195): W1035 Rückgabewert der Funktion 'TRestClientAuthentication.ClientGetSessionKey' könnte undefiniert sein

2) It leaks memory. No memory is leaked with the 2021-11-18 version.

A memory block has been leaked. The size is: 36

This block was allocated by thread 0x690, and the stack trace (return addresses) at the time was:
004032c8 +004 xxx.exe System               213  +0 @GetMem
008e4048 +03c xxx.exe mormot.crypt.core   6414  +2 AesAlgoNameEncode
008f3e95 +105 xxx.exe mormot.crypt.secure 3787 +20 GlobalCryptAlgoInit
008f22b3 +02f xxx.exe mormot.crypt.secure 2932  +2 TCryptAlgo.Implements
00e75360 +03c xxx.exe mormot.crypt.ecc    4357  +8 initialization
00405d85 +03d xxx.exe System               213  +0 InitUnits
00405dea +03a xxx.exe System               213  +0 @StartExe
00408b92 +03a xxx.exe SysInit                      @InitExe
00e773be +016 xxx.exe xxx                  479  +0 initialization
76ddefaa +010 kernel32.dll                         BaseThreadInitThunk

The block is currently used for an object of class: AnsiString

The allocation number is: 106487


This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):

13 - 20 bytes: AnsiString x 18
21 - 36 bytes: AnsiString x 77

With best regards
Thomas

Offline

#2 2021-12-01 09:08:16

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

Re: Commit ec0aadf

I am not able to reproduce your problem.

On my side the regression tests do compile with no message and do pass, from Delphi 2007.
And there is no memory leak reported either by our mormot.core.fpcx64mm.pas memory manager or FastMM4 in FullDebugMode (FDM flag in the regression tests console output).

    1 x Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz (x86)
    on VBOX - 1 Oracle VM VirtualBox Version 6.1.30 VGA BIOS
Using mORMot 2.0.1 FDM
    TSqlite3LibraryStatic 3.36.0 with internal MM
Generated with: Delphi 2007 32 bit Win compiler

Time elapsed for all tests: 4m12
Performed 2021-12-01 10:06:17 by User on PCVM

Total assertions failed for all test suits:  0 / 60,071,839
! All tests passed successfully.

Perhaps it is about the DEBUG state.

Delphi 2007 is clearly outdated and full of bugs, especially about inlining.
We already spent a lot of time to make mORMot compile and run with it.
But we need to be able to reproduce the problem.
We are open to any pull request to circumvent any Delphi 2007 limitations, but it is clearly not a proven target for future applications.

Offline

Board footer

Powered by FluxBB