#401 PTrace infinite recursion

Development_Branch
closed-fixed
nobody
PTLib (142)
5
2013-01-10
2012-12-25
No

There is code in PTraceInfo::InternalBegin:

if (!m_filename.IsEmpty() && HasOption(RotateLogMask)) {
unsigned rotateVal = GetRotateVal(m_options);
if (rotateVal != m_lastRotate) {
OpenTraceFile(m_filename);
m_lastRotate = rotateVal;
if (m_stream == NULL)
SetStream(&cerr);
}
}

So PTraceInfo::InternalBegin calls PTraceInfo::OpenTraceFile, and OpenTraceFile calls PTraceInfo::InternalBegin again. And so on.
It's need to set "m_lastRotate = rotateVal;" before calling OpenTraceFile.

Stack trace:

(... skipped...)
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ead7b0) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02eae738) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ebe938) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0718) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0ee0) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02eb5310) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ead7b0) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02eae738) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ebe938) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0718) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0ee0) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02eb5310) Line 316 + 0x14 bytes C++
PTLibd.dll!PTraceInfo::InternalBegin(unsigned int level=4294967295, const char * fileName=0x00000000, int lineNum=0, const PObject * instance=0x00000000, const char * module=0x00000000) Line 531 C++
PTLibd.dll!PTraceInfo::OpenTraceFile(const char * newFilename=0x02ec0b78) Line 316 + 0x14 bytes C++

Discussion

  • Robert Jongbloed

    Fix applied to Eridani (PTLib 2.12, OPAL 3.12) and trunk, thank you very much!

     
  • Robert Jongbloed

    • status: open --> closed-fixed
     

Log in to post a comment.