Crash in Logger::isEnabledFor (LogLevel ll) const

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
dicomDuty
Posts: 13
Joined: Fri, 2012-05-11, 20:57

Crash in Logger::isEnabledFor (LogLevel ll) const

#1 Post by dicomDuty »

I am using dcmtk-3.6.1_20140617. I have recompiled as /MD. I have recoded img2dcm and dcmsend to library functions (Same as I did in 3.5.4). I recoded everything back to /MT and I still have the exact some problem.

The img2dcm calls are working fine. Its the DcmSend code that is having problems, always crashing here:

bool
Logger::isEnabledFor (LogLevel ll) const
{
return value->isEnabledFor (ll);
}

Setting #define LOG4CPLUS_DISABLE_TRACE does not seem to matter.

Adding this:

dcmtk::log4cplus::Logger log = dcmtk::log4cplus::Logger::getRoot();
log.removeAllAppenders();
log.addAppender(nullapp);

Does not seem to matter. Any ideas? I read the other post (another person with the same crash, but I did not see any resolution). Any hints would be very helpful. It appears to be heap corruption.

Thanks!

Adding more info. The problem always occurs in the while loop adding dicom files:

while (if_iter != if_last)
{
currentFilename = (*if_iter).c_str();
/* and add them to the list of instances to be transmitted */
status = storageSCU.addDicomFile(currentFilename, opt_readMode, opt_checkUIDValues); <=== problem is here. Status is always good but the heap is corrupted
if (status.bad())

/* check for empty filename */
if (strlen(currentFilename) == 0)
currentFilename = "<empty string>";
/* if something went wrong, we either terminate or ignore the file */
if (opt_haltOnInvalidFile)
{
//OFLOG_FATAL(dcmsendLogger, "bad DICOM file: " << currentFilename << ": " << status.text());
CString strFileName = currentFilename;
CString strStatus = status.text();
CString strMessage = _T("bad DICOM file: ") + strFileName + _T(" status: ") + strStatus;
char * message = (char *) strMessage.GetString();
m_pCPrimDICOMCtrl->LogMsg(0, message);
cleanup();
//m_pCPrimDICOMCtrl->SendComplete(0, EXITCODE_INVALID_INPUT_FILE);
return eERROR_INVALID_INPUT_FILE;
} else {

//OFLOG_WARN(dcmsendLogger, "bad DICOM file: " << currentFilename << ": " << status.text() << ", ignoring file");
}
++numInvalidFiles;
}
++if_iter;
}

dicomDuty
Posts: 13
Joined: Fri, 2012-05-11, 20:57

Re: Crash in Logger::isEnabledFor (LogLevel ll) const

#2 Post by dicomDuty »

I meant to post this is general. Is there a way to move this? (Sorry...)

Thanks!

J. Riesmeier
DCMTK Developer
Posts: 2496
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Crash in Logger::isEnabledFor (LogLevel ll) const

#3 Post by J. Riesmeier »

I have recoded img2dcm and dcmsend to library functions
What do you mean by that? Both tools are actually based on C++ classes.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Google [Bot] and 1 guest