Closed stupid0319 closed 7 months ago
Can you please post minimal reproducible code?
Have you tried to debug with gdb
to find out where it crashes?
Also please try to build with WITH_LIBZIP
so we can establish it's not an issue inside Minizip?
S32 fileLength = 0;
S8 *sourceFile = readFile(filename, &fileLength);
if (sourceFile == NULL)
{
MessageBox(NULL, filename, "Error opening .xlsx file@1", MB_OK);
return 0;
}
if ((xlsxioread = xlsxioread_open_memory(sourceFile, fileLength, 1)) == NULL)
{
free(sourceFile);
MessageBox(NULL, filename, "Error opening .xlsx file@2", MB_OK);
return 0;
}
xlsxioread_close(xlsxioread);
//free(sourceFile);
this code only crash when xlsxioread_open_memory freedata = 1, I tried use ollydbg to debug, but can't attach, xlsxio-0.2.34-binary-win64.zip is just download from github release, https://github.com/brechtsanders/xlsxio/releases I will try gdb.
warning: Critical error detected c0000374
Thread 1 "shopeeplp" received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffc7121c733 in ntdll!RtlIsZeroMemory () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll (gdb) backtrace
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
I think malloc of cygwin (use unix api) and malloc of windows (use win api) is not same function, so malloc in cygwin and free in winapi will do this error. thinks for reply
Did you debug a static build?
The downloadable binaries are for MinGW-w64, not Cygwin.
Please don't mix target platforms within your builds.
Their malloc()
will definitely be different and incompatible!
If you want to use it from Cygwin, build with Cygwin from source.
In general when targetting Windows it's best to aim for native (MinGW-w64) builds.
using in cygwin xlsxioread_open_memory , param freedata not zero will crash, I think zip_source_buffer_create has a bug.