You are not logged in.
@hnb @ab
I'm found a case SynZip SOMETIMES fail to uncompress http response under FPC win64 (delphi if OK, fpc/Linux64 is OK).
After many attempts I'm reproduce situation in debug mode and dump a wrong gzipped file can be downloaded here (266 bytes)
The test case:
program Project1;
{$mode DELPHI}{$H+}
{$I Synopse.inc}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes,
SynZip,
SynCommons;
var
s: RawByteString;
a: AnsiString;
begin
s := StringFromFile('wrong.gzip');
a := CompressGZip(s, false);
end.
Result: Error -5 during uncompress mem
Error is raised inside paszlib/src/zinflate unit (inlined) and I'm not understand how to catch it
So I ask for a HELP
P.S. 99% of requests uncompressed well
Offline
OK, when let's use a SynZLibSSE by default for FPC/Win64 target? At last all my integration test is passed in this case. I create a pull request 82
Offline
Yes, but this mean all Intel Core i3 and UP (2010) & AMD Opteron and UP (2011). If we spoke about windows x64 target - almost all computers.
In any case IMHO better that it does not work at all than does not work stably.
This bug is really critical for me, because it depends on user input. User enter something on form (in browser), browser gzip request and server can't unzip it
Last edited by mpv (2018-02-16 06:55:41)
Offline
This is a FPC zlib bug...
maybe is worth to report this on FPC mantis bug tracker?
best regards,
Maciej Izak
Offline
Please check https://github.com/synopse/mORMot/commi … ff58e03490
Offline
I found some problems with this commit (can't even compile to verify):
1) Unicode Delphi (Win32) PtrUInt defined twice with a different declaration - once SynCrtSock:348 (PtrUInt = cardinal), second SynZip:275 (PtrUInt = NativeUInt)
2) FPC Win64. If USEZLIBSSE defined - folder fpc-win64/sse is missing (please, add it to github). If not defined - I got the strange compiler errors: "Error: Undefined symbol: memcpy" (and the same about memset, malloc, free)
Last edited by mpv (2018-02-18 18:44:19)
Offline
The missing files were added to the official sqlite3fpc.7z but you are right: I didn't add them to github.
Please also check https://synopse.info/fossil/info/8b8cf321c5
Offline
Delphi win32 is Ok now - thanks!
But FPC win64 fails with Undefined symbol: memcpy (memset, malloc, free) even for a program from the first topic post with USEZLIBSSE and without USEZLIBSSE. Either something wrong with FPC linker of with *.o files or with defines. Even don't know where to start...
Offline
Please check https://synopse.info/fossil/info/5881f48f25
Offline
Offline
i'm working on my first application using mormot2 + orm and i'm getting this same error when compiling.
Undefined symbol: memcpy (and the same about memset, malloc, free)
Lazarus 2.0.10 Win32
FPC 3.2.0
Win32 - Same error
Cross compile Win64 - Same error
Cross compile Linux64 - OK
Mormot2 with latest updates on git and latest static files (from git releases).
Last edited by macfly (2021-06-16 20:54:43)
Offline
Did you include mormot.lib.static.pas to your project?
I am not able to reproduce here. No problem to compile and run mormot2tests.lpi on Win32/Win64.
https://gist.github.com/synopse/550bb7b … d61c6550f8
Offline
Sorry for taking your time.
I was ignoring that it was necessary to include mormot.lib.static.pas.
Solved.
Offline
Thanks ab,
I updated and removed mormot.lib.static.pas from uses.
Now it compiles for Win32 but Win64 keeps asking for these functions, because LIBDEFLATESTATIC is not defined for it.
But it's ok, I'll leave mormot.lib.static.pas in the project.
mormot.defines.inc
{$ifdef OSWINDOWS}
{$ifdef CPUX86}
{$define LIBDEFLATESTATIC}
{$define LIBQUICKJSSTATIC}
{$endif CPUX86}
{$ifdef CPUX64}
{.$define LIBDEFLATESTATIC} // Win64 + FPC 3.2 = internal error 200603061 <<-------
{$define LIBQUICKJSSTATIC}
{$endif CPUX64}
{$endif OSWINDOWS}
Offline