In the past days I have tried to solve a problem that came up after switching on OPENSLL with static libs. To be more specific, when i declare an object as follows:
Code: Select all
DVInterface dvi(opt_cfgName);
Code: Select all
.\crypto\mem.c (79): DicomViewer.exe!default_malloc_ex() + 0xD bytes
.\crypto\mem.c (306): DicomViewer.exe!CRYPTO_malloc() + 0x12 bytes
.\crypto\objects\o_names.c (195): DicomViewer.exe!OBJ_NAME_add() + 0x11 bytes
.\crypto\evp\c_alld.c (72): DicomViewer.exe!OpenSSL_add_all_digests() + 0x14 bytes
.\crypto\evp\c_all.c (90): DicomViewer.exe!OPENSSL_add_all_algorithms_noconf()
e:\library\dcmtk 3.6.3\dcmtk-3.6.3\dcmtk-3.6.3\dcmsign\libsrc\dcsignat.cc (65): DicomViewer.exe!DcmSignature::initializeLibrary()
e:\library\dcmtk 3.6.3\dcmtk-3.6.3\dcmtk-3.6.3\dcmpstat\libsrc\dviface.cc (160): DicomViewer.exe!DVInterface::DVInterface()
g:\mihai\proiecte\pixeldata.dicom.viewer\dcmtk viewer\waitdlg.cpp (6297): DicomViewer.exe!CWaitDlg::SendStoredPrintObject() + 0x11 bytes
g:\mihai\proiecte\pixeldata.dicom.viewer\dcmtk viewer\waitdlg.cpp (5900): DicomViewer.exe!CWaitDlg::SendImagesToPrintFree() + 0x11 bytes
g:\mihai\proiecte\pixeldata.dicom.viewer\dcmtk viewer\waitdlg.cpp (5794): DicomViewer.exe!CWaitDlg::DcmPrintFree() + 0xC bytes
After some research, I came with the conclusion that the leaks are (maybe) from DCMSignature:
Code: Select all
void DcmSignature::initializeLibrary()
{
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
}
After I compiled the latest OPENSSL available (DLL version) I came with the conclusion that Visual Studio, and after some research, Visual Leak detector can't find leaks in DLLs without includind the "vld.h" file in a certain file of the DLL, so the leaks are detected just if I use dcmtk with OPENSSL in static library. So i recompiled the latest OPENSSL library (static version now) and the leaks appeared again.
I don't know if it's a problem that memory from OPENSSL isn't freed in the library or me using the library incorectly. I hope I made my problem clear.
Thank you,
Mihai