Buffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx)
-
That sums it up pretty much - The line method executed before is
void Writer::DoWrite(QString auditEntry){
QByteArray ba = auditEntry.toLatin1();
char* aestr = ba.data();
std::string aestdstr(aestr);log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT"); LOG4CXX\_INFO(logger, aestdstr);//Buffer overrun happens somewhere in this method call
}
I did the search work - Yes,
aestdstr
is terminated with '\0'. I'm running out of ideas here. The detailed error message is calledQuote:
A buffer overrun has occurred in app.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program. For more details please see Help topic 'How to debug Buffer Overrun Issues'.
Fun fact is that no one has ever seen the help topic 'How to debug Buffer Overrun Issues' (here[^]). Any thoughts on the issue?
-
That sums it up pretty much - The line method executed before is
void Writer::DoWrite(QString auditEntry){
QByteArray ba = auditEntry.toLatin1();
char* aestr = ba.data();
std::string aestdstr(aestr);log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT"); LOG4CXX\_INFO(logger, aestdstr);//Buffer overrun happens somewhere in this method call
}
I did the search work - Yes,
aestdstr
is terminated with '\0'. I'm running out of ideas here. The detailed error message is calledQuote:
A buffer overrun has occurred in app.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program. For more details please see Help topic 'How to debug Buffer Overrun Issues'.
Fun fact is that no one has ever seen the help topic 'How to debug Buffer Overrun Issues' (here[^]). Any thoughts on the issue?
Looking at the documentation for
LOG4CXX_INFO
[^], I wonder if you should use thechar*
as the second parameter, like:char\* aestr = ba.data();
// std::string aestdstr(aestr);
log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT"); LOG4CXX\_INFO(logger, aestr);
}
-
Looking at the documentation for
LOG4CXX_INFO
[^], I wonder if you should use thechar*
as the second parameter, like:char\* aestr = ba.data();
// std::string aestdstr(aestr);
log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT"); LOG4CXX\_INFO(logger, aestr);
}
Thank you kindly for the suggestion, but oddly a missing [static] library on which log4cxx was dependent went missing. Don't ask me why the Linker didn't complain but the debugger decided to throw a buffer overrun :~
A ghost from the past. Known to others as "Linda".
-
That sums it up pretty much - The line method executed before is
void Writer::DoWrite(QString auditEntry){
QByteArray ba = auditEntry.toLatin1();
char* aestr = ba.data();
std::string aestdstr(aestr);log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("RMAT"); LOG4CXX\_INFO(logger, aestdstr);//Buffer overrun happens somewhere in this method call
}
I did the search work - Yes,
aestdstr
is terminated with '\0'. I'm running out of ideas here. The detailed error message is calledQuote:
A buffer overrun has occurred in app.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program. For more details please see Help topic 'How to debug Buffer Overrun Issues'.
Fun fact is that no one has ever seen the help topic 'How to debug Buffer Overrun Issues' (here[^]). Any thoughts on the issue?
This is probably where the buffer overrun was detected, not where it actually occurred. In general it is not possible (or prohibitively expensive) to detect the actual corruption. Try using the Page Heap[^], although this often falls in the prohibitively expensive category. Remember to disable it when you're done! WARNING: DO NOT ENABLE THE PAGE HEAP FOR ALL PROCESSES, JUST THE ONE YOU'RE DEBUGGING. YOU HAVE BEEN WARNED!
Steve