synopse / mORMot2

OpenSource RESTful ORM/SOA/MVC Framework for Delphi and FreePascal
https://synopse.info
Other
485 stars 122 forks source link

Exception in mormot.crypt.core.asmx64.inc._AesNiHashXmm0 #248

Closed jonjbar closed 2 months ago

jonjbar commented 2 months ago

I'm using Delphi 12 Patch 1 in 32-bit and 64-bit, with the just pulled Git version of mORMot from today.

When you try the attached sample project which tries to convert an EMF to a PDF, you'll see the following exception:

First chance exception at $00000000008A0BAD. Exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'. Process SynPdfEx.exe (11672)

Which is actually in procedure mormot.crypt.core.asmx64.inc._AesNiHashXmm0

screenshot

bogus.zip

synopse commented 2 months ago

I guess AesNiHash128() makes GPF because of out-of-memory-page reads.

I have changed the code to use four parallel crc32c() to compute a THash128. Please try https://github.com/synopse/mORMot2/commit/e650b37c

jonjbar commented 2 months ago

I can confirm that the latest updates fix this problem. As always, thank you for your amazing work 👍