pleriche / FastMM4

A memory manager for Delphi and C++ Builder with powerful debugging facilities
447 stars 158 forks source link

FastMM4-AVX 1.06: AV in Delphi 10.4.2 #86

Closed MaxTerentiev closed 3 years ago

MaxTerentiev commented 3 years ago

Empty app fails to run with AV with latest FastMM4-AVX version ! X32 build works but x64 fails.

maximmasiutin commented 3 years ago

How can I reproduce it? I've tried under 64-bit (both Release and Debug) with default conditional defines, and it works.

MaxTerentiev commented 3 years ago

Hi,

Attached AV error, debugger screenshot with line number and also example project for reproducing problem.

Running on Windows 10, Core i7 4960x CPU

FastMM-AVX Bug.zip

AV_Error Debugger_Break

MaxTerentiev commented 3 years ago

Hi Maxim,

I was sent example project to issue thread on github.


With best regards, Max Terentiev. Business Software Products. AMS Development Team. @.***

From: Maxim Masiutin @.*** Sent: Thursday, June 10, 2021 11:06 PM To: pleriche/FastMM4 Cc: MaxTerentiev; Author Subject: Re: [pleriche/FastMM4] FastMM4-AVX 1.06: AV in Delphi 10.4.2 (#86)

How can I reproduce it? I've tried under 64-bit (both Release and Debug) with default conditional defines, and it works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pleriche/FastMM4/issues/86#issuecomment-859004319 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX45RVMKJJBIFSCE4EFZSTTSELJPANCNFSM46PAI4NA . https://github.com/notifications/beacon/ADX45RWJJYIBNJOFC57Y6YDTSELJPA5CNFSM46PAI4NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGMZV3HY.gif

maximmasiutin commented 3 years ago

Thank you very much, I will take care of this in a couple of days.

maximmasiutin commented 3 years ago

Can you please, just for test, define an alignment of 32 bytes? Just try the following directive

{$define Align32Bytes}

(or add to the IDE options).

Please also try to align by 16 bytes as well (Align16Bytes). So we will know for sure what is the reason. The vmodqa instructions generates an access violation when the data is not aligned, however, there may be other reasons. And I have tested mainly on a CPU that supports the "Fast Short REP MOVSB CPU" (FSRM) feature, so it probably didn't use the AVX copy routines at all because the FSRM is more efficient.

MaxTerentiev commented 3 years ago

Hi,

I tried both {$define Align16Bytes} and then {$define Align32Bytes}

in Fastmm4Options.inc each time clean & rebuild projects but got same error in both cases !

Debugger stops on same source line 4056


With best regards, Max Terentiev. Business Software Products. AMS Development Team. @.***

From: Maxim Masiutin @.*** Sent: Friday, June 11, 2021 3:49 PM To: pleriche/FastMM4 Cc: MaxTerentiev; Author Subject: Re: [pleriche/FastMM4] FastMM4-AVX 1.06: AV in Delphi 10.4.2 (#86)

Can you please, just for test, define an alignment of 32 bytes? Just try the following directive

{$define Align32Bytes}

(or add to the IDE options).

Please also try to align by 16 bytes as well (Align16Bytes). So we will know for sure what is the reason. The vmodqa instructions generates an access violation when the data is not aligned, however, there may be other reasons. And I have tested mainly on a CPU that supports the "Fast Short REP MOVSB CPU" (FSRM) feature, so it probably didn't use the AVX copy routines at all because the FSRM is more efficient.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pleriche/FastMM4/issues/86#issuecomment-859557876 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADX45RUI4YQQS4YFBKRHF3LTSIA4VANCNFSM46PAI4NA . https://github.com/notifications/beacon/ADX45RQ2ZTO5VQICYZWGIKDTSIA4VA5CNFSM46PAI4NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGM5475A.gif

maximmasiutin commented 3 years ago

Thank you, I have just fixed it. Could you please check!?

maximmasiutin commented 3 years ago

Could you please close this issue here as I have configured the FastMM4-AVX to allow creating issues.

MaxTerentiev commented 3 years ago

I check with default Options.inc and It's worked now ! Thank you very much !